Skip to content

Commit

Permalink
Fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaRanasinghe committed Dec 5, 2024
1 parent 3443bdc commit 0f14f01
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ You can specify multiple extensions for a server by separating them with a comma
If you want to bind your language server definition only with a specific set of files, you can use that
specific file pattern as a regex expression instead of binding with the file extension (e.g., "application*.properties").

###### Example Usage:
**Example Usage:**

```java
new RawCommandServerDefinition("bal", new String[]{"path/to/launcher-script.sh"});
Expand All @@ -185,7 +185,7 @@ You can specify multiple extensions for a server by separating them with a comma
If you want to bind your language server definition only with a specific set of files, you can use that
specific file pattern as a regex expression instead of binding with the file extension (e.g., "application*.properties").

#### Example Usage:
**Example Usage:**

```java
ProcessBuilder process = new ProcessBuilder("path/to/launcher-script.sh");
Expand All @@ -197,11 +197,10 @@ ProcessBuilder process = new ProcessBuilder("java", "-jar", "path/to/language-se
new ProcessBuilderServerDefinition("bsl,os", process);
```

#### Custom Initialization Parameters
#### Custom initialization parameters

If your language server requires custom initialization options, you can extend `ProcessBuilderServerDefinition` or `RawCommandServerDefinition` and override the `customizeInitializeParams` method to modify the initialization parameters.

##### Example:
```java
public class MyServerDefinition extends ProcessBuilderServerDefinition {
public MyServerDefinition(String ext, ProcessBuilder process) {
Expand All @@ -215,12 +214,12 @@ public class MyServerDefinition extends ProcessBuilderServerDefinition {
}
```

Finally, assign your class as a ServerDefinition:
Finally, assign your class as a ServerDefinition:

```java
ProcessBuilder process = new ProcessBuilder("path/to/launcher-script.sh");
IntellijLanguageClient.addServerDefinition(new MyServerDefinition("xxx", processBuilder));
```
```java
ProcessBuilder process = new ProcessBuilder("path/to/launcher-script.sh");
IntellijLanguageClient.addServerDefinition(new MyServerDefinition("xxx", processBuilder));
```

You can refer to [#311](https://github.com/ballerina-platform/lsp4intellij/pull/311) for more details.

Expand Down

0 comments on commit 0f14f01

Please sign in to comment.