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

Cannot consume language server with lsp4j 0.5.0 because of colorprovider #190

Closed
angelozerr opened this issue May 12, 2018 · 19 comments
Closed
Milestone

Comments

@angelozerr
Copy link

angelozerr commented May 12, 2018

I'm trying to consume CSS language server from vscode with lsp4j 0.5.0 but I have an error of parsing with colorprovider.

It seems that lsp4j wait for a result for colorprovider with an object although all CSS, JSON, HTML language server returns a boolean https://github.com/Microsoft/vscode/search?utf8=%E2%9C%93&q=colorprovider&type=

When I change the colorprovider from true to {} in the CSS language server, all features are working.

Is lsp4j or vscode which have done an error?

@angelozerr angelozerr changed the title Cannot consume language server because of colorprovider Cannot consume language server with lsp4j 5.0.0 because of colorprovider May 12, 2018
@spoenemann
Copy link
Contributor

You mean LSP4J 0.4.0, right?

In the specification, the type of the colorProvider field of ServerCapabilities is given as

colorProvider?: ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);

They should either fix the CSS, JSON and HTML language servers or update the specification to make clear that boolean is also allowed.

@angelozerr angelozerr changed the title Cannot consume language server with lsp4j 5.0.0 because of colorprovider Cannot consume language server with lsp4j 0.5.0 because of colorprovider May 14, 2018
@angelozerr
Copy link
Author

You mean LSP4J 0.4.0, right?

No I mean 0.5.0, but I didn't know that LSP4J 0.4.0 provided this color support.

They should either fix the CSS, JSON and HTML language servers or update the specification to make clear that boolean is also allowed.

Exactly! And there is too a problem with color presentations microsoft/vscode-languageserver-node#348

Today we cannot consume CSS, HTML, JSON Language server with LSP4j 0.4.0 because it crashes on the initialisation because colorProvider is an boolean on server side.

But I don't understand why TypeScript is working although it defines colorProvider like Java :

https://github.com/Microsoft/vscode-languageserver-node/blob/eca5fd2f23529315d53b9dad98377fb968ceba56/protocol/src/protocol.colorProvider.ts#L39

@spoenemann
Copy link
Contributor

But I don't understand why TypeScript is working although it defines colorProvider like Java

Probably because TypeScript is JavaScript, which allows any expression to evaluate to boolean. And by using JSON.parse(...) they don't perform any checks on the JSON structure.

@spoenemann
Copy link
Contributor

No I mean 0.5.0

You mean 0.5.0-SNAPSHOT? There is no release 0.5.0 yet. the current SNAPSHOT is still on the same state as the 0.4.0 release.

Today we cannot consume CSS, HTML, JSON Language server with LSP4j 0.4.0 because it crashes on the initialisation because colorProvider is an boolean on server side.

Please open issues at VS Code / LSP. We can keep this one open and update LSP4J in case they decide to allow boolean for colorProvider.

@angelozerr
Copy link
Author

Please open issues at VS Code / LSP. We can keep this one open and update LSP4J in case they decide to allow boolean for colorProvider.

Done at microsoft/vscode-languageserver-node#349

@spoenemann
Copy link
Contributor

I'll update LSP4J according to microsoft/vscode-languageserver-node#348 and microsoft/vscode-languageserver-node#349 and then release a version 0.4.1 with these updates.

Is there anything else that should be included in version 0.4.1?

@angelozerr
Copy link
Author

I'll update LSP4J according to microsoft/vscode-languageserver-node#348 and microsoft/vscode-languageserver-node#349 and then release a version 0.4.1 with these updates.

Wow it's a very cool news!

Is there anything else that should be included in version 0.4.1?

For color, I think it's OK, but it's hard to confirm that without testing. Is there an update site where I could try it?

An another question, @mickaelistria told me if lsp4j 0.4.1 could be in part of Photon https://bugs.eclipse.org/bugs/show_bug.cgi?id=533322#c5 If yes it will be a very cool news because LSP4e could host color support.

@spoenemann
Copy link
Contributor

For color, I think it's OK, but it's hard to confirm that without testing. Is there an update site where I could try it?

http://services.typefox.io/open-source/jenkins/job/lsp4j/job/release_0.4.1/lastStableBuild/artifact/build/p2-repository/

if lsp4j 0.4.1 could be in part of Photon

We'll include LSP4J 0.4.1 in Photon M7.

@spoenemann
Copy link
Contributor

Please close this once the fix is verified.

@angelozerr
Copy link
Author

Which update site can I use to consume 0.4.1 ? I have tried http://download.eclipse.org/lsp4j/updates/milestones/ but its 0.40 and not 0.4.1?

Thanks for your help

@spoenemann
Copy link
Contributor

@angelozerr
Copy link
Author

Perfect @spoenemann ! I will give you feedback ASAP

@angelozerr
Copy link
Author

@spoenemann it works like a charm with 0.4.1 ! Thanks for your fix.

Do you know when you could do a release of 0.4.1 which will be available with http://download.eclipse.org/lsp4j/updates/releases/?

@spoenemann
Copy link
Contributor

Tomorrow.

@angelozerr
Copy link
Author

@spoenemann I have tested now and it seems http://download.eclipse.org/lsp4j/updates/releases/ is 0.4.0 again? Sorry I'm so impatient :)

@spoenemann
Copy link
Contributor

Now it's there.

We've been too late to include this in Photon M7, but it will get into RC1.

@angelozerr
Copy link
Author

Thank a lot @spoenemann, it works like a charm now.

Here the result with LSP4e from https://bugs.eclipse.org/bugs/show_bug.cgi?id=533322:

lspcolorsupport

@angelozerr
Copy link
Author

@spoenemann I don't know if you are using lsp4j mailing list https://dev.eclipse.org/mhonarc/lists/lsp4j-dev/msg00022.html I repost the question from @martinlippert

I don't see lsp4j 0.4.1 in the Photon staging repo yet (it still contains 0.4.0)

@martinlippert
Copy link

@angelozerr @spoenemann got the answer already, having lsp4j 0.4.1 in Photon RC1 is perfect. Thanks!!!

@spoenemann spoenemann added this to the v0.4.1 milestone Aug 17, 2018
adietish pushed a commit to adietish/lsp4j that referenced this issue Aug 20, 2024
Fixes eclipse-lsp4j#190

Signed-off-by: azerr <azerr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants