Embedded language support

We are creating language support and syntax highlighting in theia.
I would like to use the embedded language feature in the textmate grammar as C++ and other languages can be embedded into out language.
Taking the HTML language as an example in VSCode we also get the ‘intellisense’ popup when writing JavaScript in s SCRIPT tag. In theia we get the syntax highlighting but we don’t get the ‘intellisense’ popup.
Is there some other configuration we need to do or is this feature not available?

@StevieD666 thank you for the question, I assume you are creating a VS Code extension (from which will be consume in your Theia-based application), as Theia language extensions are deprecated.

The ‘intellisense’ or completion list generally comes from language-servers, in the case of HTML it should come from vscode-builtin-html-language-features extension.

@vince-fugnitto Yes, it’s a VSCode extension.
The vscode-builtin-html-language-features is loaded but I don’t see Intellisense for JS in the script tag like I do in VSCode. Actually I tried the gitpod workspace in case my config was wrong somehow and there is no Intellisense in the script tag.

@StevieD666 I noticed it as well, I did not investigate further as to why its the case (that js completion items are not present like in VS Code), so if you believe it is a bug please open an issue https://github.com/eclipse-theia/theia/issues.

There is the following issue, that may be related and was fixed a couple of months ago:

So I would make sure you’re using a version of this extension published after the fix was merged (July 22nd). e.g.:
https://open-vsx.org/api/vscode/html-language-features/1.48.0-next.4a1bcdafe9/file/vscode.html-language-features-1.48.0-next.4a1bcdafe9.vsix

@marcdumais-work I confirmed we are using the up to date version of the builtin in our example browser and electron apps, the completion items for embedded JS in HTML does not work similarly to VS Code.

Thanks @vince-fugnitto. If you have a minute, you could try with the exact version I linked above - it seemed to work at the time of the PR, thought I am not sure it did so exactly like in vscode.

@marcdumais-work @vince-fugnitto I tried theia in gitpod which has that exact version - it doesn’t work.
In VSCode if i press Ctrl+Space in a script tag I get a full list of IntelliSense, in theia all I get is keywords from the html I’ve entered.
As we are putting a huge amount of effort into writing our language, we’d like to know if this is a problem just for html with JavaScript/css etc as an embedded language, or is it theia not supporting enbedded languages IntelliSense correctly.

Thanks for confirming @StevieD666. Could you open an issue here about the lack of intellisense for html-builtin-extension when writing embedded JS?

I hope investigating this specific problem can help us understand if there is something generic to support this or what.

Embedded JS with HTML works for me from the HEAD of the master branch:

I did the verification with Gitpod.

Maybe some confusion @kittaakos

This first image shows what intellisense responds with in theia, JS embedded in HTML.


This second image is what intellisense returns when editing a javascript file in theia

VSCode returns the correct intellisense when JS is embedded in HTML

All theia is returning when embedded is what is in the current JS fragment in the script tag.

2 Likes

I see. Thanks! Please file an issue if you have not done that yet.