zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
43.09k stars 2.3k forks source link

Language server not getting ignored #11297

Closed andreicek closed 3 months ago

andreicek commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

With the following config:

"languages": {
  "Elixir": {
    "language_servers": ["lexical", "!elixir-ls", "!next-ls"]
  },
  "HEEX": {
    "language_servers": ["lexical", "!elixir-ls", "!next-ls"]
  }
},

Both lexical and next-ls and up running.

Environment

Zed: v0.133.5 (Zed) OS: macOS 14.4.1 Memory: 32 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

CleanShot 2024-05-02 at 13 53 34 CleanShot 2024-05-02 at 13 57 55

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

2024-05-02T13:54:49+02:00 [INFO] ========== starting zed ==========
2024-05-02T13:54:49+02:00 [INFO] Opening main db
2024-05-02T13:54:49+02:00 [INFO] Using git binary path: Some("/Applications/Zed.app/Contents/MacOS/git")
2024-05-02T13:54:49+02:00 [INFO] set environment variables from shell:/opt/homebrew/bin/fish, path:/opt/homebrew/opt/mise/bin:/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
2024-05-02T13:54:49+02:00 [ERROR] /Users/administrator/_work/zed/zed/crates/settings/src/settings_store.rs:229: duplicate field `languages`
2024-05-02T13:54:49+02:00 [ERROR] crates/theme/src/settings.rs:368: theme not found: Github Light
2024-05-02T13:54:49+02:00 [INFO] extensions updated. loading 3, reloading 0, unloading 0
2024-05-02T13:54:49+02:00 [INFO] Opening main db
2024-05-02T13:54:49+02:00 [INFO] building git repository, `.git` path in the worktree: ".git"
2024-05-02T13:54:49+02:00 [INFO] Opening main db
2024-05-02T13:54:49+02:00 [INFO] set status on client 0: Authenticating
2024-05-02T13:54:49+02:00 [INFO] set status on client 62391: Connecting
2024-05-02T13:54:49+02:00 [ERROR] crates/settings/src/settings_store.rs:606: duplicate field `languages`
2024-05-02T13:54:49+02:00 [ERROR] crates/workspace/src/persistence/model.rs:314: No worktree for path: "/Users/andreicek/.config/zed/settings.json"
2024-05-02T13:54:49+02:00 [INFO] Node runtime install_if_needed
2024-05-02T13:54:49+02:00 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc
2024-05-02T13:54:50+02:00 [INFO] starting language server. binary path: "/Users/andreicek/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/", args: ["/Users/andreicek/Library/Application Support/Zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-05-02T13:54:50+02:00 [ERROR] crates/settings/src/settings_store.rs:606: duplicate field `languages`
2024-05-02T13:54:50+02:00 [INFO] starting language servers for Elixir: elixir-ls, tailwindcss-language-server, elixir-ls, lexical, next-ls
2024-05-02T13:54:50+02:00 [INFO] starting language server "elixir-ls", path: "/Users/andreicek/src/contractbook/api", id: 1
2024-05-02T13:54:50+02:00 [INFO] starting language server "tailwindcss-language-server", path: "/Users/andreicek/src/contractbook/api", id: 2
2024-05-02T13:54:50+02:00 [INFO] starting language server "lexical", path: "/Users/andreicek/src/contractbook/api", id: 3
2024-05-02T13:54:50+02:00 [INFO] starting language server "next-ls", path: "/Users/andreicek/src/contractbook/api", id: 4
2024-05-02T13:54:50+02:00 [INFO] starting language servers for Elixir: elixir-ls, tailwindcss-language-server, elixir-ls, lexical, next-ls
2024-05-02T13:54:50+02:00 [INFO] fetching latest version of language server "tailwindcss-language-server"
2024-05-02T13:54:50+02:00 [INFO] Node runtime install_if_needed
2024-05-02T13:54:50+02:00 [INFO] fetching latest version of language server "elixir-ls"
2024-05-02T13:54:50+02:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-05-02T11:54:50.239Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-05-02T11:54:50.239Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-05-02T13:54:50+02:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "a6b9aecb-0cc6-4764-a721-6c23b200fb04",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-05-02T13:54:50+02:00 [INFO] add connection to peer
2024-05-02T13:54:50+02:00 [INFO] add_connection;
2024-05-02T13:54:50+02:00 [INFO] waiting for server hello
2024-05-02T13:54:50+02:00 [INFO] got server hello
2024-05-02T13:54:50+02:00 [INFO] set status to connected (connection id: ConnectionId { owner_id: 0, id: 0 }, peer id: PeerId { owner_id: 397, id: 1385920 })
2024-05-02T13:54:50+02:00 [INFO] set status on client 62391: Connected { peer_id: PeerId { owner_id: 397, id: 1385920 }, connection_id: ConnectionId { owner_id: 0, id: 0 } }
2024-05-02T13:54:50+02:00 [INFO] downloading language server "elixir-ls"
2024-05-02T13:54:50+02:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 1,
  "message": "[INFO] [auth] [2024-05-02T11:54:50.585Z] Invalid copilot token: missing token: 403 ",
  "metadataStr": "[INFO] [auth] [2024-05-02T11:54:50.585Z]",
  "extra": [
    "Invalid copilot token: missing token: 403 "
  ]
}
2024-05-02T13:54:50+02:00 [INFO] Language server with id 0 sent unhandled notification window/showMessageRequest:
{
  "type": 2,
  "message": "No access to GitHub Copilot found. You are currently logged in as andreicek.",
  "actions": [
    {
      "title": "Signup for GitHub Copilot"
    },
    {
      "title": "Dismiss"
    }
  ]
}
2024-05-02T13:54:50+02:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-05-02T11:54:50.589Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-05-02T11:54:50.589Z]",
  "extra": [
    "Telemetry initialized"
  ]
}
2024-05-02T13:54:50+02:00 [INFO] downloading language server "tailwindcss-language-server"
2024-05-02T13:54:50+02:00 [INFO] Node runtime install_if_needed
2024-05-02T13:54:50+02:00 [INFO] starting language server. binary path: "/Users/andreicek/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/andreicek/src/contractbook/api", args: ["/Users/andreicek/Library/Application Support/Zed/languages/tailwindcss-language-server/node_modules/.bin/tailwindcss-language-server", "--stdio"]
2024-05-02T13:54:51+02:00 [INFO] starting language server. binary path: "/Users/andreicek/Library/Application Support/Zed/extensions/work/elixir/lexical-v0.6.0/lexical/bin/start_lexical.sh", working directory: "/Users/andreicek/src/contractbook/api", args: []
2024-05-02T13:54:51+02:00 [INFO] starting language server. binary path: "/Users/andreicek/Library/Application Support/Zed/extensions/work/elixir/next-ls-v0.20.2/next-ls", working directory: "/Users/andreicek/src/contractbook/api", args: ["--stdio"]
2024-05-02T13:54:51+02:00 [ERROR] failed to start language server "elixir-ls": cannot run elixir-ls
2024-05-02T13:54:51+02:00 [ERROR] server stderr: Some("")
2024-05-02T13:54:51+02:00 [INFO] retrying installation of language server "elixir-ls" in 1s
2024-05-02T13:54:52+02:00 [INFO] About to spawn test binary
2024-05-02T13:54:52+02:00 [WARN] test binary failed to launch
2024-05-02T13:54:52+02:00 [WARN] test binary check failed
2024-05-02T13:54:52+02:00 [INFO] beginning to reinstall server
2024-05-02T13:54:52+02:00 [INFO] deleting server container
2024-05-02T13:54:52+02:00 [INFO] starting language server "elixir-ls", path: "/Users/andreicek/src/contractbook/api", id: 5
2024-05-02T13:54:52+02:00 [ERROR] failed to start language server "elixir-ls": cannot run elixir-ls
2024-05-02T13:54:52+02:00 [ERROR] server stderr: Some("")
2024-05-02T13:54:52+02:00 [INFO] retrying installation of language server "elixir-ls" in 1s
2024-05-02T13:54:52+02:00 [INFO] skipping numeric progress token 610
2024-05-02T13:54:53+02:00 [ERROR] missing executable in directory "/Users/andreicek/Library/Application Support/Zed/languages/elixir-ls/elixir-ls/language_server.sh"
2024-05-02T13:54:53+02:00 [INFO] About to spawn test binary
2024-05-02T13:54:53+02:00 [WARN] test binary failed to launch
2024-05-02T13:54:53+02:00 [WARN] test binary check failed
2024-05-02T13:54:53+02:00 [INFO] beginning to reinstall server
2024-05-02T13:54:53+02:00 [INFO] deleting server container
2024-05-02T13:54:53+02:00 [ERROR] crates/language/src/language_registry.rs:850: server container removal

Caused by:
    No such file or directory (os error 2)
2024-05-02T13:54:53+02:00 [INFO] starting language server "elixir-ls", path: "/Users/andreicek/src/contractbook/api", id: 6
2024-05-02T13:54:53+02:00 [ERROR] failed to start language server "elixir-ls": cannot run elixir-ls
2024-05-02T13:54:53+02:00 [ERROR] server stderr: Some("")
2024-05-02T13:54:53+02:00 [INFO] retrying installation of language server "elixir-ls" in 1s
2024-05-02T13:54:53+02:00 [INFO] skipping numeric progress token 610
2024-05-02T13:54:53+02:00 [INFO] skipping numeric progress token 3
2024-05-02T13:54:53+02:00 [INFO] skipping numeric progress token 3
2024-05-02T13:54:53+02:00 [INFO] skipping numeric progress token 35
2024-05-02T13:54:53+02:00 [INFO] skipping numeric progress token 35
2024-05-02T13:54:53+02:00 [INFO] skipping numeric progress token 674
2024-05-02T13:54:54+02:00 [ERROR] missing executable in directory "/Users/andreicek/Library/Application Support/Zed/languages/elixir-ls/elixir-ls/language_server.sh"
2024-05-02T13:54:54+02:00 [INFO] About to spawn test binary
2024-05-02T13:54:54+02:00 [WARN] test binary failed to launch
2024-05-02T13:54:54+02:00 [WARN] test binary check failed
2024-05-02T13:54:54+02:00 [INFO] beginning to reinstall server
2024-05-02T13:54:54+02:00 [INFO] deleting server container
2024-05-02T13:54:54+02:00 [ERROR] crates/language/src/language_registry.rs:850: server container removal

Caused by:
    No such file or directory (os error 2)
2024-05-02T13:54:54+02:00 [INFO] starting language server "elixir-ls", path: "/Users/andreicek/src/contractbook/api", id: 7
2024-05-02T13:54:54+02:00 [ERROR] failed to start language server "elixir-ls": cannot run elixir-ls
2024-05-02T13:54:54+02:00 [ERROR] server stderr: Some("")
2024-05-02T13:54:54+02:00 [INFO] retrying installation of language server "elixir-ls" in 1s
2024-05-02T13:54:55+02:00 [ERROR] missing executable in directory "/Users/andreicek/Library/Application Support/Zed/languages/elixir-ls/elixir-ls/language_server.sh"
2024-05-02T13:54:55+02:00 [INFO] About to spawn test binary
2024-05-02T13:54:55+02:00 [WARN] test binary failed to launch
2024-05-02T13:54:55+02:00 [WARN] test binary check failed
2024-05-02T13:54:55+02:00 [INFO] beginning to reinstall server
2024-05-02T13:54:55+02:00 [INFO] deleting server container
2024-05-02T13:54:55+02:00 [ERROR] crates/language/src/language_registry.rs:850: server container removal

Caused by:
    No such file or directory (os error 2)
2024-05-02T13:54:55+02:00 [INFO] starting language server "elixir-ls", path: "/Users/andreicek/src/contractbook/api", id: 8
2024-05-02T13:54:55+02:00 [ERROR] failed to start language server "elixir-ls": cannot run elixir-ls
2024-05-02T13:54:55+02:00 [ERROR] server stderr: Some("")
2024-05-02T13:54:55+02:00 [ERROR] Hit 4 reinstallation attempts for "elixir-ls"
2024-05-02T13:54:55+02:00 [INFO] skipping numeric progress token 674
2024-05-02T13:54:55+02:00 [INFO] skipping numeric progress token 706
2024-05-02T13:54:55+02:00 [INFO] skipping numeric progress token 706
2024-05-02T13:54:55+02:00 [INFO] skipping numeric progress token 67
2024-05-02T13:54:57+02:00 [WARN] failed to deserialize LSP message:
{"error":{"code":-32603,"message":"** (FunctionClauseError) no function clause matching in LXical.RemoteControl.Api.code_actions/5\n    (lx_remote_control 0.5.0) lib/lexical/remote_control/api.ex:40: LXical.RemoteControl.Api.code_actions(%{__struct__: LXical.Project, entropy: 39798, env_variables: %{}, mix_env: nil, mix_exs_uri: \"file:///Users/andreicek/src/contractbook/api/mix.exs\", mix_project?: true, mix_target: nil, project_module: nil, root_uri: \"file:///Users/andreicek/src/contractbook/api\"}, #Inspect.Error<\n  got UndefinedFunctionError with message:\n\n      \"\"\"\n      function Code.Identifier.inspect_as_atom/1 is undefined or private\n      \"\"\"\n\n  while inspecting:\n\n      %{\n        __struct__: LXical.Document,\n        dirty?: false,\n        language_id: \"\",\n        lines: %Lines<\"defmodule Contractbook.Domain.Draft.UseCase do...\"(514 lines)>,\n        path: \"/Users/andreicek/src/contractbook/api/lib/contractbook_domain/draft/use_case.ex\",\n        uri: \"file:///Users/andreicek/src/contractbook/api/lib/contractbook_domain/draft/use_case.ex\",\n        version: 0\n      }\n\n  Stacktrace:\n\n    (elixir 1.16.0) Code.Identifier.inspect_as_atom(LXical.Document)\n    (lx_lexical_shared 0.5.0) lib/lexical/document.ex:25: Inspect.LXical.Document.inspect/2\n    (elixir 1.16.0) lib/inspect/algebra.ex:347: Inspect.Algebra.to_doc/2\n    (elixir 1.16.0) lib/kernel.ex:2351: Kernel.inspect/2\n    (elixir 1.16.0) lib/enum.ex:1700: Enum.\"-map/2-lists^map/1-1-\"/2\n    (elixir 1.16.0) lib/enum.ex:1700: Enum.\"-map/2-lists^map/1-1-\"/2\n    (elixir 1.16.0) lib/exception.ex:718: Exception.format_arity/1\n    (elixir 1.16.0) lib/exception.ex:713: Exception.format_mfa/3\n\n>, #Protocol.Types.Range<[end: #Protocol.Types.Position<[character: 79, line: 41]>, start: #Protocol.Types.Position<[character: 92, line: 40]>]>, [], [:empty, :quick_fix, :refactor, :refactor_extract, :source])\n    (lx_server 0.5.0) lib/lexical/server/provider/handlers/code_action.ex:16: LXical.Server.Provider.Handlers.CodeAction.handle/2\n    (lx_server 0.5.0) lib/lexical/server/provider/queue.ex:99: anonymous fn/2 in LXical.Server.Provider.Queue.State.as_task/2\n    (elixir 1.16.0) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2\n    (elixir 1.16.0) lib/task/supervised.ex:36: Task.Supervised.reply/4\n"},"id":2}
2024-05-02T13:54:58+02:00 [WARN] failed to deserialize LSP message:
{"error":{"code":-32800,"message":"Request cancelled"},"id":"3"}
2024-05-02T13:54:58+02:00 [WARN] failed to deserialize LSP message:
{"error":{"code":-32603,"message":"** (FunctionClauseError) no function clause matching in LXical.RemoteControl.Api.code_actions/5\n    (lx_remote_control 0.5.0) lib/lexical/remote_control/api.ex:40: LXical.RemoteControl.Api.code_actions(%{__struct__: LXical.Project, entropy: 39798, env_variables: %{}, mix_env: nil, mix_exs_uri: \"file:///Users/andreicek/src/contractbook/api/mix.exs\", mix_project?: true, mix_target: nil, project_module: nil, root_uri: \"file:///Users/andreicek/src/contractbook/api\"}, #Inspect.Error<\n  got UndefinedFunctionError with message:\n\n      \"\"\"\n      function Code.Identifier.inspect_as_atom/1 is undefined or private\n      \"\"\"\n\n  while inspecting:\n\n      %{\n        __struct__: LXical.Document,\n        dirty?: false,\n        language_id: \"\",\n        lines: %Lines<\"defmodule Contractbook.Domain.Draft.UseCase do...\"(514 lines)>,\n        path: \"/Users/andreicek/src/contractbook/api/lib/contractbook_domain/draft/use_case.ex\",\n        uri: \"file:///Users/andreicek/src/contractbook/api/lib/contractbook_domain/draft/use_case.ex\",\n        version: 0\n      }\n\n  Stacktrace:\n\n    (elixir 1.16.0) Code.Identifier.inspect_as_atom(LXical.Document)\n    (lx_lexical_shared 0.5.0) lib/lexical/document.ex:25: Inspect.LXical.Document.inspect/2\n    (elixir 1.16.0) lib/inspect/algebra.ex:347: Inspect.Algebra.to_doc/2\n    (elixir 1.16.0) lib/kernel.ex:2351: Kernel.inspect/2\n    (elixir 1.16.0) lib/enum.ex:1700: Enum.\"-map/2-lists^map/1-1-\"/2\n    (elixir 1.16.0) lib/enum.ex:1700: Enum.\"-map/2-lists^map/1-1-\"/2\n    (elixir 1.16.0) lib/exception.ex:718: Exception.format_arity/1\n    (elixir 1.16.0) lib/exception.ex:713: Exception.format_mfa/3\n\n>, #Protocol.Types.Range<[end: #Protocol.Types.Position<[character: 16, line: 32]>, start: #Protocol.Types.Position<[character: 16, line: 32]>]>, [], [:empty, :quick_fix, :refactor, :refactor_extract, :source])\n    (lx_server 0.5.0) lib/lexical/server/provider/handlers/code_action.ex:16: LXical.Server.Provider.Handlers.CodeAction.handle/2\n    (lx_server 0.5.0) lib/lexical/server/provider/queue.ex:99: anonymous fn/2 in LXical.Server.Provider.Queue.State.as_task/2\n    (elixir 1.16.0) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2\n    (elixir 1.16.0) lib/task/supervised.ex:36: Task.Supervised.reply/4\n"},"id":4}
2024-05-02T13:55:11+02:00 [WARN] failed to deserialize LSP message:
{"error":{"code":-32800,"message":"Request cancelled"},"id":"5"}
2024-05-02T13:55:14+02:00 [INFO] skipping numeric progress token 67
2024-05-02T13:55:14+02:00 [INFO] skipping numeric progress token 738
2024-05-02T13:55:14+02:00 [INFO] skipping numeric progress token 738
2024-05-02T13:55:14+02:00 [INFO] skipping numeric progress token 770
2024-05-02T13:55:14+02:00 [INFO] skipping numeric progress token 770
2024-05-02T13:55:21+02:00 [INFO] skipping numeric progress token 802
2024-05-02T13:55:22+02:00 [INFO] skipping numeric progress token 802
2024-05-02T13:55:22+02:00 [INFO] skipping numeric progress token 802
2024-05-02T13:55:22+02:00 [INFO] skipping numeric progress token 802
2024-05-02T13:55:23+02:00 [INFO] skipping numeric progress token 802
2024-05-02T13:55:23+02:00 [INFO] skipping numeric progress token 802
maxdeviant commented 3 months ago

@andreicek Do you happen to have a language_overrides key in your settings as well?

andreicek commented 3 months ago

Ah yes, I do have:


    "language_overrides": {
    "Elixir": {
      "format_on_save": {
        "external": {
          "command": "mix",
          "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
        }
      }
    }
  }

Is this problematic? Can it be moved somewhere?

maxdeviant commented 3 months ago

Ah yes, I do have:

  "language_overrides": {
    "Elixir": {
      "format_on_save": {
        "external": {
          "command": "mix",
          "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
        }
      }
    }
  }

Is this problematic? Can it be moved somewhere?

language_overrides is an alias for languages, so they can both be combined under the languages setting.

So in your case you would have this:

{
  "languages": {
    "Elixir": {
      "language_servers": ["lexical", "!elixir-ls", "!next-ls"],
      "format_on_save": {
        "external": {
          "command": "mix",
          "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
        }
      }
    },
    "HEEX": {
      "language_servers": ["lexical", "!elixir-ls", "!next-ls"]
    }
  }
}
andreicek commented 3 months ago

Is there a way to get the old elixir.lsp.local behaviour?

maxdeviant commented 3 months ago

Is there a way to get the old elixir.lsp.local behaviour?

We don't have that exact setting anymore.

What are you looking to do?

andreicek commented 3 months ago

Controlling a version of lexical and next-ls for development. I guess I can try extracting the extension from zed repo, and running a dev extension with hardcoded values for the LSP.

Non the less this config, which you provided:

{
  "languages": {
    "Elixir": {
      "language_servers": ["lexical", "!elixir-ls", "!next-ls"],
      "format_on_save": {
        "external": {
          "command": "mix",
          "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
        }
      }
    },
    "HEEX": {
      "language_servers": ["lexical", "!elixir-ls", "!next-ls"]
    }
  }
}

Works as expected. Thank you so much <3.

maxdeviant commented 3 months ago

Controlling a version of lexical and next-ls for development. I guess I can try extracting the extension from zed repo, and running a dev extension with hardcoded values for the LSP.

It looks like we don't currently do it for Next LS or Lexical, but for Elixir LS we check for an elixir-ls binary that's already on the $PATH: https://github.com/zed-industries/zed/blob/d61c47d2a9d69fbb9f7e4e30d48c444543a9de49/extensions/elixir/src/language_servers/elixir_ls.rs#L26-L28

Would that work for your use-case if we did something similar for the other two language servers?

andreicek commented 3 months ago

For lexical it could work, as you could put the start script to your path:

https://github.com/andreicek/dotfiles/blob/767a7c86565ee5d9467a07a1ae9476a9e41f716f/zed/.config/zed/settings.json#L10-L13 (ref.)

  "elixir": {
    "lsp": {
      "local": {
        "path": "/Users/andreicek/src/lexical-lsp/lexical/_build/dev/package/lexical/bin/start_lexical.sh",
        "arguments": [""]
      }
    }
  },

However for next-ls I don't think it would not be enough, as I had to add --stdio to arguments for it to work (see docs). Maybe @mhanberg has some ideas?

mhanberg commented 3 months ago

I'm not sure I'm fully understanding.

It seems like @maxdeviant is saying that they could alter the NextLS integration to first look for next-ls in your path, as they do for elixir-ls.

If you build a local version of next-ls, you could add it to your path and be good to go.

Ideally tho, Zed would implement a TCP adapter, if you are really trying to test the LSP in development

andreicek commented 3 months ago

Yes, you're right. However, before I needed the --stdio flag for it to work, which is now not possible to pass in.

mhanberg commented 3 months ago

I think I am still not understanding.

which is now not possible to pass in.

I am under the impression you can't configure a local LSP at all.

andreicek commented 3 months ago

Yes, and the proposed solution to look for next-ls in the path won't work since there would be no way to pass the required argument in. Right? πŸ˜ƒ

andreicek commented 3 months ago

Ah, no -- I'm very dense. Sorry.

It would work well since zed already passes the correct flag in when starting next-ls.

@maxdeviant would it be OK if I tried to add the same check you do for elixir-ls to all other LSP options?

maxdeviant commented 3 months ago

@maxdeviant would it be OK if I tried to add the same check you do for elixir-ls to all other LSP options?

That would be great! I was considering doing it myself, but I wasn't sure which of the other ones it applied to πŸ™‚