Commit 4403100
gopls/internal/golang: customize semantic token types and modifiers
We agreed to return full set of token types and modifiers from gopls
by default (full means token types and modifiers that gopls understand)
and provide configuraton options for users to disable some of them.
- Two fields of type map[string]bool are introduced to gopls UIOptions
(workspace/configuration) to customize semantic token types and
modifiers. For now, only value of "false" is effective. Choose type of
map over array to keep future compatibility in case we want to introduce
enable capabilities.
- VSCode-Go populate these options from user settings to gopls.
- Gopls "initialize" protocol returns a pre-defined fixed legend
including subset of standard legend defined LSP that gopls understand
with additional customize modifiers gopls recoganized.
- Gopls "textDocument/semanticTokens" protocol returns token types and
modifiers based on configuration defined in workspace/configuration.
Tested with vscode-go changes CL 642416, screenshot is at
golang/vscode-go#3632 (comment)
For golang/vscode-go#3632
Change-Id: Ie8220e12a4c8d6c84c54992d84277767e61ec023
Reviewed-on: https://go-review.googlesource.com/c/tools/+/642077
Auto-Submit: Hongxiang Jiang <hxjiang@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>1 parent c9ef861 commit 4403100
File tree
13 files changed
+313
-171
lines changed- gopls
- doc
- internal
- cmd
- doc
- golang
- protocol
- semtok
- server
- settings
- template
- test/marker/testdata/token
- util/moreslices
13 files changed
+313
-171
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
222 | 244 | | |
223 | 245 | | |
224 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
302 | | - | |
| 304 | + | |
303 | 305 | | |
304 | 306 | | |
305 | 307 | | |
| |||
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
325 | | - | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
| |||
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
365 | | - | |
366 | | - | |
| 366 | + | |
| 367 | + | |
367 | 368 | | |
368 | 369 | | |
369 | 370 | | |
| |||
376 | 377 | | |
377 | 378 | | |
378 | 379 | | |
379 | | - | |
| 380 | + | |
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
| |||
388 | 389 | | |
389 | 390 | | |
390 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
391 | 395 | | |
392 | 396 | | |
393 | 397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | | - | |
107 | | - | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
139 | | - | |
140 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| |||
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
153 | | - | |
| 158 | + | |
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
158 | | - | |
159 | | - | |
| 163 | + | |
| 164 | + | |
160 | 165 | | |
161 | | - | |
162 | | - | |
163 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | 170 | | |
166 | | - | |
| 171 | + | |
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
170 | 175 | | |
171 | | - | |
| 176 | + | |
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
178 | 183 | | |
179 | | - | |
| 184 | + | |
180 | 185 | | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
186 | 202 | | |
187 | 203 | | |
188 | 204 | | |
189 | 205 | | |
190 | | - | |
191 | | - | |
| 206 | + | |
| 207 | + | |
192 | 208 | | |
193 | 209 | | |
194 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
850 | | - | |
| 850 | + | |
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
860 | 886 | | |
861 | 887 | | |
862 | 888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 85 | + | |
| 86 | + | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| |||
242 | 240 | | |
243 | 241 | | |
244 | 242 | | |
245 | | - | |
| 243 | + | |
246 | 244 | | |
247 | 245 | | |
248 | 246 | | |
| |||
463 | 461 | | |
464 | 462 | | |
465 | 463 | | |
466 | | - | |
| 464 | + | |
467 | 465 | | |
468 | 466 | | |
469 | 467 | | |
| |||
559 | 557 | | |
560 | 558 | | |
561 | 559 | | |
562 | | - | |
| 560 | + | |
563 | 561 | | |
564 | 562 | | |
565 | 563 | | |
| |||
623 | 621 | | |
624 | 622 | | |
625 | 623 | | |
626 | | - | |
| 624 | + | |
627 | 625 | | |
628 | 626 | | |
629 | 627 | | |
| |||
746 | 744 | | |
747 | 745 | | |
748 | 746 | | |
749 | | - | |
| 747 | + | |
750 | 748 | | |
751 | 749 | | |
752 | 750 | | |
| |||
This file was deleted.
0 commit comments