You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When formatting a 46KB minified .js file using textDocument/formatting request it takes about 5–6 seconds for deno lsp to respond. For my particular test file the language server responds with Content-Length: 546612 worth of TextEdit[] (that is about 11 times more than just sending the full file contents). For comparison formatting the same file takes only around 100ms using deno fmt.
Fix?
I think this could be fixed with some heuristics in the function that calculates text edits:
When formatting a 46KB minified .js file using
textDocument/formatting
request it takes about 5–6 seconds fordeno lsp
to respond. For my particular test file the language server responds withContent-Length: 546612
worth ofTextEdit[]
(that is about 11 times more than just sending the full file contents). For comparison formatting the same file takes only around 100ms usingdeno fmt
.Fix?
I think this could be fixed with some heuristics in the function that calculates text edits:
deno/cli/lsp/text.rs
Lines 209 to 258 in 8d24be1
A simple one would be to skip calculating the diff and treating the whole file as one big text edit if the lengths of
a
andb
differ significantly.Version information:
deno 1.37.0 (release, x86_64-unknown-linux-gnu)
v8 11.8.172.3
typescript 5.2.2
The text was updated successfully, but these errors were encountered: