fsharp / emacs-fsharp-mode

F# Emacs mode
Apache License 2.0
206 stars 62 forks source link

Eglot Times Out with Emacs 28 #283

Closed amcguier closed 2 years ago

amcguier commented 2 years ago

Description

Trying to run eglot against any F# project with the above configuration results in a connection timeout.

Repro steps

Install the packages Open an F# buffer, try running eglot

Expected behavior

eglot is able to connect to the FsAutoComplete Server via jrpc

Actual behavior

[eglot] Waiting in background for server `EGLOT (temp/fsharp-mode)' [jsonrpc] Server exited with status 9 Error running timer: (error "[eglot] Timed out")

Related information

I have tested this with both 0.49.4 and 0.48.2 versions of FsAutoComplete so it doesn't appear to be related to Issue-282

I also confirmed the same behavior if run using fsautcomplete as a local tool, rather than running the dll directly (although I may PR in that work since it's the preferred way to run fsautocomplete these days)

I didn't get too far debugging eglot, but I did confirm that bumping up the timeout window doesn't stop the behavior. I also confirmed the behavior still happens if I run emacs -Q and remove the remainder of my configuration.

eglyph commented 2 years ago

Same, Emacs 29.0.50, latest eglot and eglot-fsharp from melpa. Increasing timeout even to some ridiculous numbers like 20 mins does nothing. Here's the log

[internal] Tue Mar 29 13:44:11 2022:
(:message "Running language server: dotnet ~/.emacs.d/FsAutoComplete/netcore/fsautocomplete.dll --background-service-enabled")
[client-request] (id:1) Tue Mar 29 13:44:11 2022:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
      (:processId 975 :rootPath "<edited>" :rootUri "file://<edited>" :initializationOptions
              (:automaticWorkspaceInit t)
              :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 :json-false :deprecatedSupport t :tagSupport
                                   (:valueSet
                                [1]))
                          :contextSupport t)
            :hover
            (:dynamicRegistration :json-false :contentFormat
                          ["markdown" "plaintext"])
            :signatureHelp
            (:dynamicRegistration :json-false :signatureInformation
                          (:parameterInformation
                           (:labelOffsetSupport t)
                           :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)
            :publishDiagnostics
            (:relatedInformation :json-false :codeDescriptionSupport :json-false :tagSupport
                         (:valueSet
                          [1 2])))
               :experimental #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                           ()))
              :workspaceFolders
              [(:uri "file://<edited>" :name "~/<edited>")]))
[internal] Tue Mar 29 13:47:11 2022:
(:message "Connection state changed" :change "killed: 9\n")

----------b---y---e---b---y---e----------
[stderr] 
[stderr] 
[stderr] nil
[stderr] nil
[stderr] Process EGLOT (<edited>/fsharp-mode) stderr finished
amcguier commented 2 years ago

I think this is the root cause for both of these bugs:

https://github.com/fsharp/emacs-fsharp-mode/pull/288#issuecomment-1047203730

I just haven't had the time to implement the proposed fix.

juergenhoetzel commented 2 years ago

Should be fixed by #292