microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.95k stars 29.53k forks source link

HTML Language Server error thrown when editing html attribute #57400

Closed smlombardi closed 6 years ago

smlombardi commented 6 years ago

Issue Type: Bug

In today's insider, I did a "select all matches" to replace some css classes. I typed one class and then pasted the second class from the clipboard, and boom, I got this error:

[Error - 8:33:01 AM] Error while formatting range for file:///Users/st016lo/github/ng-designsystem/client/src/app/demo/tables/faceted-search/faceted-search.component.html: last_token is not defined
ReferenceError: last_token is not defined
    at m.beautify (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:93697)
    at e.exports (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:87722)
    at t.indent_size (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:105314)
    at Object.$e [as format] (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:105328)
    at Object.format (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:175102)
    at Object.t.format (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:178185)
    at Object.<anonymous> (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:122231)
    at /Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:115360
    at Object.next (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:115465)
    at a (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:114211)
[Error - 8:33:07 AM] Error while formatting range for file:///Users/st016lo/github/ng-designsystem/client/src/app/demo/tables/faceted-search/faceted-search.component.html: last_token is not defined
ReferenceError: last_token is not defined
    at m.beautify (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:93697)
    at e.exports (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:87722)
    at t.indent_size (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:105314)
    at Object.$e [as format] (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:105328)
    at Object.format (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:175102)
    at Object.t.format (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:178185)
    at Object.<anonymous> (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:122231)
    at /Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:115360
    at Object.next (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:115465)
    at a (/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/html-language-features/server/dist/htmlServerMain.js:7:114211)

VS Code version: Code - Insiders 1.27.0-insider (f881f8c4229863782a01eae80d70b4d6d540e39d, 2018-08-28T09:47:27.146Z) OS version: Darwin x64 17.7.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 3, 3| |Memory (System)|16.00GB (0.22GB free)| |Process Argv|/Users/st016lo/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron -psn_0_18227553| |Screen Reader|no| |VM|0%|
Extensions (26) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|1.2.6 Bookmarks|ale|9.0.3 project-manager|ale|8.0.0 bracket-pair-colorizer|Coe|1.0.59 vscode-eslint|dba|1.5.0 tslint|eg2|1.0.38 vscode-great-icons|emm|2.1.41 prettier-vscode|esb|1.6.1 path-autocomplete|ion|1.12.0 svg|joc|0.1.1 ecdc|mit|0.12.0 HTMLHint|mka|0.5.0 theme-monokai-pro-vscode|mon|1.1.8 vscode-scss|mrm|0.6.2 vscode-stylefmt|mrm|2.5.0 debugger-for-chrome|msj|4.8.2 angular2-inline|nat|0.0.17 incrementor|nms|0.1.0 vscode-versionlens|pfl|0.21.1 quicktype|qui|12.0.40 code-settings-sync|Sha|3.1.0 stylelint|shi|0.42.0 rewrap|stk|1.9.1 sort-lines|Tyr|1.7.0 vscode-terminal-here|Tyr|0.1.1 change-case|wma|1.0.0 (2 theme extensions excluded)
pharrisee commented 6 years ago

I'm seeing the same when formatting an HTML document.

hassanbinsafdar commented 6 years ago

same here

freddyjimenez commented 6 years ago

Same here

patrickracicot commented 6 years ago

+1

aeschli commented 6 years ago

duplicate of #57445