-
Notifications
You must be signed in to change notification settings - Fork 23
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
SLLS-277 Fix JsonNull conversion error #410
SLLS-277 Fix JsonNull conversion error #410
Conversation
Some LSP clients do not send values outside of of configuration namespace. For example Neovim does not support sending client configurations to mimic the VScode behavior. Following in Lua is not possible. ```lua require('sonarlint').setup({ server = { cmd = { -- … }, settings = { sonarlint = { -- … }, ["files.exclude"] = { ["**/.git"] = true }, } }, }) ``` This commit makes sure that sonarlint language server still functions if the values won't be sent. Otherwise, the language server errors while loading the project.
5b622c0
to
19912c4
Compare
19912c4
to
6eab87d
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
@Override | ||
public String[] getVersion() throws Exception { | ||
try(var versionStream = getClass().getResourceAsStream("/slls-version.txt")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try(var versionStream = getClass().getResourceAsStream("/slls-version.txt")) { | |
try (var versionStream = getClass().getResourceAsStream("/slls-version.txt")) { |
@@ -98,4 +101,14 @@ public static void main(String... args) { | |||
System.exit(exitCode); | |||
} | |||
|
|||
public static class MavenVersionProvider implements IVersionProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is it related to Maven?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original version in #402 provided that name because it was taken from the Maven attributes in JAR's manifest. Probably, renaming is a good idea.
public static class MavenVersionProvider implements IVersionProvider { | |
public static class SonarlintVersionProvider implements IVersionProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is related to Maven because slls-version.txt
is a Maven-filtered resource that contains the ${project.version}
property.
I believe it is slightly more robust than the initial implementation because:
- This file is provided only by the language server build itself - it is not automagically generated by some Maven plugin or copied from a random JAR when building the über-JAR with dependencies
- It contains exactly the property that we want to show with the
--version
option
SLLS-277
Internal copy of #402 to let CI checks run