Commit db05a15
committed
refactor(language_server): do not request for worspace configuration when the client does not support it (#10507)
Currently working on supporting multiple workspace folder. `workspace/didChangeConfiguratoin` does not specific the Workspace, so some clients expect to request them.
We need to check if the client support this or fallback to a global configuration change (changing all workspaces).
ChatGPT:
> what if workspace/configuration is not supported by the clinet
ChatGPT:
Ah, good follow-up — if the client does not support workspace/configuration, things get more limited and require some careful handling.
🔧 First: Check If the Client Supports It
When your language server receives the initialize request from the client, it includes its capabilities. Look for:
```
"capabilities": {
"workspace": {
"configuration": true
}
}
```
> If that configuration field is false or missing, then you cannot use workspace/configuration, and the client will only send global settings via workspace/didChangeConfiguration.1 parent 9f9e0e5 commit db05a15
2 files changed
+36
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
105 | 118 | | |
106 | 119 | | |
107 | 120 | | |
108 | 121 | | |
109 | 122 | | |
110 | 123 | | |
111 | | - | |
| 124 | + | |
112 | 125 | | |
113 | 126 | | |
114 | 127 | | |
115 | 128 | | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
119 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
120 | 137 | | |
121 | 138 | | |
122 | 139 | | |
| |||
133 | 150 | | |
134 | 151 | | |
135 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
136 | 157 | | |
137 | 158 | | |
138 | 159 | | |
| |||
565 | 586 | | |
566 | 587 | | |
567 | 588 | | |
| 589 | + | |
568 | 590 | | |
569 | 591 | | |
570 | 592 | | |
| |||
0 commit comments