Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting not working in extension mode #4979

Closed
lancemao opened this issue Apr 24, 2019 · 11 comments
Closed

Syntax highlighting not working in extension mode #4979

lancemao opened this issue Apr 24, 2019 · 11 comments
Labels
question user / developer questions

Comments

@lancemao
Copy link

when using these steps to build theia IDE
https://www.theia-ide.org/doc/Composing_Applications.html
everything works fine

however, when build a hello-world extension described here:
https://www.theia-ide.org/doc/Authoring_Extensions.html
the syntax highlighting is not working, at least for Java, Javascript. Seems like JSON is working fine

OS: Mac
@theia/core version: 0.5.0

@akosyakov
Copy link
Member

You should add @theia/textmate-grammars to your app.

@vince-fugnitto
Copy link
Member

Closing thanks to eclipse-theia/generator-theia-extension#31

@quirinpa
Copy link

quirinpa commented Sep 8, 2021

I get a node-gyp error trying to build @theia/node-pty when trying to install @theia/textmate-grammars so I can't check that this solution fixes syntax highlighting in my case. I've used https://www.theia-ide.org/doc/Composing_Applications.html and I still got no syntax highlighting (javascript). I find it strange that in the theia repository itself, examples/browser/package.json doesn't reference @theia/textmate-grammars, but if I run theia there I get syntax highlighting.

@vince-fugnitto
Copy link
Member

I get a node-gyp error trying to build @theia/node-pty when trying to install @theia/textmate-grammars so I can't check that this solution fixes syntax highlighting in my case. I've used https://www.theia-ide.org/doc/Composing_Applications.html and I still got no syntax highlighting (javascript). I find it strange that in the theia repository itself, examples/browser/package.json doesn't reference @theia/textmate-grammars.

@quirinpa @theia/textmate-grammars has been deprecated for some time now (since v0.16.0):

[textmate-grammars] removed the @theia/textmate-grammars extension #6933

  • The extension will no longer be maintained by the project and remains in the Git history for anyone who would like to reference it or maintain it.

Syntax-highlighting is now contributed by vscode plugins.

@quirinpa
Copy link

quirinpa commented Sep 8, 2021

Thanks for the information @vince-fugnitto. In that case shouldn't the "vscode-builtin-javascript" give me js syntax highlighting? It is listed in my package.json theiaPlugins..

@vince-fugnitto
Copy link
Member

Thanks for the information @vince-fugnitto. In that case shouldn't the "vscode-builtin-javascript" give me js syntax highlighting? It is listed in my package.json theiaPlugins..

Given you have plugin support (through the appropriate extensions), the vscode-builtin-javascript plugin should provide you with javascript syntax highlighting:

"vscode-builtin-javascript": "https://open-vsx.org/api/vscode/javascript/1.45.1/file/vscode.javascript-1.45.1.vsix",

@quirinpa
Copy link

quirinpa commented Sep 8, 2021

Thanks. I have copied and pasted the second example package.json file in https://www.theia-ide.org/doc/Composing_Applications.html. So i got the "@theia/plugin-ext-vscode" extension.. Shouldn't this be enough?

@vince-fugnitto
Copy link
Member

Thanks. I have copied and pasted the second example package.json file in https://www.theia-ide.org/doc/Composing_Applications.html. So i got the "@theia/plugin-ext-vscode" extension.. Shouldn't this be enough?

It should be, you can confirm you actually have the plugin present under the plugins folder (which should be downloaded by the script). When starting the application, and opening a js file you should have syntax highlighting.

@quirinpa
Copy link

quirinpa commented Sep 8, 2021

It is present. But I have no syntax highlighting. Weird. Maybe I messed up somehow, but I simply followed the tutorial. Thank you very much for your quick replies. Should I open a new issue?

@vince-fugnitto
Copy link
Member

It is present. But I have no syntax highlighting. Weird. Maybe I messed up somehow, but I simply followed the tutorial. Thank you very much for your quick replies. Should I open a new issue?

@quirinpa I was able to confirm the example works on my end:

  • yarn
  • yarn start

In the plugins view I see the plugins present (view > plugins):

image

and I have syntax highlighting present:

image

@quirinpa
Copy link

quirinpa commented Sep 8, 2021

Theia wasn't seeing any plugins. I was doing "yarn theia start" without arguments so that's why. I'm sorry for the rookie mistake. Running "yarn start" fixes this. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question user / developer questions
Projects
None yet
Development

No branches or pull requests

4 participants