Commit c4e1914
authored
fix(lsp): centralize LspOrganize command and add safety checks
Moves the `LspOrganize` command from a buffer-local definition within
the `tsserver` on_attach function to a single, global user command.
This refactoring prevents command duplication and potential errors.
The new global command is now guarded by a check to ensure a `tsserver`
client is attached to the current buffer before executing, making it
safe to call from any context. The redundant local command definition
has been removed.1 parent 590e7f5 commit c4e1914
1 file changed
+20
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
228 | 245 | | |
229 | | - | |
230 | | - | |
| 246 | + | |
| 247 | + | |
231 | 248 | | |
232 | 249 | | |
233 | 250 | | |
234 | | - | |
| 251 | + | |
235 | 252 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | 253 | | |
244 | 254 | | |
245 | 255 | | |
| |||
0 commit comments