|
|
@@ -87,6 +87,50 @@ Let's look at some examples.
|
|
|
|
|
|
---
|
|
|
|
|
|
+### Environment variables
|
|
|
+
|
|
|
+Use the `env` property to set environment variables when starting the LSP server:
|
|
|
+
|
|
|
+```json title="opencode.json" {5-7}
|
|
|
+{
|
|
|
+ "$schema": "https://opencode.ai/config.json",
|
|
|
+ "lsp": {
|
|
|
+ "rust": {
|
|
|
+ "env": {
|
|
|
+ "RUST_LOG": "debug"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### Initialization options
|
|
|
+
|
|
|
+Use the `initialization` property to pass initialization options to the LSP server. These are server-specific settings sent during the LSP `initialize` request:
|
|
|
+
|
|
|
+```json title="opencode.json" {5-9}
|
|
|
+{
|
|
|
+ "$schema": "https://opencode.ai/config.json",
|
|
|
+ "lsp": {
|
|
|
+ "typescript": {
|
|
|
+ "initialization": {
|
|
|
+ "preferences": {
|
|
|
+ "importModuleSpecifierPreference": "relative"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+:::note
|
|
|
+Initialization options vary by LSP server. Check your LSP server's documentation for available options.
|
|
|
+:::
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
### Disabling LSP servers
|
|
|
|
|
|
To disable **all** LSP servers globally, set `lsp` to `false`:
|