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
You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain
Bug description
I have come across a persisting performance degradation when utilizing LSP on a Typescript codebase.
Emacs freezes for several seconds when typing on any Typescript file no matter what configuration, with or without emacs-lsp-booster activated.
I first parsed this as an issue with orderless package, raised here oantolin/orderless#186, but maintainer pointed out that is most likely an LSP problem, as lsp-completion-passthrough-all-completions is the function with the largest footprint on the profiler report.
Steps to reproduce
Setup LSP (lsp-typescript) with configuration provided to work on a relatively large TS project.
Move around the code given a .ts file, and start working on the file.
See Emacs freezing for 2+ seconds every few keystrokes.
Expected behavior
Emacs is responsive while working with lsp-typescript on TS/JS files.
Which Language Server did you use?
lsp-typescript is the LSP server. I use typescript-language-server the output of ts-ls utilizing emacs-lsp-booster below:
[2025-03-05T10:47:18Z INFO emacs_lsp_booster::app] About to run the lsp server with command "typescript-language-server" "--stdio"
[2025-03-05T10:47:18Z INFO emacs_lsp_booster::app] Will convert server json to bytecode! bytecode options: BytecodeOptions { object_type: Plist, null_value: Nil, false_value: Nil }
OS
Linux
Error callstack
lsp-log shows a lot of textDocument/hover logs while moving around the TS file:
The following clients were selected based on priority: (server-id ts-ls, priority -2)
Cancelling textDocument/hover(556) in hook after-change-functions
Cancelling textDocument/hover(557) in hook after-change-functions
Cancelling textDocument/hover(562) in hook after-change-functions
Cancelling textDocument/hover(564) in hook after-change-functions
Cancelling textDocument/hover(568) in hook after-change-functions
Cancelling textDocument/hover(578) in hook after-change-functions
Cancelling textDocument/codeAction(574) in hook after-change-functions
Cancelling textDocument/hover(579) in hook after-change-functions
Cancelling textDocument/hover(580) in hook after-change-functions
Cancelling textDocument/documentHighlight(584) in hook after-change-functions
Cancelling textDocument/codeAction(583) in hook after-change-functions
Cancelling textDocument/hover(581) in hook after-change-functions
Cancelling textDocument/hover(585) in hook after-change-functions
Cancelling textDocument/hover(587) in hook after-change-functions
Cancelling textDocument/hover(591) in hook after-change-functions
Cancelling textDocument/hover(598) in hook after-change-functions
Cancelling textDocument/hover(599) in hook after-change-functions
Cancelling textDocument/hover(600) in hook after-change-functions
Cancelling textDocument/hover(601) in hook after-change-functions
Cancelling textDocument/hover(602) in hook after-change-functions
Cancelling textDocument/hover(604) in hook after-change-functions
Cancelling textDocument/hover(613) in hook after-change-functions
Cancelling textDocument/hover(614) in hook after-change-functions
Cancelling textDocument/hover(615) in hook after-change-functions
Cancelling textDocument/hover(616) in hook after-change-functions
Cancelling textDocument/hover(617) in hook after-change-functions
Cancelling textDocument/hover(619) in hook after-change-functions
Cancelling textDocument/codeAction(635) in hook after-change-functions
Cancelling textDocument/hover(634) in hook after-change-functions
Cancelling textDocument/documentHighlight(632) in hook after-change-functions
Cancelling textDocument/hover(637) in hook after-change-functions
Cancelling textDocument/codeAction(645) in hook after-change-functions
Cancelling textDocument/hover(643) in hook after-change-functions
Cancelling textDocument/codeAction(649) in hook after-change-functions
Cancelling textDocument/hover(647) in hook after-change-functions
Cancelling textDocument/documentHighlight(659) in hook after-change-functions
Cancelling textDocument/codeAction(658) in hook after-change-functions
Cancelling textDocument/hover(656) in hook after-change-functions
Cancelling textDocument/codeAction(670) in hook after-change-functions
Cancelling textDocument/hover(669) in hook after-change-functions
Cancelling textDocument/hover(675) in hook after-change-functions
Cancelling textDocument/hover(676) in hook after-change-functions
Cancelling textDocument/hover(679) in hook after-change-functions
Cancelling textDocument/hover(684) in hook after-change-functions
Cancelling textDocument/hover(685) in hook after-change-functions
Cancelling textDocument/hover(686) in hook after-change-functions
Cancelling textDocument/hover(690) in hook after-change-functions
Cancelling textDocument/hover(691) in hook after-change-functions
Cancelling textDocument/hover(692) in hook after-change-functions
Cancelling textDocument/hover(696) in hook after-change-functions
Cancelling textDocument/hover(701) in hook after-change-functions
Cancelling textDocument/hover(702) in hook after-change-functions
Cancelling textDocument/hover(703) in hook after-change-functions
Cancelling textDocument/hover(704) in hook after-change-functions
Cancelling textDocument/hover(705) in hook after-change-functions
Cancelling textDocument/hover(710) in hook after-change-functions
Cancelling textDocument/hover(711) in hook after-change-functions
Cancelling textDocument/hover(712) in hook after-change-functions
Cancelling textDocument/hover(714) in hook after-change-functions
Cancelling textDocument/hover(717) in hook after-change-functions
Cancelling textDocument/hover(722) in hook after-change-functions
Cancelling textDocument/hover(735) in hook after-change-functions
Cancelling textDocument/hover(737) in hook after-change-functions
Cancelling textDocument/hover(740) in hook after-change-functions
Cancelling textDocument/documentHighlight(744) in hook after-change-functions
Cancelling textDocument/codeAction(743) in hook after-change-functions
Cancelling textDocument/hover(741) in hook after-change-functions
Cancelling textDocument/hover(745) in hook after-change-functions
Cancelling textDocument/hover(746) in hook after-change-functions
Cancelling textDocument/hover(748) in hook after-change-functions
Cancelling textDocument/documentHighlight(758) in hook after-change-functions
Cancelling textDocument/codeAction(757) in hook after-change-functions
Cancelling textDocument/hover(755) in hook after-change-functions
Cancelling textDocument/codeAction(762) in hook after-change-functions
Cancelling textDocument/hover(759) in hook after-change-functions
Cancelling textDocument/hover(771) in hook after-change-functions
Cancelling textDocument/codeAction(777) in hook after-change-functions
Cancelling textDocument/hover(775) in hook after-change-functions
Cancelling textDocument/hover(784) in hook after-change-functions
Cancelling textDocument/hover(791) in hook after-change-functions
Cancelling textDocument/hover(797) in hook after-change-functions
Cancelling textDocument/codeAction(804) in hook after-change-functions
Cancelling textDocument/codeAction(883) in hook post-command-hook
Cancelling textDocument/codeAction(887) in hook post-command-hook
Cancelling textDocument/documentHighlight(956) in hook after-change-functions
Cancelling textDocument/codeAction(955) in hook after-change-functions
Cancelling textDocument/hover(962) in hook after-change-functions
Cancelling textDocument/hover(987) in hook after-change-functions
Cancelling textDocument/hover(990) in hook after-change-functions
Cancelling textDocument/hover(993) in hook after-change-functions
Cancelling textDocument/hover(994) in hook after-change-functions
Cancelling textDocument/hover(997) in hook after-change-functions
Cancelling textDocument/hover(1011) in hook after-change-functions
Cancelling textDocument/codeAction(1016) in hook after-change-functions
Cancelling textDocument/hover(1017) in hook after-change-functions
Cancelling textDocument/hover(1021) in hook after-change-functions
Cancelling textDocument/hover(1033) in hook after-change-functions
Cancelling textDocument/hover(1035) in hook after-change-functions
Cancelling textDocument/hover(1039) in hook after-change-functions
Cancelling textDocument/hover(1043) in hook after-change-functions
Cancelling textDocument/hover(1046) in hook after-change-functions
Cancelling textDocument/hover(1047) in hook after-change-functions
Cancelling textDocument/codeAction(1053) in hook after-change-functions
Cancelling textDocument/hover(1049) in hook after-change-functions
Cancelling textDocument/hover(1055) in hook after-change-functions
Cancelling textDocument/hover(1060) in hook after-change-functions
Cancelling textDocument/hover(1063) in hook after-change-functions
Cancelling textDocument/hover(1065) in hook after-change-functions
Cancelling textDocument/hover(1068) in hook after-change-functions
Cancelling textDocument/hover(1070) in hook after-change-functions
Cancelling textDocument/hover(1074) in hook after-change-functions
Cancelling textDocument/hover(1080) in hook after-change-functions
Cancelling textDocument/hover(1081) in hook after-change-functions
Cancelling textDocument/hover(1085) in hook after-change-functions
Cancelling textDocument/hover(1087) in hook after-change-functions
Emacs version: GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.48, cairo version 1.18.2) of 2025-03-01 compiled --with-native-compilation --with-json --with-pgtk from 6a2f6056c5a079a7f3db240171680560a3bd9710
magandrez
changed the title
Emacs freezes when working with lsp-typescript + emacs-lsp-booster on a TS codebase
Emacs freezes when working with lsp-typescript
Mar 8, 2025
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
I have come across a persisting performance degradation when utilizing LSP on a Typescript codebase.
Emacs freezes for several seconds when typing on any Typescript file no matter what configuration, with or without emacs-lsp-booster activated.
I first parsed this as an issue with orderless package, raised here oantolin/orderless#186, but maintainer pointed out that is most likely an LSP problem, as
lsp-completion-passthrough-all-completions
is the function with the largest footprint on the profiler report.Steps to reproduce
Expected behavior
Emacs is responsive while working with lsp-typescript on TS/JS files.
Which Language Server did you use?
lsp-typescript
is the LSP server. I usetypescript-language-server
the output ofts-ls
utilizingemacs-lsp-booster
below:OS
Linux
Error callstack
lsp-log shows a lot of
textDocument/hover
logs while moving around the TS file:Profiler report below:
Anything else?
Emacs version:
GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.48, cairo version 1.18.2) of 2025-03-01
compiled--with-native-compilation --with-json --with-pgtk
from6a2f6056c5a079a7f3db240171680560a3bd9710
I have followed all the performance recommendations.
Possibly related #4538 #4698
The text was updated successfully, but these errors were encountered: