You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/LSPSupport.md
+53-2Lines changed: 53 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,13 +192,64 @@ Here is an example with the [Qute language server](https://github.com/redhat-dev
192
192
193
193
#### Hover
194
194
195
-
[textDocument/hover](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_hover) is implemented with `platform.backend.documentation.targetProvider`
196
-
extension point to support any language and`textDocument/hover`works out-of-the-box.
195
+
[textDocument/hover](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_hover) is implemented with the `platform.backend.documentation.targetProvider`
196
+
extension point, to support any language, making`textDocument/hover`work out-of-the-box for all languages.
197
197
198
198
Here is an example with the [Qute language server](https://github.com/redhat-developer/quarkus-ls/tree/master/qute.ls) showing documentation while hovering over an `include` section:
The rules to retrieve the proper syntax coloration are:
237
+
238
+
* if the code block defines the file extension, LSP4IJ tries to apply a matching TextMate grammar or custom syntax coloration by filename, mimetype.
239
+
* if the code block defines a language Id (e.g. `typescript`) and the syntax coloration must be retrieved from TextMate, it will use the
240
+
[fileNamePatterns extension point](./DeveloperGuide.md#file-name-pattern-mapping) or [./UserDefinedLanguageServer.md#mappings-tab](fileNamePattern of User defined language server)
241
+
to find the file extension (e.g. `ts`) associated with the languageId (e.g. `typescript`)
242
+
~~~
243
+
```typescript
244
+
const s = "";
245
+
const c = s.charAt(0);
246
+
```
247
+
~~~
248
+
* if the code block doesn't define the language, or indented blockquotes are used, it will fall back to the syntax coloration from the file in which the hover / completion documentation request was triggered.
249
+
250
+
If those strategies are insufficient for your needs, please [create an issue](https://github.com/redhat-developer/lsp4ij/issues) to request an extension point
251
+
for mapping the language and the file extension.
252
+
202
253
#### CodeLens
203
254
204
255
[textDocument/codeLens](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeLens) is implemented with the `codeInsight.codeVisionProvider` extension point.
0 commit comments