Closed chris-plato closed 6 months ago
While trying to gather more info guided by rafal
via discord, I have reproduced this same issue in a separate editor, as well as found that the issue is being caused by something strange in a specific project I'm working on đ¤
In any case, I will close this issue as it's clearly not a Sublime Text related problem.
Thank you for your time đ
Could you please copy paste the following?
Just to get more insights on this
TS Version: 3.9.10
tsconfig.json
LSP-typescript.sublime-settings
Thanks for following up!
âšī¸ Description
While vetting Sublime Text, I used the LSP-typescript code action
convert 'const' to 'let'
and it resulted in the following:Pre-action:
Post-action:
There have been other formatting oddities using this feature, however this is my most recent example of this issue.
đ Extra details
13.6.3 (22G436)
Stable Channel, Build 4169
Logs
``` [14:18:00.662] --> LSP-typescript workspace/executeCommand (64): {'command': '_typescript.applyWorkspaceEdit', 'arguments': [{'documentChanges': [{'textDocument': {'version': 26, 'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}, 'edits': [{'newText': 'let', 'range': {'start': {'character': 0, 'line': 27}, 'end': {'character': 5, 'line': 27}}}]}]}]} :: [14:18:00.664] <-- LSP-typescript workspace/applyEdit (1): {'edit': {'documentChanges': [{'textDocument': {'version': 26, 'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}, 'edits': [{'newText': 'let', 'range': {'start': {'character': 0, 'line': 27}, 'end': {'character': 5, 'line': 27}}}]}]}} :: [14:18:00.672] >>> LSP-typescript (1) (duration: 7ms): {'applied': True} :: [14:18:00.682] <<< LSP-typescript (64) (duration: 20ms): None :: [14:18:00.982] -> LSP-eslint textDocument/didChange: {'contentChanges': [{'rangeLength': 5, 'range': {'start': {'line': 27, 'character': 0}, 'end': {'line': 27, 'character': 5}}, 'text': 'let'}], 'textDocument': {'version': 27, 'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}} :: [14:18:00.983] -> LSP-typescript textDocument/didChange: {'contentChanges': [{'rangeLength': 5, 'range': {'start': {'line': 27, 'character': 0}, 'end': {'line': 27, 'character': 5}}, 'text': 'let'}], 'textDocument': {'version': 27, 'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}} :: [14:18:00.984] --> LSP-typescript textDocument/codeLens (65): {'textDocument': {'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}} :: [14:18:00.985] --> LSP-typescript textDocument/documentHighlight (66): {'textDocument': {'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}, 'position': {'line': 28, 'character': 12}} :: [14:18:00.995] <<< LSP-typescript (65) (duration: 10ms): [] :: [14:18:01.007] <<< LSP-typescript (66) (duration: 22ms): [{'range': {'start': {'line': 27, 'character': 11}, 'end': {'line': 27, 'character': 23}}, 'kind': 2}, {'range': {'start': {'line': 28, 'character': 0}, 'end': {'line': 28, 'character': 12}}, 'kind': 2}] :: [14:18:01.343] <- LSP-typescript textDocument/publishDiagnostics: {'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts', 'diagnostics': [{'range': {'start': {'line': 27, 'character': 5}, 'end': {'line': 27, 'character': 10}}, 'tags': [], 'severity': 1, 'source': 'typescript', 'code': 1005, 'message': "';' expected."}, {'range': {'start': {'line': 27, 'character': 0}, 'end': {'line': 27, 'character': 4}}, 'tags': [], 'severity': 1, 'source': 'typescript', 'code': 2304, 'message': "Cannot find name 'lett'."}, {'range': {'start': {'line': 28, 'character': 0}, 'end': {'line': 28, 'character': 12}}, 'tags': [], 'severity': 1, 'source': 'typescript', 'code': 2588, 'message': "Cannot assign to 'warningHours' because it is a constant."}]} :: [14:18:01.351] --> LSP-eslint textDocument/codeAction (24): {'context': {'triggerKind': 2, 'diagnostics': []}, 'range': {'start': {'line': 28, 'character': 0}, 'end': {'line': 28, 'character': 12}}, 'textDocument': {'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}} :: [14:18:01.352] --> LSP-typescript textDocument/codeAction (67): {'context': {'triggerKind': 2, 'diagnostics': [{'range': {'start': {'line': 28, 'character': 0}, 'end': {'line': 28, 'character': 12}}, 'tags': [], 'severity': 1, 'source': 'typescript', 'code': 2588, 'message': "Cannot assign to 'warningHours' because it is a constant."}]}, 'range': {'start': {'line': 28, 'character': 0}, 'end': {'line': 28, 'character': 12}}, 'textDocument': {'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}} :: [14:18:01.353] <<< LSP-eslint (24) (duration: 1ms): [] :: [14:18:01.356] <<< LSP-typescript (67) (duration: 4ms): [{'command': {'command': '_typescript.applyWorkspaceEdit', 'arguments': [{'documentChanges': [{'textDocument': {'version': 27, 'uri': 'file:///Users/chris/dev/plato/games/game-match3battle/lib/common/Config.ts'}, 'edits': [{'newText': 'let', 'range': {'start': {'line': 27, 'character': 5}, 'end': {'line': 27, 'character': 10}}}]}]}], 'title': "Convert 'const' to 'let'"}, 'kind': 'quickfix', 'title': "Convert 'const' to 'let'"}] ```