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

Haskell syntax highlighting no longer works #2307

Closed
seanchen1991 opened this issue Aug 16, 2020 · 10 comments
Closed

Haskell syntax highlighting no longer works #2307

seanchen1991 opened this issue Aug 16, 2020 · 10 comments
Labels
A-syntax-highlighting Area: Syntax Highlighting bug Something isn't working

Comments

@seanchen1991
Copy link

It seems like syntax highlighting functionality was rewritten recently. It now outputs JSON instead of XML, according to @CrossR:
Screen Shot 2020-08-15 at 5 07 15 PM

How could this issue be resolved?

@seanchen1991
Copy link
Author

This issue mentions that the language-haskell extension isn't currently published on open-vsx.org. Is that possibly related to this issue?

@CrossR
Copy link
Member

CrossR commented Aug 16, 2020

For more concrete info, what I mean is that the package.json says "This language haskell has its syntax file over here: ./syntaxes/haskell.json". But that file doesn't exist in the plugin, it is instead a haskell.YAML-tmLanguage which is assumedly transformed into the haskell.json file at some part of the extension setup process.

https://github.com/JustusAdam/language-haskell/blob/03c08889dd19c3ab92643111fe6b34fd0428341f/package.json#L132-L134

https://github.com/JustusAdam/language-haskell/tree/master/syntaxes

@CrossR CrossR added A-syntax-highlighting Area: Syntax Highlighting bug Something isn't working labels Aug 16, 2020
@glennsl
Copy link
Member

glennsl commented Aug 16, 2020

Here's the commit that introduced the change: JustusAdam/language-haskell@8acc8bd

Seems to be a vscode task that executes a script using js-yaml to do the conversion.

@seanchen1991
Copy link
Author

So is this a bug that has to be addressed on onivim's side or the plugin's side?

@CrossR
Copy link
Member

CrossR commented Aug 16, 2020

Onivim's side, we aren't running this https://github.com/JustusAdam/language-haskell/blob/master/.vscode/launch.json (which says to run compile-all which runs the stuff in the Makefile that makes the JSON files).

I believe this is the first plugin we've come across that has these launch steps, so we are missing it from the ext host.
For now, if you were to run js-yaml yourself in the folder, or to copy the compiled syntax from the vscode folder, it would work. Its just since we are missing that single file.

@glennsl
Copy link
Member

glennsl commented Aug 16, 2020

It could also be addressed on the plugin side though, and I think that would be preferable. It seems unnecessary to have a compilation step that runs every time the extension is launched, most likely incurring a notable delay, instead of doing it as part of the publish process.

@seanchen1991
Copy link
Author

Forgot to mention earlier that whenever I'd open a Haskell file without the haskell.json file being present, the whole program crashed as a result. Is this expected behavior?

@bryphe
Copy link
Member

bryphe commented Aug 18, 2020

Yep - the vscode-task is actually meant as a build step (it gets run when you run the extension via F5 in VSCode) - but when the package is bundled, it's expected the build syntax files are there.

The issue is that the build step make all isn't included in the build steps for that plugin in the open-vsx publish script: https://github.com/open-vsx/publish-extensions/blob/0c0d5e507cfe30867e7ca4c2607cdd9fa00c4c69/extensions.json#L464

Once that's added, the extension gets those syntaxes, and everything works:
image

@bryphe
Copy link
Member

bryphe commented Aug 18, 2020

Opened a PR here to add the make all to open-vsx's prepublish script: open-vsx/publish-extensions#122

bryphe added a commit that referenced this issue Aug 19, 2020
Continuation of work in #933 - updating PR to new subscription model

This allow setting the filetype via `:set filetype=`, or by clicking the filetype in the menu bar:

![2020-08-18 12 42 28](https://user-images.githubusercontent.com/13532591/90558212-8a2c1700-e150-11ea-856d-52f9a0789f92.gif)

__TODO:__
- [x] Fix filetype being lost on save
- [x] Implement clickable status bar
- [x] Implement menu

Fixes #782
@bryphe
Copy link
Member

bryphe commented Aug 22, 2020

Looks like open-vsx is now updated with version 3.3.0 w/ our make all fix - from a fresh install:

image

Might be necessary to uninstall / install the language-haskell extension to pick up the latest. Will close this out as fixed, but please let me know if you still see issues.

@bryphe bryphe closed this as completed Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntax-highlighting Area: Syntax Highlighting bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants