joaotavora / eglot

A client for Language Server Protocol servers
GNU General Public License v3.0
2.22k stars 203 forks source link

`eglot--hover-info` error with Ruby files and Solargraph #1019

Closed darth-cheney closed 1 year ago

darth-cheney commented 1 year ago

LSP transcript - M-x eglot-events-buffer (mandatory unless Emacs inoperable)

[client-request] (id:1) Fri Aug 26 11:18:20 2022:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
          (:processId nil :rootPath "/Users/ecgade/Projects/idp-8-23-22/identity-idp/" :rootUri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp" :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 :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 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                   ()))
                      :workspaceFolders
                      [(:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp" :name "~/Projects/idp-8-23-22/identity-idp/")]))
[server-reply] (id:1) Fri Aug 26 11:18:21 2022:
(:jsonrpc "2.0" :id 1 :result
          (:capabilities
           (:textDocumentSync 2 :workspace
                              (:workspaceFolders
                               (:supported t :changeNotifications t))
                              :completionProvider
                              (:resolveProvider t :triggerCharacters
                                                ["." ":" "@"])
                              :signatureHelpProvider
                              (:triggerCharacters
                               ["(" ","])
                              :hoverProvider t :documentSymbolProvider t :definitionProvider t :renameProvider
                              (:prepareProvider t)
                              :referencesProvider t :workspaceSymbolProvider t :foldingRangeProvider t :documentHighlightProvider t)))
[client-notification] Fri Aug 26 11:18:21 2022:
(:jsonrpc "2.0" :method "initialized" :params #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                            ()))
[client-notification] Fri Aug 26 11:18:21 2022:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb" :version 0 :languageId "enh-ruby" :text "require 'rails_helper'\n\nfeature 'reset password with pending profile' do\n  include PersonalKeyHelper\n\n  let(:user) { create(:user, :signed_up) }\n\n  scenario 'password reset email includes warning for pending profile' do\n    profile = create(\n      :profile,\n      deactivation_reason: :gpo_verification_pending,\n      pii: { ssn: '666-66-1234', dob: '1920-01-01', phone: '+1 703-555-9999' },\n      user: user,\n    )\n    create(:gpo_confirmation_code, profile: profile)\n\n    trigger_reset_password_and_click_email_link(user.email)\n\n    html_body = ActionMailer::Base.deliveries.last.html_part.body.decoded\n    expect(html_body).to include(\n      t('user_mailer.reset_password_instructions.gpo_letter_description'),\n    )\n  end\n\n  scenario 'password reset email does not include warning without pending profile' do\n    trigger_reset_password_and_click_email_link(user.email)\n\n    html_body = ActionMailer::Base.deliveries.last.html_part.body.decoded\n    expect(html_body).to_not include(\n      t('user_mailer.reset_password_instructions.gpo_letter_description'),\n    )\n  end\nend\n")))
[client-notification] Fri Aug 26 11:18:21 2022:
(:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params
          (:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                   ())))
[client-request] (id:2) Fri Aug 26 11:18:28 2022:
(:jsonrpc "2.0" :id 2 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[client-request] (id:3) Fri Aug 26 11:18:28 2022:
(:jsonrpc "2.0" :id 3 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[client-request] (id:4) Fri Aug 26 11:18:28 2022:
(:jsonrpc "2.0" :id 4 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[server-reply] (id:2) Fri Aug 26 11:18:29 2022:
(:jsonrpc "2.0" :id 2 :result
          (:signatures
           []))
[server-reply] (id:3) Fri Aug 26 11:18:29 2022:
(:jsonrpc "2.0" :id 3 :result
          (:contents
           (:kind "markdown" :value nil)))
[server-reply] (id:4) Fri Aug 26 11:18:29 2022:
(:jsonrpc "2.0" :id 4 :result
          [(:range
            (:start
             (:line 18 :character 4)
             :end
             (:line 18 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 18 :character 4)
             :end
             (:line 18 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 19 :character 11)
             :end
             (:line 19 :character 20))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 4)
             :end
             (:line 27 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 4)
             :end
             (:line 27 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 28 :character 11)
             :end
             (:line 28 :character 20))
            :kind 1)])
[client-request] (id:5) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 5 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 10)))
[client-request] (id:6) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 6 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 10)))
[client-request] (id:7) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 7 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 10)))
[server-reply] (id:5) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 5 :result
          (:signatures
           []))
[server-reply] (id:6) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 6 :result
          (:contents
           (:kind "markdown" :value nil)))
[client-request] (id:8) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 8 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[client-request] (id:9) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 9 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[client-request] (id:10) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 10 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[server-reply] (id:7) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 7 :result
          [])
[server-reply] (id:8) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 8 :result
          (:signatures
           []))
[server-reply] (id:9) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 9 :result
          (:contents
           (:kind "markdown" :value nil)))
[server-reply] (id:10) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 10 :result
          [(:range
            (:start
             (:line 18 :character 4)
             :end
             (:line 18 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 18 :character 4)
             :end
             (:line 18 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 19 :character 11)
             :end
             (:line 19 :character 20))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 4)
             :end
             (:line 27 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 4)
             :end
             (:line 27 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 28 :character 11)
             :end
             (:line 28 :character 20))
            :kind 1)])
[client-request] (id:11) Fri Aug 26 11:19:19 2022:
(:jsonrpc "2.0" :id 11 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 10)))
[client-request] (id:12) Fri Aug 26 11:19:19 2022:
(:jsonrpc "2.0" :id 12 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 10)))
[client-request] (id:13) Fri Aug 26 11:19:19 2022:
(:jsonrpc "2.0" :id 13 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 10)))
[server-reply] (id:11) Fri Aug 26 11:19:19 2022:
(:jsonrpc "2.0" :id 11 :result
          (:signatures
           []))
[server-reply] (id:12) Fri Aug 26 11:19:19 2022:
(:jsonrpc "2.0" :id 12 :result
          (:contents
           (:kind "markdown" :value nil)))
[internal] (id:13) Fri Aug 26 11:19:29 2022:
(:timed-out :textDocument/documentHighlight :id 13 :params
            (:textDocument
             (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
             :position
             (:line 28 :character 10)))
[client-request] (id:14) Fri Aug 26 11:19:43 2022:
(:jsonrpc "2.0" :id 14 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[client-request] (id:15) Fri Aug 26 11:19:43 2022:
(:jsonrpc "2.0" :id 15 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[client-request] (id:16) Fri Aug 26 11:19:43 2022:
(:jsonrpc "2.0" :id 16 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 10)))
[server-reply] (id:13) Fri Aug 26 11:19:43 2022:
(:jsonrpc "2.0" :id 13 :result
          [])
[server-reply] (id:14) Fri Aug 26 11:19:43 2022:
(:jsonrpc "2.0" :id 14 :result
          (:signatures
           []))
[server-reply] (id:15) Fri Aug 26 11:19:43 2022:
(:jsonrpc "2.0" :id 15 :result
          (:contents
           (:kind "markdown" :value nil)))
[server-reply] (id:16) Fri Aug 26 11:19:43 2022:
(:jsonrpc "2.0" :id 16 :result
          [(:range
            (:start
             (:line 18 :character 4)
             :end
             (:line 18 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 18 :character 4)
             :end
             (:line 18 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 19 :character 11)
             :end
             (:line 19 :character 20))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 4)
             :end
             (:line 27 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 4)
             :end
             (:line 27 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 28 :character 11)
             :end
             (:line 28 :character 20))
            :kind 1)])
[client-request] (id:17) Fri Aug 26 11:19:59 2022:
(:jsonrpc "2.0" :id 17 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 32 :character 3)))
[client-request] (id:18) Fri Aug 26 11:19:59 2022:
(:jsonrpc "2.0" :id 18 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 32 :character 3)))
[client-request] (id:19) Fri Aug 26 11:19:59 2022:
(:jsonrpc "2.0" :id 19 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 32 :character 3)))
[server-reply] (id:17) Fri Aug 26 11:19:59 2022:
(:jsonrpc "2.0" :id 17 :result
          (:signatures
           []))
[server-reply] (id:18) Fri Aug 26 11:19:59 2022:
(:jsonrpc "2.0" :id 18 :result
          (:contents
           (:kind "markdown" :value nil)))
[client-request] (id:20) Fri Aug 26 11:20:02 2022:
(:jsonrpc "2.0" :id 20 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 19)))
[client-request] (id:21) Fri Aug 26 11:20:02 2022:
(:jsonrpc "2.0" :id 21 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 19)))
[client-request] (id:22) Fri Aug 26 11:20:02 2022:
(:jsonrpc "2.0" :id 22 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 19)))
[server-reply] (id:19) Fri Aug 26 11:20:02 2022:
(:jsonrpc "2.0" :id 19 :result
          [])
[server-reply] (id:20) Fri Aug 26 11:20:02 2022:
(:jsonrpc "2.0" :id 20 :result
          (:signatures
           []))
[server-reply] (id:21) Fri Aug 26 11:20:02 2022:
(:jsonrpc "2.0" :id 21 :result
          (:contents
           (:kind "markdown" :value "ActionMailer\n\nMonkeypatches the MessageDelivery to add deliver\\_now\\_or\\_later that  \ncan route between #deliver\\_now and #deliver\\_later\n\nBy default, when emails are delivered via ActiveJob, the recipients’ email  \nis logged in a line like “Sent mail to test@test.com”. Rails does not provide  \nan easy way to filter out emails from the logs. To protect user privacy, we  \nwant to remove user emails from the logs, and the only way to do it is to  \noverride the `deliver` method below such that it doesn’t log anything.")))
[server-reply] (id:22) Fri Aug 26 11:20:02 2022:
(:jsonrpc "2.0" :id 22 :result
          [(:range
            (:start
             (:line 18 :character 16)
             :end
             (:line 18 :character 28))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 16)
             :end
             (:line 27 :character 28))
            :kind 1)])
[client-request] (id:23) Fri Aug 26 11:20:11 2022:
(:jsonrpc "2.0" :id 23 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 31)))
[client-request] (id:24) Fri Aug 26 11:20:11 2022:
(:jsonrpc "2.0" :id 24 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 31)))
[client-request] (id:25) Fri Aug 26 11:20:11 2022:
(:jsonrpc "2.0" :id 25 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 31)))
[server-reply] (id:23) Fri Aug 26 11:20:11 2022:
(:jsonrpc "2.0" :id 23 :result
          (:signatures
           []))
[server-reply] (id:24) Fri Aug 26 11:20:11 2022:
(:jsonrpc "2.0" :id 24 :result
          (:contents
           (:kind "markdown" :value nil)))
[client-request] (id:26) Fri Aug 26 11:20:13 2022:
(:jsonrpc "2.0" :id 26 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 22)))
[client-request] (id:27) Fri Aug 26 11:20:13 2022:
(:jsonrpc "2.0" :id 27 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 22)))
[client-request] (id:28) Fri Aug 26 11:20:13 2022:
(:jsonrpc "2.0" :id 28 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 22)))
[server-reply] (id:25) Fri Aug 26 11:20:13 2022:
(:jsonrpc "2.0" :id 25 :result
          [])
[server-reply] (id:26) Fri Aug 26 11:20:13 2022:
(:jsonrpc "2.0" :id 26 :result
          (:signatures
           []))
[server-reply] (id:27) Fri Aug 26 11:20:13 2022:
(:jsonrpc "2.0" :id 27 :result
          (:contents
           (:kind "markdown" :value "ActionMailer\n\nMonkeypatches the MessageDelivery to add deliver\\_now\\_or\\_later that  \ncan route between #deliver\\_now and #deliver\\_later\n\nBy default, when emails are delivered via ActiveJob, the recipients’ email  \nis logged in a line like “Sent mail to test@test.com”. Rails does not provide  \nan easy way to filter out emails from the logs. To protect user privacy, we  \nwant to remove user emails from the logs, and the only way to do it is to  \noverride the `deliver` method below such that it doesn’t log anything.")))
[server-reply] (id:28) Fri Aug 26 11:20:13 2022:
(:jsonrpc "2.0" :id 28 :result
          [(:range
            (:start
             (:line 18 :character 16)
             :end
             (:line 18 :character 28))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 16)
             :end
             (:line 27 :character 28))
            :kind 1)])
[client-request] (id:29) Fri Aug 26 11:20:18 2022:
(:jsonrpc "2.0" :id 29 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 9 :character 9)))
[client-request] (id:30) Fri Aug 26 11:20:18 2022:
(:jsonrpc "2.0" :id 30 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 9 :character 9)))
[client-request] (id:31) Fri Aug 26 11:20:18 2022:
(:jsonrpc "2.0" :id 31 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 9 :character 9)))
[server-reply] (id:29) Fri Aug 26 11:20:18 2022:
(:jsonrpc "2.0" :id 29 :result
          (:signatures
           []))
[server-reply] (id:30) Fri Aug 26 11:20:18 2022:
(:jsonrpc "2.0" :id 30 :result
          (:contents
           (:kind "markdown" :value nil)))
[internal] (id:31) Fri Aug 26 11:20:28 2022:
(:timed-out :textDocument/documentHighlight :id 31 :params
            (:textDocument
             (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
             :position
             (:line 9 :character 9)))
[client-notification] Fri Aug 26 11:21:10 2022:
(:jsonrpc "2.0" :method "textDocument/didClose" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")))
[client-notification] Fri Aug 26 11:21:18 2022:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb" :version 0 :languageId "enh-ruby" :text "require 'rails_helper'\n\nfeature 'reset password with pending profile' do\n  include PersonalKeyHelper\n\n  let(:user) { create(:user, :signed_up) }\n\n  scenario 'password reset email includes warning for pending profile' do\n    profile = create(\n      :profile,\n      deactivation_reason: :gpo_verification_pending,\n      pii: { ssn: '666-66-1234', dob: '1920-01-01', phone: '+1 703-555-9999' },\n      user: user,\n    )\n    create(:gpo_confirmation_code, profile: profile)\n\n    trigger_reset_password_and_click_email_link(user.email)\n\n    html_body = ActionMailer::Base.deliveries.last.html_part.body.decoded\n    expect(html_body).to include(\n      t('user_mailer.reset_password_instructions.gpo_letter_description'),\n    )\n  end\n\n  scenario 'password reset email does not include warning without pending profile' do\n    trigger_reset_password_and_click_email_link(user.email)\n\n    html_body = ActionMailer::Base.deliveries.last.html_part.body.decoded\n    expect(html_body).to_not include(\n      t('user_mailer.reset_password_instructions.gpo_letter_description'),\n    )\n  end\nend\n")))
[client-request] (id:32) Fri Aug 26 11:21:18 2022:
(:jsonrpc "2.0" :id 32 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 0 :character 0)))
[client-request] (id:33) Fri Aug 26 11:21:18 2022:
(:jsonrpc "2.0" :id 33 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 0 :character 0)))
[client-request] (id:34) Fri Aug 26 11:21:18 2022:
(:jsonrpc "2.0" :id 34 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 0 :character 0)))
[server-reply] (id:31) Fri Aug 26 11:21:18 2022:
(:jsonrpc "2.0" :id 31 :result
          [])
[server-reply] (id:32) Fri Aug 26 11:21:18 2022:
(:jsonrpc "2.0" :id 32 :result
          (:signatures
           []))
[server-reply] (id:33) Fri Aug 26 11:21:18 2022:
(:jsonrpc "2.0" :id 33 :result
          (:contents
           (:kind "markdown" :value "Kernel#require\n\n`(fname) =^ Boolean`\n\nLoads the given +name+, returning +true+ if successful and +false+ if the  \nfeature is already loaded.\n\nIf the filename does not resolve to an absolute path, it will be searched  \nfor in the directories listed in `$LOAD_PATH` (`$:`).\n\nIf the filename has the extension “.rb”, it is loaded as a source file; if  \nthe extension is “.so”, “.o”, or “.dll”, or the default shared library  \nextension on the current platform, Ruby loads the shared library as a  \nRuby extension. Otherwise, Ruby tries adding “.rb”, “.so”, and so on  \nto the name until found. If the file named cannot be found, a LoadError  \nwill be raised.\n\nFor Ruby extensions the filename given may use any shared library  \nextension. For example, on Linux the socket extension is “socket.so” and  \n`require 'socket.dll'` will load the socket extension.\n\nThe absolute path of the loaded file is added to  \n`$LOADED_FEATURES` (`$\"`). A file will not be  \nloaded again if its path already appears in `$\"`. For example,  \n`require 'a'; require './a'` will not load `a.rb`  \nagain.\n\n\n```ruby\nrequire \"my-library.rb\"\nrequire \"db-driver\"\n\n```\n\nAny constants or globals within the loaded source file will be available  \nin the calling program’s global namespace. However, local variables will  \nnot be propagated to the loading environment.\n\nVisibility: public")))
[server-reply] (id:34) Fri Aug 26 11:21:18 2022:
(:jsonrpc "2.0" :id 34 :result
          [(:range
            (:start
             (:line 0 :character 0)
             :end
             (:line 0 :character 7))
            :kind 1)])
[client-request] (id:35) Fri Aug 26 11:21:23 2022:
(:jsonrpc "2.0" :id 35 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 25 :character 9)))
[client-request] (id:36) Fri Aug 26 11:21:23 2022:
(:jsonrpc "2.0" :id 36 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 25 :character 9)))
[client-request] (id:37) Fri Aug 26 11:21:23 2022:
(:jsonrpc "2.0" :id 37 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 25 :character 9)))
[server-reply] (id:35) Fri Aug 26 11:21:23 2022:
(:jsonrpc "2.0" :id 35 :result
          (:signatures
           []))
[server-reply] (id:36) Fri Aug 26 11:21:23 2022:
(:jsonrpc "2.0" :id 36 :result
          (:contents
           (:kind "markdown" :value nil)))
[client-request] (id:38) Fri Aug 26 11:21:25 2022:
(:jsonrpc "2.0" :id 38 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 23)))
[client-request] (id:39) Fri Aug 26 11:21:25 2022:
(:jsonrpc "2.0" :id 39 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 23)))
[client-request] (id:40) Fri Aug 26 11:21:25 2022:
(:jsonrpc "2.0" :id 40 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 23)))
[server-reply] (id:37) Fri Aug 26 11:21:25 2022:
(:jsonrpc "2.0" :id 37 :result
          [])
[server-reply] (id:38) Fri Aug 26 11:21:25 2022:
(:jsonrpc "2.0" :id 38 :result
          (:signatures
           []))
[server-reply] (id:39) Fri Aug 26 11:21:25 2022:
(:jsonrpc "2.0" :id 39 :result
          (:contents
           (:kind "markdown" :value "ActionMailer\n\nMonkeypatches the MessageDelivery to add deliver\\_now\\_or\\_later that  \ncan route between #deliver\\_now and #deliver\\_later\n\nBy default, when emails are delivered via ActiveJob, the recipients’ email  \nis logged in a line like “Sent mail to test@test.com”. Rails does not provide  \nan easy way to filter out emails from the logs. To protect user privacy, we  \nwant to remove user emails from the logs, and the only way to do it is to  \noverride the `deliver` method below such that it doesn’t log anything.")))
[server-reply] (id:40) Fri Aug 26 11:21:25 2022:
(:jsonrpc "2.0" :id 40 :result
          [(:range
            (:start
             (:line 18 :character 16)
             :end
             (:line 18 :character 28))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 16)
             :end
             (:line 27 :character 28))
            :kind 1)])
[client-request] (id:41) Fri Aug 26 11:21:29 2022:
(:jsonrpc "2.0" :id 41 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 33)))
[client-request] (id:42) Fri Aug 26 11:21:29 2022:
(:jsonrpc "2.0" :id 42 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 33)))
[client-request] (id:43) Fri Aug 26 11:21:29 2022:
(:jsonrpc "2.0" :id 43 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 28 :character 33)))
[server-reply] (id:41) Fri Aug 26 11:21:29 2022:
(:jsonrpc "2.0" :id 41 :result
          (:signatures
           []))
[server-reply] (id:42) Fri Aug 26 11:21:29 2022:
(:jsonrpc "2.0" :id 42 :result
          (:contents
           (:kind "markdown" :value nil)))
[client-request] (id:44) Fri Aug 26 11:21:32 2022:
(:jsonrpc "2.0" :id 44 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 20)))
[client-request] (id:45) Fri Aug 26 11:21:32 2022:
(:jsonrpc "2.0" :id 45 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 20)))
[client-request] (id:46) Fri Aug 26 11:21:32 2022:
(:jsonrpc "2.0" :id 46 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 20)))
[server-reply] (id:43) Fri Aug 26 11:21:32 2022:
(:jsonrpc "2.0" :id 43 :result
          [])
[server-reply] (id:44) Fri Aug 26 11:21:32 2022:
(:jsonrpc "2.0" :id 44 :result
          (:signatures
           []))
[server-reply] (id:45) Fri Aug 26 11:21:32 2022:
(:jsonrpc "2.0" :id 45 :result
          (:contents
           (:kind "markdown" :value "ActionMailer\n\nMonkeypatches the MessageDelivery to add deliver\\_now\\_or\\_later that  \ncan route between #deliver\\_now and #deliver\\_later\n\nBy default, when emails are delivered via ActiveJob, the recipients’ email  \nis logged in a line like “Sent mail to test@test.com”. Rails does not provide  \nan easy way to filter out emails from the logs. To protect user privacy, we  \nwant to remove user emails from the logs, and the only way to do it is to  \noverride the `deliver` method below such that it doesn’t log anything.")))
[server-reply] (id:46) Fri Aug 26 11:21:32 2022:
(:jsonrpc "2.0" :id 46 :result
          [(:range
            (:start
             (:line 18 :character 16)
             :end
             (:line 18 :character 28))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 16)
             :end
             (:line 27 :character 28))
            :kind 1)])
[client-request] (id:47) Fri Aug 26 11:24:09 2022:
(:jsonrpc "2.0" :id 47 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 9)))
[client-request] (id:48) Fri Aug 26 11:24:09 2022:
(:jsonrpc "2.0" :id 48 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 9)))
[client-request] (id:49) Fri Aug 26 11:24:09 2022:
(:jsonrpc "2.0" :id 49 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 27 :character 9)))
[server-reply] (id:47) Fri Aug 26 11:24:09 2022:
(:jsonrpc "2.0" :id 47 :result
          (:signatures
           []))
[server-reply] (id:48) Fri Aug 26 11:24:09 2022:
(:jsonrpc "2.0" :id 48 :result
          (:contents
           (:kind "markdown" :value nil)))
[server-reply] (id:49) Fri Aug 26 11:24:09 2022:
(:jsonrpc "2.0" :id 49 :result
          [(:range
            (:start
             (:line 18 :character 4)
             :end
             (:line 18 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 18 :character 4)
             :end
             (:line 18 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 19 :character 11)
             :end
             (:line 19 :character 20))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 4)
             :end
             (:line 27 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 27 :character 4)
             :end
             (:line 27 :character 13))
            :kind 1)
           (:range
            (:start
             (:line 28 :character 11)
             :end
             (:line 28 :character 20))
            :kind 1)])
[client-request] (id:50) Fri Aug 26 11:24:13 2022:
(:jsonrpc "2.0" :id 50 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 25 :character 15)))
[client-request] (id:51) Fri Aug 26 11:24:13 2022:
(:jsonrpc "2.0" :id 51 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 25 :character 15)))
[client-request] (id:52) Fri Aug 26 11:24:13 2022:
(:jsonrpc "2.0" :id 52 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 25 :character 15)))
[server-reply] (id:50) Fri Aug 26 11:24:13 2022:
(:jsonrpc "2.0" :id 50 :result
          (:signatures
           []))
[server-reply] (id:51) Fri Aug 26 11:24:13 2022:
(:jsonrpc "2.0" :id 51 :result
          (:contents
           (:kind "markdown" :value nil)))
[client-request] (id:53) Fri Aug 26 11:24:15 2022:
(:jsonrpc "2.0" :id 53 :method "textDocument/signatureHelp" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 16 :character 14)))
[client-request] (id:54) Fri Aug 26 11:24:15 2022:
(:jsonrpc "2.0" :id 54 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 16 :character 14)))
[client-request] (id:55) Fri Aug 26 11:24:15 2022:
(:jsonrpc "2.0" :id 55 :method "textDocument/documentHighlight" :params
          (:textDocument
           (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
           :position
           (:line 16 :character 14)))
[server-reply] (id:52) Fri Aug 26 11:24:15 2022:
(:jsonrpc "2.0" :id 52 :result
          [])
[server-reply] (id:53) Fri Aug 26 11:24:15 2022:
(:jsonrpc "2.0" :id 53 :result
          (:signatures
           []))
[server-reply] (id:54) Fri Aug 26 11:24:15 2022:
(:jsonrpc "2.0" :id 54 :result
          (:contents
           (:kind "markdown" :value nil)))
[internal] (id:55) Fri Aug 26 11:24:25 2022:
(:timed-out :textDocument/documentHighlight :id 55 :params
            (:textDocument
             (:uri "file:///Users/ecgade/Projects/idp-8-23-22/identity-idp/spec/features/users/password_reset_with_pending_profile_spec.rb")
             :position
             (:line 16 :character 14)))

Backtrace (mandatory, unless no error message seen or heard):

There is no backtrace, but the following displays in the Message buffer:

error in process filter: eglot--hover-info: Wrong type argument: char-or-string-p, nil
error in process filter: Wrong type argument: char-or-string-p, nil

Minimum Reproducible Example (mandatory)

Here's how I suggest you structure your recipe:

  1. How is Emacs started?

I simply run emacs from the command line.

  1. Where does the language server executable live in your machine and how should it be installed?

The LSP server (solargraph) resides within an rvm environment. These are different on a per-project basis, but rvm is setup to install solagraph automatically in all ruby environments that it creates (and I can confirm the presence of the gem).

  1. What project files are needed to demonstrate the problem? Please

The issue appears to happen on textDocument LSP requests. As it stands, I cannot even create any new .rb file and type without persistent errors/warnings.

If you would like to test yourself, create a new ruby file with any syntax and hover the point on an identifier. Example:

my_string = "12345"
new_string = "#{my_string}6789"
  1. How is Emacs operated/configured before you invoke Eglot?

Here are the relevant config lines for ruby

  1. How is Emacs operated after you invoke Eglot

Here is the relevant Eglot section of the config

  1. What actions must be taken for the problem to manifest itself?

Hover over any identifier in an open ruby buffer with Eglot enabled and (successfully) connected to a solagraph server

  1. What is the expected behaviour?

I would expect some documentation about the given identifier to appear in the minibuffer or other display, rather than a message about a type error

  1. What is the observed behaviour?

  2. VERY IMPORTANT: follow your own recipe (steps 1-9) by yourself and verify that it leads to the error.

You don't HAVE to follow this guide if you are confident you can describe your own COMPLETE, MINIMAL and REPRODUCIBLE recipe. See https://github.com/joaotavora/eglot/issues/696 for a good example of an issue following this template.

joaotavora commented 1 year ago

I simply run emacs from the command line.

Please try with running emacs -Q from the command line. Your configuration is very large, I cannot load it on. In other words, your recipe may be complete, but it's not minimal.

The LSP server (solargraph) resides within an rvm environment. These are different on a per-project basis, but rvm is setup to install solagraph automatically in all ruby environments that it creates (and I can confirm the presence of the gem).

The point of this item is for you to teach us how to install the solargraph server in environments that are not yours. So come up with the simplest way to install solargraph, ideally not requiring rvm at all.

joaotavora commented 1 year ago

There is no backtrace, but the following displays in the Message buffer:

Can you try again with M-x toggle-debug-on-error?

eric-gade commented 1 year ago

@joaotavora Here is the trace I'm getting when I toggle debugging:

Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
  eglot--format-markup((:kind "markdown" :value nil))
  eglot--hover-info((:kind "markdown" :value nil) nil)
  #f(compiled-function (jsonrpc-lambda-elem12) #<bytecode -0x1284ee1b119edb04>)((:contents (:kind "markdown" :value nil)))
  jsonrpc-connection-receive(#<eglot-lsp-server eglot-lsp-server-59a8e908> (:jsonrpc "2.0" :id 102 :result (:contents (:kind "markdown" :value nil))))
  jsonrpc--process-filter(#<process autoconnect-EGLOT (identity-idp/enh-ruby-mode)> "Content-Length: 81\15\n\15\n{\"jsonrpc\":\"2.0\",\"id\":102,\"r...")

The point of this item is for you to teach us how to install the solargraph server in environments that are not yours. So come up with the simplest way to install solargraph, ideally not requiring rvm at all.

No problem. Assuming you have Ruby installed, you can run gem install solargraph

Please try with running emacs -Q from the command line. Your configuration is very large, I cannot load it on. In other words, your recipe may be complete, but it's not minimal.

I am able to replicate this error by running the following steps when using quiet emacs emacs -Q (assuming solargraph already installed per above):

  1. M-x package-refresh-contents
  2. M-x package-list-packages
  3. Select eglot and install
  4. Create a new file, ruby.rb and enter the buffer
  5. Enter the example:
    my_string = "12345"
    new_string = "#{my_string}6789"
  6. M-x eglot

The server should automatically detect and connect, and you should start seeing the warnings if you move the cursor around and hover on identifiers

acdlbs commented 1 year ago

Edit: Looks like solargraph was updated recently to return a nil value for empty hover contents - https://github.com/castwide/solargraph/commit/81bd810e7578040cbdb7650b71abb5c8a10962ab

@darth-cheney I'm also running into this issue - My hacky fix in the meantime is to just add a conditional checking if (plist-get markup :value) is nil and if so just returning a newline character.

(defun eglot--format-markup (markup)
  "Format MARKUP according to LSP's spec."
  (if (plist-get markup :value)
      (pcase-let ((`(,string ,mode)
               (if (stringp markup) (list markup 'gfm-view-mode)
                 (list (plist-get markup :value)
                       (pcase (plist-get markup :kind)
                         ("markdown" 'gfm-view-mode)
                         ("plaintext" 'text-mode)
                         (_ major-mode))))))
    (with-temp-buffer
      (setq-local markdown-fontify-code-blocks-natively t)
      (insert string)
      (let ((inhibit-message t)
        (message-log-max nil))
        (ignore-errors (delay-mode-hooks (funcall mode))))
      (font-lock-ensure)
      (string-trim (filter-buffer-substring (point-min) (point-max)))))
      "\n"))

This seems to keep the issue at bay for me.

joaotavora commented 1 year ago

I'm considering adding this patch to eglot.el:

diff --git a/eglot.el b/eglot.el
index 2e332c470f..e6db4e80af 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1459,7 +1459,7 @@ Doubles as an indicator of snippet support."
        'yas-expand-snippet))

 (defun eglot--format-markup (markup)
-  "Format MARKUP according to LSP's spec."
+  "Return string of formatted MARKUP according to LSP's spec."
   (pcase-let ((`(,string ,mode)
                (if (stringp markup) (list markup 'gfm-view-mode)
                  (list (plist-get markup :value)
@@ -1467,14 +1467,16 @@ Doubles as an indicator of snippet support."
                          ("markdown" 'gfm-view-mode)
                          ("plaintext" 'text-mode)
                          (_ major-mode))))))
-    (with-temp-buffer
-      (setq-local markdown-fontify-code-blocks-natively t)
-      (insert string)
-      (let ((inhibit-message t)
-       (message-log-max nil))
-        (ignore-errors (delay-mode-hooks (funcall mode))))
-      (font-lock-ensure)
-      (string-trim (buffer-string)))))
+    (if string
+        (with-temp-buffer
+          (setq-local markdown-fontify-code-blocks-natively t)
+          (insert string)
+          (let ((inhibit-message t)
+                (message-log-max nil))
+            (ignore-errors (delay-mode-hooks (funcall mode))))
+          (font-lock-ensure)
+          (string-trim (buffer-string)))
+      "")))

 (define-obsolete-variable-alias 'eglot-ignored-server-capabilites
   'eglot-ignored-server-capabilities "1.8")

You can try it yourself, and it's similar to the previous suggestion.

However, according to my research that landed me here, it seems that solargraph is not complying with the spec. value in a MarkupContent interface must be a string, and it's definitely sending a JSON null (which is a nil in Elisp):

See in your transcript:

[server-reply] (id:6) Fri Aug 26 11:19:16 2022:
(:jsonrpc "2.0" :id 6 :result
          (:contents
           (:kind "markdown" :value nil)))

So I'm going to tag this "workaround" and "wontfix", though I may be convinced to change it if the solargraph people don't respond to a bug report on their side.

joaotavora commented 1 year ago

Was just checking that this this was fixed on Solargraph's side, seems like it is: https://github.com/castwide/solargraph/issues/583