我用的doom-emacs,eglot-ltex对markup文档的语法检测体验还不错,我在mac端已经用上,不过在ubuntu出现timeout的错误,也没有明显的错误提示,不知道哪里没有配置对。我基本就是抄的eglot-ltex的实例配置。
(use-package eglot-ltex
:ensure t
:hook (latex-mode . (lambda ()
(require 'eglot-ltex)
(eglot-ensure)))
:init
(when IS-MAC
(setq eglot-languagetool-server-path (concat doom-user-dir "config/ltex-ls/mac/")))
(when IS-LINUX
(setq eglot-languagetool-server-path (concat doom-user-dir "config/ltex-ls/linux/"))))
不过在latex文档使用的时候提示timeout错误:
[jsonrpc] Server exited with status 9
Error running timer: (error "[eglot] Timed out after 10 seconds")
EGLOT--- events
中的内容如下,好像没有明显错误,有一些wanring。
[internal] Thu Apr 20 10:39:25 2023:
(:message "Running language server: /home/username/.doom.d/config/ltex-ls/linux/bin/ltex-ls")
[client-request] (id:1) Thu Apr 20 10:39:25 2023:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 41314 :clientInfo
(:name "Eglot")
:rootPath "/home/username/projects/latex/test/" :rootUri "file:///home/username/projects/latex/test" :initializationOptions #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
())
:capabilities
(:workspace
(:applyEdit t :executeCommand
(:dynamicRegistration :json-false)
:workspaceEdit
(:documentChanges t)
:didChangeWatchedFiles
(:dynamicRegistration t)
:symbol
(:dynamicRegistration :json-false)
:configuration t :workspaceFolders t)
:textDocument
(:synchronization
(:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t)
:completion
(:dynamicRegistration :json-false :completionItem
(:snippetSupport t :deprecatedSupport t :resolveSupport
(:properties
["documentation" "details" "additionalTextEdits"])
:tagSupport
(:valueSet
[1]))
:contextSupport t)
:hover
(:dynamicRegistration :json-false :contentFormat
["markdown" "plaintext"])
:signatureHelp
(:dynamicRegistration :json-false :signatureInformation
(:parameterInformation
(:labelOffsetSupport t)
:documentationFormat
["markdown" "plaintext"]
:activeParameterSupport t))
:references
(:dynamicRegistration :json-false)
:definition
(:dynamicRegistration :json-false :linkSupport t)
:declaration
(:dynamicRegistration :json-false :linkSupport t)
:implementation
(:dynamicRegistration :json-false :linkSupport t)
:typeDefinition
(:dynamicRegistration :json-false :linkSupport t)
:documentSymbol
(:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :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 26]))
:documentHighlight
(:dynamicRegistration :json-false)
:codeAction
(:dynamicRegistration :json-false :codeActionLiteralSupport
(:codeActionKind
(:valueSet
["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"]))
:isPreferredSupport t)
:formatting
(:dynamicRegistration :json-false)
:rangeFormatting
(:dynamicRegistration :json-false)
:rename
(:dynamicRegistration :json-false)
:inlayHint
(:dynamicRegistration :json-false)
:publishDiagnostics
(:relatedInformation :json-false :codeDescriptionSupport :json-false :tagSupport
(:valueSet
[1 2])))
:window
(:workDoneProgress t)
:general
(:positionEncodings
["utf-32" "utf-8" "utf-16"])
:experimental #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
()))
:workspaceFolders
[(:uri "file:///home/username/projects/latex/test" :name "~/projects/latex/test/")]))
[stderr] Apr 20, 2023 10:39:26 AM org.languagetool.language.identifier.SimpleLanguageIdentifier <init>
[stderr] WARNING: Could not find default speller rule for fa
[stderr] Apr 20, 2023 10:39:26 AM org.languagetool.language.identifier.SimpleLanguageIdentifier <init>
[stderr] WARNING: Could not find default speller rule for zh
[stderr] Apr 20, 2023 10:39:27 AM org.languagetool.language.identifier.SimpleLanguageIdentifier <init>
[stderr] WARNING: Could not find default speller rule for ja
[stderr] Apr 20, 2023 10:39:27 AM org.languagetool.language.identifier.SimpleLanguageIdentifier <init>
[stderr] WARNING: Could not find default speller rule for ta
[stderr] Apr 20, 2023 10:39:27 AM org.languagetool.language.identifier.SimpleLanguageIdentifier <init>
[stderr] WARNING: Could not find default speller rule for fa
[stderr] Apr 20, 2023 10:39:27 AM org.languagetool.language.identifier.SimpleLanguageIdentifier <init>
[stderr] WARNING: Could not find default speller rule for zh
[stderr] Apr 20, 2023 10:39:27 AM org.languagetool.language.identifier.SimpleLanguageIdentifier <init>
[stderr] WARNING: Could not find default speller rule for ja
[stderr] Apr 20, 2023 10:39:27 AM org.languagetool.language.identifier.SimpleLanguageIdentifier <init>
[stderr] WARNING: Could not find default speller rule for ta
[stderr] Apr 20, 2023 10:39:27 AM org.bsplines.ltexls.server.LtexLanguageServer initialize
[stderr] INFO: ltex-ls 16.0.0 - initializing...
[internal] Thu Apr 20 10:39:35 2023:
(:message "Connection state changed" :change "killed\n")
----------b---y---e---b---y---e----------
[stderr]
[stderr]
[stderr] nil
[stderr] nil
[stderr] Process EGLOT (test/(text-mode latex-mode org-mode markdown-mode)) stderr finished