-
Notifications
You must be signed in to change notification settings - Fork 29
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
docs: Getting started documentation #33
Conversation
cb11dff
to
4b53999
Compare
0cf9ae8
to
63bafcb
Compare
1777a46
to
4b04b53
Compare
3ff3148
to
91cb6e4
Compare
1b91f64
to
92bc62b
Compare
3b64430
to
3e50b1d
Compare
3e50b1d
to
5c5968b
Compare
45fab1b
to
98385ef
Compare
Fixes redhat-developer#24 Signed-off-by: azerr <[email protected]>
98385ef
to
3d10917
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.
Still need to check LSPSupport.md
docs/DeveloperGuide.md
Outdated
|
||
### Exclude all LSP4J dependencies | ||
|
||
LSP4IJ depends on [Eclipse LSP4J](https://github.com/eclipse-lsp4j/lsp4j) (Java binding for the [Language Server Protocol](https://microsoft.github.io/language-server-protocol) and the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol).). It uses a given version of LSPJ and their classes are loaded in the LSP4IJ plugin class loader. |
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 provides its own version of LSP4J and its classes are loaded in the LSP4IJ plugin class loader.
docs/DeveloperGuide.md
Outdated
|
||
LSP4IJ depends on [Eclipse LSP4J](https://github.com/eclipse-lsp4j/lsp4j) (Java binding for the [Language Server Protocol](https://microsoft.github.io/language-server-protocol) and the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol).). It uses a given version of LSPJ and their classes are loaded in the LSP4IJ plugin class loader. | ||
|
||
Your IntelliJ Plugin should use `the same LSP4J classes than LSP4IJ` to avoid some `ClassCastException` errors. To do that you need to `exclude all LSP4J dependencies` from your plugin. |
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.
Your IntelliJ Plugin must not embed its own version of LSP4J, in order to avoid conflicts with the version provided by LSP4IJ. Failing to do see will result in ClassCastException
errors to be thrown. Make sure that the LSP4J dependency in your plugin is either declared with a "runtimeOnly" scope or excluded entirely if it's included as a transitive dependency.
docs/DeveloperGuide.md
Outdated
|
||
Your IntelliJ Plugin should use `the same LSP4J classes than LSP4IJ` to avoid some `ClassCastException` errors. To do that you need to `exclude all LSP4J dependencies` from your plugin. | ||
|
||
Here a sample used in [Quarkus Tools](https://github.com/redhat-developer/intellij-quarkus) in [build.gradle.kts](https://github.com/redhat-developer/intellij-quarkus/blob/main/build.gradle.kts) to exclude LSP4J dependency from the [Qute Language Server](https://github.com/redhat-developer/quarkus-ls/tree/master/qute.ls) which have a dependency to LSP4J: |
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.
to exclude the LSP4J dependency from the Qute Language Server.
docs/DeveloperGuide.md
Outdated
## LanguageServerFactory | ||
|
||
Create an implementation of [LanguageServerFactory](https://github.com/redhat-developer/lsp4ij/blob/main/src/main/java/com/redhat/devtools/lsp4ij/LanguageServerFactory.java) to use your `my.language.server.MyLanguageServer`, `my.language.server.MyLanguageClient` and defines a custom LanguageServer API if you need: | ||
|
||
```java | ||
package my.language.server; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import com.redhat.devtools.lsp4ij.LanguageServerFactory; | ||
import com.redhat.devtools.lsp4ij.client.LanguageClientImpl; | ||
import com.redhat.devtools.lsp4ij.server.StreamConnectionProvider; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class MyLanguageServerFactory implements LanguageServerFactory { | ||
|
||
@Override | ||
public @NotNull StreamConnectionProvider createConnectionProvider(@NotNull Project project) { | ||
return new MyLanguageServer(project); | ||
} | ||
|
||
@Override | ||
public @NotNull LanguageClientImpl createLanguageClient(@NotNull Project project) { | ||
return new MyLanguageClient(project); | ||
} | ||
} | ||
``` |
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.
move below L37
docs/DeveloperGuide.md
Outdated
|
||
## Add specific IJ features | ||
|
||
When it is possible, LSP4IJ declare the IJ feature with `any` language. |
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.
LSP4IJ binds IJ features to any
language.
docs/DeveloperGuide.md
Outdated
<codeInsight.inlayProvider | ||
language="MyLanguage" | ||
implementationClass="com.redhat.devtools.lsp4ij.operations.codelens.LSPCodelensInlayProvider"/> | ||
``` | ||
|
||
* `textDocument/inlayHint`: | ||
|
||
```xml | ||
<codeInsight.inlayProvider | ||
language="MyLanguage" | ||
implementationClass="com.redhat.devtools.lsp4ij.operations.codelens.LSPInlayHintInlayProvider"/> | ||
``` |
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.
this should not be necessary anymore right?
docs/UserGuide.md
Outdated
|
||
![LSP console](./images/LSPConsole.png) | ||
|
||
When language server is started, several action like stopping the language server or copy the command which starts the language servers are available: |
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.
several actions
224d685
to
8a37c68
Compare
Signed-off-by: Fred Bricon <[email protected]>
2f2b43c
to
ab5e0f2
Compare
Signed-off-by: Fred Bricon <[email protected]>
ab5e0f2
to
5018db4
Compare
Thanks so much @fbricon for your great review! |
docs: Getting started documentation
Fixes #24