TerminalFi / LSP-copilot

GitHub Copilot support for Sublime Text LSP plugin provided through Copilot.vim.
658 stars 25 forks source link

Cannot run LSP-copilot. #210

Open pioz opened 4 hours ago

pioz commented 4 hours ago

I'm not able to run Copilot with my Sublime Text editor.

I've done this steps:

I'm on mac os x 14.6.1 and Sublime Text 4180. My node is installed:

node --version                 
v20.17.0
which node       
/Users/pioz/.local/share/mise/installs/node/lts/bin/node

Now if I open the command palette and type "Copilot: Sign In" I do not see any available option:

Screenshot 2024-09-27 at 10 48 46

My Troubleshooting: LSP-copilot output is:

# Troubleshooting: LSP-copilot
## Version
 - LSP: 2.2.0
 - Sublime Text: 4180
## Server Test Run
 - exit code: -1
 - output

Failed resolving Node.js Runtime. Please check in the console for more details.

## Server Configuration
 - command
```json
[
  "${node_bin}",
  "${server_path}",
  "--stdio"
]
 - selector

source | text | embedding

 - priority_selector

source | text | embedding

 - init_options
```json
{}

Active view

Project / Workspace

LSP configuration

{
  "clients": {
    "copilot": {
      "command": [
        "node",
        "/path/to/copilot-lsp",
        "--stdio"
      ],
      "enabled": true,
      "env": {
        "PATH": "/usr/local/bin:/path/to/node:/path/to/copilot-lsp:$PATH"
      }
    }
  }
}

System PATH

My console output:

--- lsp_utils Node.js resolving start ---
Resolving Node.js Runtime in env PATH for package LSP-copilot...
 * Failed: "node" binary not found
Resolving Node.js Runtime from lsp_utils for package LSP-copilot...
 * Binaries check failed: "node" binary not found
 * Download skipped
--- lsp_utils Node.js resolving end ---
no command for selector: noop:
Unable to start subprocess for LSP-copilot
Traceback (most recent call last):
  File "/Users/pioz/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/windows.py", line 257, in start_async
    if plugin_class.needs_update_or_installation():
  File "/Users/pioz/Library/Application Support/Sublime Text/Lib/python38/lsp_utils/_client_handler/abstract_plugin.py", line 101, in needs_update_or_installation
    server = cls.get_server()
  File "/Users/pioz/Library/Application Support/Sublime Text/Lib/python38/lsp_utils/npm_client_handler.py", line 122, in get_server
    cls.__server = ServerNpmResource.create({
  File "/Users/pioz/Library/Application Support/Sublime Text/Lib/python38/lsp_utils/server_npm_resource.py", line 49, in create
    raise Exception('Failed resolving Node.js Runtime. Please see Sublime Text console for more information.')
Exception: Failed resolving Node.js Runtime. Please see Sublime Text console for more information.

Can you help me to install Copilot on my Sublime Editor?

jfcherng commented 4 hours ago

I believe this is a duplicate of https://github.com/TerminalFi/LSP-copilot/issues/133. Anyway, not really related to LSP-copilot.

It seems that you are not using NVM. But the key is always the same, make node foundable via PATH. See https://lsp.sublimetext.io/troubleshooting/#updating-the-path-used-by-lsp-servers

pioz commented 4 hours ago

I've modify my LSP.sublime-settings with this:

{
  "clients": {
    "copilot": {
      "enabled": true,
      "command": [
        "/Users/pioz/.local/share/mise/installs/node/lts/bin/node",
        "${server_path}",
        "--stdio"
      ],
      "env": {
        "PATH": "/Users/pioz/.local/share/mise/installs/node/lts/bin:$PATH"
      }
    }
  }
}

But I still have the same problem. Please help!

pioz commented 4 hours ago

Ok, adding in lsp_utils.sublime-settings, "nodejs_runtime": ["local"] the Troubleshooting exit with code 0 🤟🏻

But now if I open the command palette and type "Copilot: Sign In" I do not see any available option.

jfcherng commented 4 hours ago

I believe somewhere should emit an error, such as ST console. If not you should see "LSP-copilot" in the status bar. If not, you probably (but unlikely) not have a file opened.