next-ls icon indicating copy to clipboard operation
next-ls copied to clipboard

emacs(eglot) - Runtime for folder failed to initialize

Open tjheeta opened this issue 2 years ago • 14 comments

emacs 29.1 with stock eglot

FYI, epmd is running, though I have no idea how that would affect anything since I think eglot forks and communicates over stdio.

Several sqlite db's have been created but they are empty:

$ find . 
.
./.elixir-tools
./.elixir-tools/.gitignore
./.elixir-tools/nextls.db
./README.md
./mix.exs
./.formatter.exs
./test
./test/tmpproj_test.exs
./test/test_helper.exs
./.gitignore
./lib
./lib/.elixir-tools
./lib/.elixir-tools/.gitignore
./lib/.elixir-tools/nextls.db
./lib/tmpproj.ex

Eglot events log:

[client-request] (id:1) Wed Oct  4 12:41:14 2023:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
          (:processId 10401 :clientInfo
           (:name "Eglot")
           :rootPath "/tmp/tmpproj/" :rootUri "file:///tmp/tmpproj" :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 :resolveSupport
              (:properties
               ["edit" "command"])
              :dataSupport t :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
            (:showDocument
             (:support t)
             :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:///tmp/tmpproj" :name "/tmp/tmpproj/")]))
[server-reply] (id:1) Wed Oct  4 12:41:15 2023:
(:id 1 :jsonrpc "2.0" :result
     (:capabilities
      (:definitionProvider t :documentFormattingProvider t :documentSymbolProvider t :experimental nil :hoverProvider t :referencesProvider t :textDocumentSync
       (:change 1 :openClose t :save
                (:includeText t))
       :workspace
       (:workspaceFolders
        (:changeNotifications t :supported t))
       :workspaceSymbolProvider t)
      :serverInfo
      (:name "Next LS")))
[client-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "initialized" :params #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                            ()))
[client-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs" :version 0 :languageId "elixir" :text "defmodule Tmpproj.MixProject do\n  use Mix.Project\n\n  def project do\n    [\n      app: :tmpproj,\n      version: \"0.1.0\",\n      elixir: \"~> 1.14\",\n      start_permanent: Mix.env() == :prod,\n      deps: deps()\n    ]\n  end\n\n  # Run \"mix help compile.app\" to learn about applications.\n  def application do\n    [\n      extra_applications: [:logger]\n    ]\n  end\n\n  # Run \"mix help deps\" to learn about dependencies.\n  defp deps do\n    [\n      # {:dep_from_hexpm, \"~> 0.3.0\"},\n      # {:dep_from_git, git: \"https://github.com/elixir-lang/my_dep.git\", tag: \"0.1.0\"}\n    ]\n  end\nend\n")))
[client-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params
          (:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                   ())))
[server-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] NextLS v0.13.3 has initialized!" :type 4))
[server-request] (id:36) Wed Oct  4 12:41:15 2023:
(:id 36 :jsonrpc "2.0" :method "client/registerCapability" :params
     (:registrations
      [(:id "file-watching" :method "workspace/didChangeWatchedFiles" :registerOptions
            (:watchers
             [(:globPattern "**/*.ex" :kind 7)
              (:globPattern "**/*.exs" :kind 7)
              (:globPattern "**/*.leex" :kind 7)
              (:globPattern "**/*.eex" :kind 7)
              (:globPattern "**/*.heex" :kind 7)
              (:globPattern "**/*.sface" :kind 7)]))]))
[client-reply] (id:36) Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :id 36 :result nil)
[server-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Booting runtimes..." :type 4))
[server-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "$/progress" :params
          (:token "D2W0XXX9" :value
                  (:kind "begin" :title "Initializing NextLS runtime for folder /tmp/tmpproj/...")))
[server-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Beginning DB migration..." :type 4))
[server-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Database is on the latest version: 5" :type 3))
[server-notification] Wed Oct  4 12:41:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Finished DB migration..." :type 4))
[client-request] (id:2) Wed Oct  4 12:41:47 2023:
(:jsonrpc "2.0" :id 2 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs")
           :position
           (:line 17 :character 0)))
[server-reply] (id:2) Wed Oct  4 12:41:47 2023:
(:id 2 :jsonrpc "2.0" :result nil)
[server-notification] Wed Oct  4 12:43:15 2023:
(:jsonrpc "2.0" :method "$/progress" :params
          (:token "D2W0XXX9" :value
                  (:kind "end")))
[server-notification] Wed Oct  4 12:43:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Runtime for folder /tmp/tmpproj/ failed to initialize" :type 1))
[client-request] (id:3) Wed Oct  4 12:45:20 2023:
(:jsonrpc "2.0" :id 3 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs")
           :position
           (:line 18 :character 0)))
[internal] (id:3) Wed Oct  4 12:45:30 2023:
(:timed-out :textDocument/hover :id 3 :params
            (:textDocument
             (:uri "file:///tmp/tmpproj/mix.exs")
             :position
             (:line 18 :character 0)))
[client-notification] Wed Oct  4 12:45:47 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
          (:changes
           [(:uri "file:///tmp/tmpproj/lib/tmpproj.ex" :type 2)]))
[client-notification] Wed Oct  4 12:46:04 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
          (:changes
           [(:uri "file:///tmp/tmpproj/lib/tmpproj.ex" :type 2)]))

tjheeta avatar Oct 04 '23 20:10 tjheeta

FYI, epmd is running, though I have no idea how that would affect anything since I think eglot forks and communicates over stdio.

Next LS uses distributed erlang to connect the LSP node (next ls) with a runtime node (your project's code)

is this project a git repository? with my testing of emacs, it seemed to need it to be a git repo in order to successfully determine the root directory of your project.

that would explain why it created a .elixir-tools dir in the lib directory.

mhanberg avatar Oct 04 '23 20:10 mhanberg

also is this GUI emacs or terminal emacs?

mhanberg avatar Oct 04 '23 20:10 mhanberg

is this project a git repository? with my testing of emacs, it seemed to need it to be a git repo in order to successfully determine the root directory of your project.

There was no source control on the test project.

also is this GUI emacs or terminal emacs?

GUI - doom emacs with elixir-mode enabled

I don't see any flags to start next-ls in debug mode. What would the next debug steps be?

tjheeta avatar Oct 04 '23 23:10 tjheeta

GUI - doom emacs with elixir-mode enabled

I have gotten it working with doom, but in the terminal. I suspect that elixir might not be in your path, which is why it can't start the runtime node. is it possible to open the GUI from the terminal, similar to how with VSCode or macvim you can do code . ? that usually makes sure that works.

I don't see any flags to start next-ls in debug mode. What would the next debug steps be?

generally the next steps are to start the server in TCP mode nextls --port 9000 and connecting the editor through that way. but i would attempt my previous suggestion first.

mhanberg avatar Oct 05 '23 00:10 mhanberg

I suspect that elixir might not be in your path, which is why it can't start the runtime node.

Hmmm...elixir-ls, inf-elixir, and alchemist work properly, so other plugins can find elixir properly. And it is in $PATH afterall, so I think this is unlikely.

is it possible to open the GUI from the terminal, similar to how with VSCode or macvim you can do code . ? that usually makes sure that works.

emacs --no-window-system is what I ran with to get the following log. The client-server communication is roughly the same as before with GUI Emacs. It failed to initialize and subsequent requests start timing out. This doesn't seem to be an next-ls and emacs communication problem if I'm reading the logs correctly? In fact, on the GUI in the modeline it does display the message of failed initialization given by the following log:

[server-notification] Wed Oct  4 17:54:44 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Runtime for folder /tmp/tmpproj/ failed to initialize" :type 1))

Rest of the logs:

(:jsonrpc "2.0" :id 1 :method "initialize" :params
          (:processId 16608 :clientInfo
                      (:name "Eglot")
                      :rootPath "/tmp/tmpproj/" :rootUri "file:///tmp/tmpproj" :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 :resolveSupport
                                              (:properties
                                               ["edit" "command"])
                                              :dataSupport t :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
                       (:showDocument
                        (:support t)
                        :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:///tmp/tmpproj" :name "/tmp/tmpproj/")]))
[server-reply] (id:1) Wed Oct  4 17:52:43 2023:
(:id 1 :jsonrpc "2.0" :result
     (:capabilities
      (:definitionProvider t :documentFormattingProvider t :documentSymbolProvider t :experimental nil :hoverProvider t :referencesProvider t :textDocumentSync
                           (:change 1 :openClose t :save
                                    (:includeText t))
                           :workspace
                           (:workspaceFolders
                            (:changeNotifications t :supported t))
                           :workspaceSymbolProvider t)
      :serverInfo
      (:name "Next LS")))
[client-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "initialized" :params #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                            ()))
[client-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs" :version 0 :languageId "elixir" :text "defmodule Tmpproj.MixProject do\n  use Mix.Project\n\n  def project do\n    [\n      app: :tmpproj,\n      version: \"0.1.0\",\n      elixir: \"~> 1.14\",\n      start_permanent: Mix.env() == :prod,\n      deps: deps()\n    ]\n  end\n\n  # Run \"mix help compile.app\" to learn about applications.\n  def application do\n    [\n      extra_applications: [:logger]\n    ]\n  end\n\n  # Run \"mix help deps\" to learn about dependencies.\n  defp deps do\n    [\n      # {:dep_from_hexpm, \"~> 0.3.0\"},\n      # {:dep_from_git, git: \"https://github.com/elixir-lang/my_dep.git\", tag: \"0.1.0\"}\n    ]\n  end\nend\n")))
[client-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params
          (:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                   ())))
[server-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] NextLS v0.13.3 has initialized!" :type 4))
[server-request] (id:322) Wed Oct  4 17:52:43 2023:
(:id 322 :jsonrpc "2.0" :method "client/registerCapability" :params
     (:registrations
      [(:id "file-watching" :method "workspace/didChangeWatchedFiles" :registerOptions
            (:watchers
             [(:globPattern "**/*.ex" :kind 7)
              (:globPattern "**/*.exs" :kind 7)
              (:globPattern "**/*.leex" :kind 7)
              (:globPattern "**/*.eex" :kind 7)
              (:globPattern "**/*.heex" :kind 7)
              (:globPattern "**/*.sface" :kind 7)]))]))
[client-reply] (id:322) Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :id 322 :result nil)
[server-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Booting runtimes..." :type 4))
[server-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "$/progress" :params
          (:token "sEG7NvNg" :value
                  (:kind "begin" :title "Initializing NextLS runtime for folder /tmp/tmpproj/...")))
[server-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Beginning DB migration..." :type 4))
[server-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Database is on the latest version: 5" :type 3))
[server-notification] Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Finished DB migration..." :type 4))
[client-request] (id:2) Wed Oct  4 17:52:43 2023:
(:jsonrpc "2.0" :id 2 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs")
           :position
           (:line 20 :character 0)))
[server-reply] (id:2) Wed Oct  4 17:52:43 2023:
(:id 2 :jsonrpc "2.0" :result nil)
[client-request] (id:3) Wed Oct  4 17:52:46 2023:
(:jsonrpc "2.0" :id 3 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs")
           :position
           (:line 19 :character 0)))
[server-reply] (id:3) Wed Oct  4 17:52:46 2023:
(:id 3 :jsonrpc "2.0" :result nil)
[client-notification] Wed Oct  4 17:54:26 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
          (:changes
           [(:uri "file:///tmp/tmpproj/lib/tmpproj.ex" :type 2)]))
[server-notification] Wed Oct  4 17:54:44 2023:
(:jsonrpc "2.0" :method "$/progress" :params
          (:token "sEG7NvNg" :value
                  (:kind "end")))
[server-notification] Wed Oct  4 17:54:44 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
          (:message "[NextLS] Runtime for folder /tmp/tmpproj/ failed to initialize" :type 1))
[client-request] (id:4) Wed Oct  4 17:55:15 2023:
(:jsonrpc "2.0" :id 4 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs")
           :position
           (:line 19 :character 0)))
[client-request] (id:5) Wed Oct  4 17:55:17 2023:
(:jsonrpc "2.0" :id 5 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs")
           :position
           (:line 22 :character 0)))
[internal] (id:6) Wed Oct  4 17:55:18 2023:
(:deferring :textDocument/hover :id 6 :params
            (:textDocument
             (:uri "file:///tmp/tmpproj/mix.exs")
             :position
             (:line 23 :character 6)))
[client-notification] Wed Oct  4 17:55:18 2023:
(:jsonrpc "2.0" :method "textDocument/didChange" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs" :version 2)
           :contentChanges
           [(:text "defmodule Tmpproj.MixProject do\n  use Mix.Project\n\n  def project do\n    [\n      app: :tmpproj,\n      version: \"0.1.0\",\n      elixir: \"~> 1.14\",\n      start_permanent: Mix.env() == :prod,\n      deps: deps()\n    ]\n  end\n\n  # Run \"mix help compile.app\" to learn about applications.\n  def application do\n    [\n      extra_applications: [:logger]\n    ]\n  end\n\n  # Run \"mix help deps\" to learn about dependencies.\n  defp deps do\n    [\n      \n      # {:dep_from_hexpm, \"~> 0.3.0\"},\n      # {:dep_from_git, git: \"https://github.com/elixir-lang/my_dep.git\", tag: \"0.1.0\"}\n    ]\n  end\nend\n")]))
[internal] Wed Oct  4 17:55:18 2023:
(:maybe-run-deferred
 (6))
[client-request] (id:6) Wed Oct  4 17:55:18 2023:
(:jsonrpc "2.0" :id 6 :method "textDocument/hover" :params
          (:textDocument
           (:uri "file:///tmp/tmpproj/mix.exs")
           :position
           (:line 23 :character 6)))
[internal] (id:4) Wed Oct  4 17:55:25 2023:
(:timed-out :textDocument/hover :id 4 :params
            (:textDocument
             (:uri "file:///tmp/tmpproj/mix.exs")
             :position
             (:line 19 :character 0)))
[internal] (id:5) Wed Oct  4 17:55:27 2023:
(:timed-out :textDocument/hover :id 5 :params
            (:textDocument
             (:uri "file:///tmp/tmpproj/mix.exs")
             :position
             (:line 22 :character 0)))
[internal] (id:6) Wed Oct  4 17:55:28 2023:
(:timed-out :textDocument/hover :id 6 :params
            (:textDocument
             (:uri "file:///tmp/tmpproj/mix.exs")
             :position
             (:line 23 :character 6)))
[internal] (id:6) Wed Oct  4 17:55:28 2023:
(:timed-out :textDocument/hover :id 6 :params
            (:textDocument
             (:uri "file:///tmp/tmpproj/mix.exs")
             :position
             (:line 23 :character 6)))


tjheeta avatar Oct 05 '23 01:10 tjheeta

@tjheeta can you share your elixir/otp versions, operating system, etc

mhanberg avatar Oct 05 '23 04:10 mhanberg

Elixir 1.14.0 OTP 25 Linux

There was something another person mentioned regarding localhost and inet.gethostname? Could that be the issue?

tjheeta avatar Oct 06 '23 03:10 tjheeta

What's the Linux distribution?

And maybe, I'll look into it

mhanberg avatar Oct 06 '23 09:10 mhanberg

Also, maybe update an try again. I cut a release that has some more logging that could help possibly.

mhanberg avatar Oct 06 '23 15:10 mhanberg

https://github.com/elixir-tools/next-ls/compare/main...klalafudaklalafu:next-ls:node-hostname-fix

That fixed it for me. Sqlite updates now. Going back and forth with references works. Hover for docs does not. No idea how to do outline mode. And nothing autocompletes.

tjheeta avatar Oct 07 '23 01:10 tjheeta

Autocomplete isn't implemented yet.

Can you delete the .elixir-tools directory and try again with the patch to see if hover will work?

mhanberg avatar Oct 07 '23 04:10 mhanberg

I also had the same issue, but using Neovim. Applying the above patch let NextLS initialize.

It did throw up an error when I did not run NextLS on the same elixir/erlang/otp version as the project. I am not sure if that is always required when running outside of the burrito releases.

(e: I dont mean this to sound complain-y, just noting the experience I guess. No output to really attach for debugging...)

Hovering seemed pretty temperamental here too.

Initially it did not work until indexing completed, which took sometime in my project. Not sure if the (multiple) "indexing ..." messages are surfaced in Emacs, it might have been invisibly indexing still? After indexing it was also not that effective for modules in the project, I could only get it to show the docs on one project function but it would work fine for Elixir's stdlib. When I restarted Neovim I could not get it to give any hovers...

elixir          1.15.5-otp-26
erlang          26.0.2
Arch Linux      6.5.5-arch1-1
NextLS          0.13.4 (with hostname patch)
Nvim            0.9.4

rktjmp avatar Oct 15 '23 12:10 rktjmp

Oh, just remembered for hover.

You need to build your OTP with docs enabled.

I think the flag is KERL_DOCS=1 when compiling OTP.

I'll investigate that patch again (I just returned home from vacation).

mhanberg avatar Oct 15 '23 13:10 mhanberg

I dont mean this to sound complain-y, just noting the experience I guess. No output to really attach for debugging...

@rktjmp no worries at all! The more data points the better.

mhanberg avatar Oct 15 '23 13:10 mhanberg