Vscode: JS intellisense doesnt work in HTML script tag

Created on 17 Mar 2016  Â·  13Comments  Â·  Source: microsoft/vscode

  • VSCode Version: 0.10.11
  • OS Version: Windows 7 SP1 32 bit

Steps to Reproduce:

  1. Create an HTML file and a <script type="text/javascript> ....... </script> block.
  2. Start coding in the block then you will see intellisense doesnt work.

Here is the developer console log:
Main Thread sent to worker the following message: Object {type: "threadService", payload: Array[3]}payload: Array[3]type: "threadService"__proto__: Object And the worker replied with an error: Object {$isError: true, name: "TypeError", message: "Cannot read property 'textualSuggest' of undefined", stack: "TypeError: Cannot read property 'textualSuggest' o…itor/common/worker/editorWorkerServer.js:13:8022)"}$isError: truemessage: "Cannot read property 'textualSuggest' of undefined"name: "TypeError"stack: "TypeError: Cannot read property 'textualSuggest' of undefined↵ at e.suggest (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/editor/common/worker/editorWorkerServer.js:7:18225)↵ at file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/htmlWorker.js:8:18557↵ at e._delegateToModeAtPosition (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/htmlWorker.js:8:14422)↵ at e.suggest (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/htmlWorker.js:8:18449)↵ at file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/html.js:4:11031↵ at t.Class.define.then (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/base/common/worker/workerServer.js:5:847)↵ at t.worker (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/editor/common/worker/editorWorkerServer.js:10:17106)↵ at e._worker (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/html.js:4:8363)↵ at e.suggest (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/html.js:4:11002)↵ at t.OneWorker (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/editor/common/worker/editorWorkerServer.js:13:8022)"__proto__: Object Cannot read property 'textualSuggest' of undefined: TypeError: Cannot read property 'textualSuggest' of undefined at e.suggest (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/editor/common/worker/editorWorkerServer.js:7:18225) at file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/htmlWorker.js:8:18557 at e._delegateToModeAtPosition (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/htmlWorker.js:8:14422) at e.suggest (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/htmlWorker.js:8:18449) at file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/html.js:4:11031 at t.Class.define.then (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/base/common/worker/workerServer.js:5:847) at t.worker (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/editor/common/worker/editorWorkerServer.js:10:17106) at e._worker (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/html.js:4:8363) at e.suggest (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/languages/html/common/html.js:4:11002) at t.OneWorker (file:///C:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/editor/common/worker/editorWorkerServer.js:13:8022) TypeError: Cannot convert object to primitive value at new Error (native) at Client.trackException (C:\Program Files\Microsoft VS Code\resources\app\node_modules\applicationinsights\Library\Client.js:67:25) at e.logException (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:23:30848) at e.log (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:112:10791) at t.handleEvent (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:68:2959) at t.e.publicLog (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:68:144) at t.publicLog (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:68:5186) at t.e.flushErrorBuffer (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:67:30198) at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:67:30058 Uncaught TypeError: Cannot convert object to primitive value

bug important verified

Most helpful comment

@Jakeii Will it get fixed recently? Since this issue has existed for months.

It's really important for me because inline script is more convenient for creating web components.

All 13 comments

@alexandrudima This is something we don't support anymore, right?

@alexandrudima Unsure how things work now. The issue seems to be that an TextualSuggestSupport is being created on the worker side which then misses a reference to an editor worker service

Inline JavaScript inside HTML no longer gets any rich features since the adoption of Salsa.

What is bad is that this fails with so many errors (i.e. it should fail gracefully).

yeah, it needs a graceful check for undefined. I'd figure you know where...

This bug is still present for me. Or do I need to setup something to get inline JavaScript working inside HTML?

Since we are moving language support from a bulit-in architecture into extensions this feature got lost and will come back soon

@Jakeii Will it get fixed recently? Since this issue has existed for months.

It's really important for me because inline script is more convenient for creating web components.

yes kindly fix it asap this is really important

When this bug will be fixed?

I'm assuming since this issue is closed. Commenting here is futile?

Any word of this been fixed instead of just closed off?

As said earlier - the underlying implementation has been removed and we utilise a different language brain for JavaScript. Proper support for nested languages is tracked here: https://github.com/Microsoft/vscode/issues/8928

yea as said earlier - "lost and will come back soon" - after 5 months and no linked ticket until asked for it.

You can take your Snottery tone and shove it!

Was this page helpful?
0 / 5 - 0 ratings