lsp-javascript-typescript-enable 现在稳定了吗?
在我这里不工作,看 *Messages*
是启动之后超时退出了:
>>> my/lsp-javascript-typescript-enable
>>> nodenv-mode on
[nodenv] ~/repos/go/gui/gotron/.node-version => 6.0.0
File mode specification error: (lsp-timed-out-error)
~/repos/go/gui/gotron/ui/react/: lsp-javascript-typescript has exited (exited abnormally with code 1)
*Backtrace*
显示初始化无响应:
Debugger entered--Lisp error: (lsp-timed-out-error)
signal(lsp-timed-out-error nil)
lsp--send-wait("Content-Length: 590\15\n\15\n{\"jsonrpc\":\"2.0\",\"method\":
\"initialize\",\"params\":{\"processId\":14391,\"rootPath\":\"....
...
Debugger entered--Lisp error: (lsp-timed-out-error)
signal(lsp-timed-out-error nil)
lsp--send-wait("Content-Length: 590\15\n\15\n{\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"params\":{\"processId\":14391,\"rootPath\":\"/Volumes/HDD/Users/myth/repos/go/gui/gotron/ui/react/\",\"rootUri\":\"file:///Volumes/HDD/Users/myth/repos/go/gui/gotron/ui/react/\",\"capabilities\":{\"workspace\":{\"applyEdit\":true,\"executeCommand\":{\"dynamicRegistration\":true}},\"textDocument\":{\"synchronization\":{\"willSave\":true,\"didSave\":true,\"willSaveWaitUntil\":true},\"symbol\":{\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},\"completion\":{\"completionItem\":{\"snippetSupport\":true}}}},\"initializationOptions\":null},\"id\":1}" #<process lsp-javascript-typescript> #s(lsp--parser :waiting-for-response t :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received 0 :leftovers nil :queued-notifications nil :queued-requests nil :workspace #s(lsp--workspace :parser #3 :file-versions #<hash-table equal 0/65 0x4222310d> :server-capabilities nil :registered-server-capabilities nil :root "/Volumes/HDD/Users/myth/repos/go/gui/gotron/ui/react/" :client #s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x41e68cff>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x428867c1>) :stderr "*lsp-javascript-typescript stderr*" :get-root #f(compiled-function () #<bytecode 0x42c94e49>) :ignore-regexps nil :ignore-messages ("readFile .*? requested by TypeScript but content not available") :notification-handlers #<hash-table equal 0/65 0x428867cd> :request-handlers #<hash-table equal 0/65 0x42d84341> :response-handlers #<hash-table eql 0/65 0x42d84361> :string-renderers (("javascript" . lsp-javascript-typescript--render-string) ("typescript" . lsp-javascript-typescript--render-string)) :last-id 1 :enable-function lsp-javascript-typescript-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x426f6e31> :action-handlers #<hash-table equal 0/65 0x426f6e51> :default-renderer nil) :change-timer-disabled nil :proc #<process lsp-javascript-typescript> :cmd-proc #<process lsp-javascript-typescript> :buffers nil :highlight-overlays #<hash-table eq 0/65 0x426d8a79> :extra-client-capabilities ((company-lsp . company-lsp--client-capabilities)) :status nil :metadata #<hash-table equal 0/65 0x426d8a99> :watches #<hash-table equal 0/65 0x422cab79>)))
lsp--send-request((:jsonrpc "2.0" :method "initialize" :params (:processId 14391 :rootPath "/Volumes/HDD/Users/myth/repos/go/gui/gotron/ui/react/" :rootUri "file:///Volumes/HDD/Users/myth/repos/go/gui/gotron/ui/react/" :capabilities (:workspace (:applyEdit t :executeCommand (:dynamicRegistration t)) :textDocument (:synchronization (:willSave t :didSave t :willSaveWaitUntil t) :symbol (:symbolKind (:valueSet (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25))) :completion (:completionItem (:snippetSupport t)))) :initializationOptions nil) :id 1))
lsp--start(#s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x41e68cff>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x428867c1>) :stderr "*lsp-javascript-typescript stderr*" :get-root #f(compiled-function () #<bytecode 0x42c94e49>) :ignore-regexps nil :ignore-messages ("readFile .*? requested by TypeScript but content not available") :notification-handlers #<hash-table equal 0/65 0x428867cd> :request-handlers #<hash-table equal 0/65 0x42d84341> :response-handlers #<hash-table eql 0/65 0x42d84361> :string-renderers (("javascript" . lsp-javascript-typescript--render-string) ("typescript" . lsp-javascript-typescript--render-string)) :last-id 1 :enable-function lsp-javascript-typescript-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x426f6e31> :action-handlers #<hash-table equal 0/65 0x426f6e51> :default-renderer nil) nil)
lsp--enable-stdio-client(lsp-javascript-typescript :language-id "javascript" :language-id-fn nil :root-directory-fn #f(compiled-function () #<bytecode 0x42c94e49>) :command nil :command-fn lsp-javascript-typescript--ls-command :ignore-regexps nil :ignore-messages ("readFile .*? requested by TypeScript but content not available") :extra-init-params nil :initialize-fn lsp-javascript-typescript--initialize-client :enable-function lsp-javascript-typescript-enable :prefix-function nil)
#f(compiled-function () (interactive nil) #<bytecode 0x42c94f21>)()
apply(#f(compiled-function () (interactive nil) #<bytecode 0x42c94f21>) nil)
#f(advice-wrapper :before #f(compiled-function () (interactive nil) #<bytecode 0x42c94f21>) nodenv-mode)()
apply(#f(advice-wrapper :before #f(compiled-function () (interactive nil) #<bytecode 0x42c94f21>) nodenv-mode) nil)
lsp-javascript-typescript-enable()
my/lsp-javascript-typescript-enable()
run-hooks(change-major-mode-after-body-hook prog-mode-hook js-mode-hook)
apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook js-mode-hook))
run-mode-hooks(js-mode-hook)
javascript-mode()
set-auto-mode-0(javascript-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(#<buffer app.js> "~/repos/go/gui/gotron/ui/react/src/app.js" nil nil "/Volumes/HDD/Users/myth/repos/go/gui/gotron/ui/react/src/app.js" (85068241 16777218))
find-file-noselect("/Users/myth/repos/go/gui/gotron/ui/react/src/app.js" nil nil nil)
find-file("/Users/myth/repos/go/gui/gotron/ui/react/src/app.js")
mapc(find-file ("/Users/myth/repos/go/gui/gotron/ui/react/src/app.js"))
helm-find-many-files("/Users/myth/repos/go/gui/gotron/ui/react/src/app.js")
helm-execute-selection-action-1()
helm-execute-selection-action()
helm-internal((helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil "*helm mini*" nil nil nil)
apply(helm-internal ((helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil "*helm mini*" nil nil nil))
helm((helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil "*helm mini*" nil nil nil)
apply(helm ((helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil "*helm mini*" nil nil nil))
helm(:sources (helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) :buffer "*helm mini*" :ff-transformer-show-only-basename nil :truncate-lines t)
helm-mini()
funcall-interactively(helm-mini)
call-interactively(helm-mini nil nil)
command-execute(helm-mini)
有时候电脑卡壳,运行得比较慢,在 *Messages*
错误信息还没打印出来的时候,可以看到 ls 进程是有创建的:
⋊> pgrep -fl typescript
20433 node ~/.nodenv/versions/6.0.0/bin/javascript-typescript-stdio -t -l ~/lsp-javascript.log
我加了启动参数 -l /path/to/lsp-javascript.log
,但似乎日志文件还没来得及创建。
除此之外,我配置里其他 ls 都正常:go、python、php、java、c-c++,甚至 vue-language-server 都可以用了。