Commit 9cb53b7
committed
fix: sync the restored file and enable Find Usages when the LSP starts late
At app start a session-restored file is opened before the language server
finishes starting, so the per-file setup it normally gets on a file switch never
ran - jump-to-definition did nothing and "Find Usages" stayed disabled until the
user switched files once.
- DocumentSync.openSupportedDocuments now also didOpens the active editor's
document (it may not yet be in getAllOpenDocuments() at server-start time), so
the file the user is looking at is synced immediately.
- FindReferencesManager refreshes the command's enabled state when a provider
registers (the state is otherwise only computed on file switch), so a
late-registering LSP references provider lights up "Find Usages" right away.1 parent ce840d8 commit 9cb53b7
2 files changed
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 39 | | |
43 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
195 | 205 | | |
196 | 206 | | |
197 | 207 | | |
| |||
0 commit comments