Yatoom / emmet-atom-simplified

Emmet support for Atom
MIT License
10 stars 3 forks source link

Uncaught Error: Invalid abbreviation #8

Open dflock opened 7 years ago

dflock commented 7 years ago

[Enter steps to reproduce:]

  1. Editing a markdown file, with the markdown preview open
  2. ?

Atom: 1.16.0-beta0 x64 Electron: 1.3.13 OS: Ubuntu 16.04.2 Thrown From: emmet-simplified package 2.5.0

Stack Trace

Uncaught Error: Invalid abbreviation

At /usr/share/atom-beta/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:833

Error: Invalid abbreviation
    at Object.setAbbreviation (/packages/emmet-simplified/node_modules/emmet/lib/parser/abbreviation.js:344:11)
    at parseAbbreviation (/packages/emmet-simplified/node_modules/emmet/lib/parser/abbreviation.js:560:14)
    at Object.parse (/packages/emmet-simplified/node_modules/emmet/lib/parser/abbreviation.js:890:15)
    at Object.expand (/packages/emmet-simplified/node_modules/emmet/lib/parser/abbreviation.js:957:26)
    at /packages/emmet-simplified/node_modules/emmet/lib/action/expandAbbreviation.js:65:25)
    at /packages/emmet-simplified/node_modules/emmet/lib/assets/handlerList.js:93:19
    at /packages/emmet-simplified/node_modules/emmet/lib/utils/common.js:600:10
    at Array.some (native)
    at Object.find (/packages/emmet-simplified/node_modules/emmet/lib/utils/common.js:599:9)
    at Object.exec (/packages/emmet-simplified/node_modules/emmet/lib/assets/handlerList.js:92:10)
    at Object.expandAbbreviationAction (/packages/emmet-simplified/node_modules/emmet/lib/action/expandAbbreviation.js:110:20)
    at Object.expandAbbreviationWithTabAction (/packages/emmet-simplified/node_modules/emmet/lib/action/expandAbbreviation.js:140:14)
    at Object.run (/packages/emmet-simplified/node_modules/emmet/lib/action/main.js:150:21)
    at Object.run (/packages/emmet-simplified/node_modules/emmet/lib/emmet.js:81:23)
    at runAction (/packages/emmet-simplified/lib/emmet.coffee:91:9)
    at /packages/emmet-simplified/lib/emmet.coffee:59:9
    at Object.exec (/packages/emmet-simplified/lib/editor-proxy.coffee:80:10)
    at /packages/emmet-simplified/lib/emmet.coffee:58:19
    at TextBuffer.module.exports.TextBuffer.transact (/app.asar/node_modules/text-buffer/lib/text-buffer.js:828:18)
    at TextEditor.module.exports.TextEditor.transact (/app.asar/src/text-editor.js:1594:26)
    at /packages/emmet-simplified/lib/emmet.coffee:57:24)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/app.asar/src/window-event-handler.js:106:36)
    at /app.asar/src/window-event-handler.js:3:59)

Commands

     -1:23.9.0 core:backspace (input.hidden-input)
     -1:20.2.0 intentions:highlight (input.hidden-input)
     -1:19.9.0 core:save (input.hidden-input)
     -1:05.6.0 autocomplete-plus:cancel (input.hidden-input)
  6x -1:03.9.0 core:move-down (input.hidden-input)
     -1:02.6.0 intentions:highlight (input.hidden-input)
     -1:02.3.0 core:save (input.hidden-input)
     -0:27.1.0 intentions:highlight (input.hidden-input)
     -0:27 editor:duplicate-lines (input.hidden-input)
  5x -0:26 core:move-left (input.hidden-input)
  6x -0:25.2.0 core:backspace (input.hidden-input)
     -0:14.7.0 emmet:expand-abbreviation-with-tab (input.hidden-input)
  6x -0:11.9.0 core:move-left (input.hidden-input)
  3x -0:10.8.0 core:move-down (input.hidden-input)
     -0:10.1.0 intentions:highlight (input.hidden-input)
     -0:10 core:save (input.hidden-input)

Non-Core Packages

advanced-open-file 0.16.6 
ansible-snippets 0.2.0 
ariake-dark-syntax 0.1.3 
asciidoc-assistant 0.2.2 
asciidoc-image-helper 1.0.0 
asciidoc-preview 2.9.0 
atom-alignment 0.12.1 
Atom-Bash-Snippets 0.0.3 
atom-beautify 0.29.17 
atom-dark-fusion-syntax 2.0.3 
atom-jade 0.3.0 
atom-jinja2 0.6.0 
atom-material-syntax 1.0.2 
atom-material-syntax-dark 0.2.7 
atom-material-ui 1.3.9 
atom-mermaid 3.0.0 
atom-monokai 0.10.9 
atom-special-char-highlighter 0.1.0 
atomatigit 1.5.5 
autocomplete-asciidoc 0.1.2 
autocomplete-bash-builtins 0.3.5 
autocomplete-html-entities 0.1.0 
autocomplete-modules 1.6.8 
autocomplete-project-paths 2.2.0 
autocomplete-python 1.8.60 
busy-signal 1.3.0 
character-table 0.4.3 
color-picker 2.2.5 
copy-as-rtf 0.9.3 
docblockr 0.9.1 
duotone-dark-earth-syntax 2.1.0 
duotone-dark-forest-syntax 2.1.0 
duotone-dark-sea-syntax 2.1.0 
duotone-dark-space-syntax 2.1.0 
duotone-dark-syntax 2.1.0 
editorconfig 2.2.2 
emmet-simplified 2.5.0 
file-icons 2.0.17 
file-templates 0.2.0 
file-types 0.5.5 
file-watcher 1.1.0 
flatwhite-syntax 0.8.0 
genesis-syntax 1.0.9 
git-blame 0.4.12 
git-control 0.8.2 
git-hide 1.0.0 
git-history 3.2.0 
git-plus 7.3.3 
git-time-machine 1.5.6 
hard-wrap 1.1.0 
indent-guide-improved 1.4.12 
intentions 1.1.2 
json-converter 0.2.4 
language-ansible 0.2.1 
language-asciidoc 1.8.0 
language-babel 2.56.2 
language-diff 0.7.0 
language-docker 1.1.7 
language-dotfiles 1.0.0 
language-dots 0.0.4 
language-generic-config 1.3.0 
language-gradle 0.0.3 
language-groovy 0.6.0 
language-hosts 0.1.2 
language-ini 1.19.0 
language-latex 1.0.0 
language-log 1.8.0 
language-mermaid 0.6.0 
language-mongodb 0.3.1 
language-nginx 0.6.2 
language-pug 0.0.21 
language-restructuredtext 1.0.2 
language-robot-framework 2.2.0 
language-svg 0.9.2 
language-vue 0.21.2 
last-cursor-position 0.9.0 
less-than-slash 0.16.0 
linter 2.1.0 
linter-alex 3.2.0 
linter-ansible-syntax 1.1.3 
linter-csslint 1.3.4 
linter-docker 0.1.4 
linter-js-standard 3.9.0 
linter-js-yaml 1.2.7 
linter-jscs 4.1.2 
linter-jshint 3.0.3 
linter-jsonlint 1.3.0 
linter-less 2.6.0 
linter-markdown 3.1.0 
linter-pug 1.3.0 
linter-pycodestyle 2.0.0 
linter-pydocstyle 0.4.5 
linter-sass-lint 1.7.4 
linter-shellcheck 1.4.3 
linter-swagger 0.3.9 
linter-ui-default 1.2.1 
linter-write-good 0.8.0 
linter-xmllint 1.4.1 
markdown-themeable-pdf 1.2.0 
markdown-writer 2.6.4 
minimap 4.26.8 
minimap-bookmarks 0.4.2 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-linter 1.6.0 
minimap-selection 4.4.0 
minimap-split-diff 0.3.6 
monokai 0.22.0 
monokai-slate 0.6.0 
nebula-syntax 0.4.4 
nebula-ui 0.6.0 
nord-atom-syntax 0.6.0 
nord-atom-ui 0.10.2 
oceanic-next 1.0.0 
oceanic-reef-syntax 0.6.0 
open-path 0.3.6 
open-terminal-here 2.3.0 
pigments 0.39.1 
prettier-atom 0.23.1 
pretty-json 1.6.1 
pubster-syntax 3.0.1 
robot-selenium-snippet 1.0.1 
rst-preview-pandoc 0.1.12 
set-syntax 0.3.2 
slime 2.1.0 
sort-lines 0.14.0 
split-diff 1.2.0 
ssh-config 0.10.1 
standardjs-snippets 2.6.0 
susave 0.4.0 
symbols-tree-view 0.13.2 
synced-sidebar 0.4.3 
tabs-closer 0.14.0 
text-manipulation 0.6.0 
title-case 0.4.0 
toggle-quotes 1.0.1 
tornado-templates 0.2.0 
tree-view-git-status 1.3.1 
Zen 0.16.4 
johnchristopherjones commented 7 years ago

More generally, this exception is thrown very commonly in "mixed mode" contexts where Emmet shouldn't really be invoked. I can see it happening in Markdown if Emmet is enabled. Sometimes you want to write HTML in Markdown.

I almost always hit this when writing Angular templates.

If I'm trying to type <td>{{filingDate | date}}</td> in an Angular template, I will probably be about this far <td>{{filingDate |}}</td>, then fat-finger "shift+space" by not quite letting off the the shift key while coming off the pipe. That causes Emmet to try to expand and kaboom — I have to dismiss this error.

In this circumstance, Emmet shouldn't be invoked inside the Angular template string. I fat fingered it, but I do still want Emmet to write the HTML in the Angular template.

If Emmet could be disabled inside Angular template strings ({{}}) or at least not produce the error dialog, that'd neat.