Description
Hello,
I compiled this json-rpc
branch and tried it with lsp-mode (commit cb2b565b4e9b38be1f4c284e7618160383ad665d), but I found that emacs would randomly block for a long time on completion. Specifically, sometimes when I type "xxx.", the dot "." would not appear and emacs would block for about 10 seconds, then after that the dot and the completion popup would show.
I'm using the typescript language server (ts-ls).
This is the stacktrace when I press "C-g" during the blocking period:
Debugger entered--Lisp error: (quit)
lsp-request("completionItem/resolve" #<hash-table equal 5/7 0x1576874ab2cd>)
lsp-completion--resolve(#<hash-table equal 6/7 0x1576869e3dd5>)
lsp-completion--exit-fn(#("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))) finished #f(compiled-function () #<bytecode -0x15d2b6bbba872045>))
apply(lsp-completion--exit-fn (#("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))) finished #f(compiled-function () #<bytecode -0x15d2b6bbba872045>)))
#f(compiled-function (&rest args-before) #<bytecode -0x8c5656343dcb1ae>)(#("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))) finished)
company--capf-post-completion(#("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))))
#f(compiled-function (command &optional arg &rest args) "`company-mode' backend using `completion-at-point-functions'." (interactive #f(compiled-function () #<bytecode 0x198000e483dd>)) #<bytecode 0x1350e8b5c4f7b6e3>)(post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))))
apply(#f(compiled-function (command &optional arg &rest args) "`company-mode' backend using `completion-at-point-functions'." (interactive #f(compiled-function () #<bytecode 0x198000e483dd>)) #<bytecode 0x1350e8b5c4f7b6e3>) (post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)))))
(let ((completion-styles '(basic partial-completion))) (apply capf-fn args))
company-capf@my/set-completion-styles(#f(compiled-function (command &optional arg &rest args) "`company-mode' backend using `completion-at-point-functions'." (interactive #f(compiled-function () #<bytecode 0x198000e483dd>)) #<bytecode 0x1350e8b5c4f7b6e3>) post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))))
apply(company-capf@my/set-completion-styles #f(compiled-function (command &optional arg &rest args) "`company-mode' backend using `completion-at-point-functions'." (interactive #f(compiled-function () #<bytecode 0x198000e483dd>)) #<bytecode 0x1350e8b5c4f7b6e3>) (post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)))))
company-capf(post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))))
apply(company-capf (post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)))))
company-call-backend-raw(post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))))
company--force-sync(company-call-backend-raw (post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)))) company-capf)
company-call-backend(post-completion #("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))))
company-cancel(#("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))))
company-finish(#("diffBase" 0 1 (face (completions-first-difference) lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5)) 1 8 (lsp-completion-item #<hash-table equal 6/7 0x1576869e3dd5> lsp-sort-text "11" lsp-completion-start-point 3280 lsp-completion-markers (3280 #<marker (moves after insertion) at 3288 in App.tsx>) lsp-completion-prefix "diff" match-data (0 5 0 1 1 2 2 3 3 4 4 5))))
company-complete-selection()
funcall-interactively(company-complete-selection)
command-execute(company-complete-selection)
Metadata
Metadata
Assignees
Labels
No labels
Activity
egstatsml commentedon Dec 19, 2023
I got a similar error as well. Am using this fork with it rebased on the 29.1 release commit.
Am using Corfu for completion. Here is the profiler report stopped right after the 10 second or so hang,
And my relevent configs
blahgeek commentedon Dec 19, 2023
@egstatsml Hi can you try the mentioned PR? emacs-lsp/lsp-mode#4262
egstatsml commentedon Dec 19, 2023
Yep I will give it a go, might need a day or two though (It shouldn't take long just busy for the next day at least).
If you don't hear from me in a couple days feel free to remind me.
egstatsml commentedon Feb 12, 2024
Sorry for the super late response, definitely took me more than couple days just because of life.
It looks like this fix is working for me, but I saw your emacs-lsp-booster package, and that seems like a better fix for now. Thanks for your work on this PR and the booster package as well, I and I'm sure many others greatly appreciate it :)