monaco-tm icon indicating copy to clipboard operation
monaco-tm copied to clipboard

Developer: Inspect Tokens menu won't load

Open shshaw opened this issue 5 years ago • 6 comments

When using this approach, the command for Developer: Inspect Tokens turns up this error.

errors.js:22 Uncaught Error: Not supported!

Error: Not supported!
    at EncodedTokenizationSupport2Adapter.tokenize (standaloneLanguages.js:110)
    at InspectTokensWidget._getStateBeforeLine (inspectTokens.js:269)
    at InspectTokensWidget._getTokensAtLine (inspectTokens.js:256)
    at InspectTokensWidget._compute (inspectTokens.js:174)
    at new InspectTokensWidget (inspectTokens.js:161)
    at InspectTokensController.launch (inspectTokens.js:79)
    at InspectTokens.run (inspectTokens.js:107)
    at InspectTokens.EditorAction.runEditorCommand (editorExtensions.js:204)
    at eval (codeEditorWidget.js:247)
    at InstantiationService.invokeFunction (instantiationService.js:84)
    at eval (errors.js:22)
eval @ errors.js:22
setTimeout (async)
ErrorHandler.unexpectedErrorHandler @ errors.js:20
ErrorHandler.onUnexpectedError @ errors.js:34
onUnexpectedError @ errors.js:48
eval @ quickCommand.js:76
setTimeout (async)
EditorActionCommandEntry.run @ quickCommand.js:68
QuickOpenModel.run @ quickOpenModel.js:423
QuickOpenWidget.elementSelected @ quickOpenWidget.js:431
eval @ quickOpenWidget.js:168

Do you know how to get around this?

shshaw avatar Oct 30 '20 18:10 shshaw

I should note I'm mainly trying to debug themes and figure out how to best port a VS Code theme over to Monaco; let me know if you have any resources on that.

shshaw avatar Oct 30 '20 18:10 shshaw

Yeah, I've hit this as well :( @alexdima any chance you could point me at a quick fix?

bolinfest avatar Dec 02 '20 06:12 bolinfest

I've pushed https://github.com/microsoft/vscode/commit/44dafcc8408a3645e61b87af76e05c063b428f40 which could help here. But basically the inspect tokens widget is not prepared to deal with TM scopes, it can only deal with flat tokens. That is why in the workbench we have another inspect tokens widget that understands TM scopes better. But in any case, an EncodedTokensProvider can now optionally provide tokens "not encoded" which would then show up in the inspect tokens widget.

alexdima avatar Dec 02 '20 19:12 alexdima

Thanks for the breakdown, @alexdima. Will that change will make its way into monaco-editor at some point?

shshaw avatar Dec 07 '20 17:12 shshaw

Yes, I plan to release a new monaco-editor version sometime in the next couple of weeks

alexdima avatar Dec 08 '20 09:12 alexdima

I've recently encountered this issue, have there been any changes?

Christiano300 avatar Apr 06 '24 14:04 Christiano300