TerminalFi / LSP-copilot

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

Not working at all? #93

Open marimeireles opened 1 year ago

marimeireles commented 1 year ago

I can only access the settings of the addon, nothing else works for me. The login command doesn't do anything to me. Not sure how to check my version but I've just downloaded it. I'm running it on an osx. Cheers!

jfcherng commented 1 year ago

The login command doesn't do anything to me.

What does this mean? You can see the sign-in command, you execute it and nothing happen?


Update:

For people who are still suffering here, providing the output of following steps may help people to help you.

  1. After open a real file on your filesystem, is there LSP-copilot at the bottom-left of the ST window?
  2. What's the output of Copilot: Check Status from the command palette?
  3. What's the output of LSP: Troubleshoot Server from the command palette?
  4. Is there any error message in ST's console? (Ctrl+`)
neverbot commented 1 year ago

I can only access the settings of the addon, nothing else works for me.

The same happened to me, I tried to reinstall the addon, and nothing. The only command available was Preferences: LSP-copilot settings.

I restarted again Sublime Text and the plugin worked again and all the commands were available.

Cannot provide any more information of why that happened, but is solvable.

jfcherng commented 1 year ago

Both steps are written in the readme: Restart ST, open a file.

neverbot commented 1 year ago

Both steps are written in the readme: Restart ST, open a file.

In my case was not on first use after installing the plugin, this problem appeared after a week of use... suddenly most of the sublime text commands were not present (cmd+p, write "copilot", only the settings command appeared).

(I wrote my comment just in case any other people found the issue, to let them know is solvable)

marimeireles commented 1 year ago

I see, thanks for chiming in @neverbot, I'll try again. I've restarted sublime and it didn't work. Same as @neverbot described.

sebaacuna commented 1 year ago

Installed via Cmd+Shift+P Install Packages. After install, restarted Sublime. After restart, Cmd+Shift+P and when searching with "copilot" only "Preferences: LSP-copilot Settings" comes up. "Copilot: Sign In" does NOT show up in the list.

This is my first install of LSP-Copilot, I had not installed it previously.

Hope this helps.

jfcherng commented 1 year ago

If you see the readme, the first step is OPEN A FILE. NOT searching with "copilot". You have to make sure the plugin is activated (so open a file). There will be "LSP-copilot" on the status bar.

Another potential issue, since you didn't mention, the LSP plugin is a must too.

mobweb commented 1 year ago

Also worth noting that it may only work when a file of a certain type is opened. Personally I had to have a PHP file open, other file types (don't remember which ones, might've been TXT) did not cause the expected command to appear.

jfcherng commented 1 year ago

LSP-copilot should work on all files, literally. But there can be some weird situations that the server is not activated. If it's activated for the current view (file), there will be LSP-copilot at the bottom-left of the ST window.

bwalkernz commented 1 year ago

After installation, restarting and opening a file, I can see "co pilot not signed in" in the status bar when I first open a file. But then I cannot find "Copilot: Sign In" in the command palette?? It then changes to "LSP-copilot" in the status bar. Screen Shot 2023-03-24 at 2 24 36 PM

TerminalFi commented 1 year ago

After installation, restarting and opening a file, I can see "co pilot not signed in" in the status bar when I first open a file. But then I cannot find "Copilot: Sign In" in the command palette?? It then changes to "LSP-copilot" in the status bar.

Screen Shot 2023-03-24 at 2 24 36 PM

Is there a LSP: Check Status ?

bwalkernz commented 1 year ago

After installation, restarting and opening a file, I can see "co pilot not signed in" in the status bar when I first open a file. But then I cannot find "Copilot: Sign In" in the command palette?? It then changes to "LSP-copilot" in the status bar. Screen Shot 2023-03-24 at 2 24 36 PM

Is there a LSP: Check Status ?

No

jfcherng commented 1 year ago

Fwiw, it's Copilot: Check Status.

bwalkernz commented 1 year ago

Copilot: Check Status

this is not there either.

jfcherng commented 1 year ago

Having no idea what's happening as I don't think that's possible.

jfcherng commented 1 year ago

Can you run LSP: Troubleshoot Server and select LSP-copilot?

bwalkernz commented 1 year ago

LSP: Troubleshoot Server

Yes that worked

Troubleshooting: LSP-copilot

Version

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

Active view

Project / Workspace

LSP configuration

## System PATH - /opt/homebrew/bin - /opt/homebrew/sbin - /usr/local/bin - /usr/bin - /bin - /usr/sbin - /sbin - /Library/Apple/usr/bin
jfcherng commented 1 year ago

Is there any error message in ST's console? (ctrl+ `)

bwalkernz commented 1 year ago

Is there any error message in ST's console? (ctrl+ `)

git: using configuration from system git install git: tracking working dir /Users/pod71/sites/te-kaha-2022 ❌ Copilot has NOT been signed in. Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/LSP/LSP.sublime-settings Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/User/LSP.sublime-settings ❌ Copilot has NOT been signed in. Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/LSP-copilot/LSP-copilot.sublime-settings Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/User/LSP-copilot.sublime-settings ❌ Copilot has NOT been signed in. Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/LSP-copilot/LSP-copilot.sublime-settings Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/User/LSP-copilot.sublime-settings ❌ Copilot has NOT been signed in. Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/Package Control/Package Control.sublime-settings ❌ Copilot has NOT been signed in. no command for selector: noop: no command for selector: noop:

jfcherng commented 1 year ago
Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/LSP-copilot/LSP-copilot.sublime-settings
Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/User/LSP-copilot.sublime-settings

Does these happen even if you restart ST?

bwalkernz commented 1 year ago
Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/LSP-copilot/LSP-copilot.sublime-settings
Unable to open /Users/pod71/Library/Application Support/Sublime Text 3/Packages/User/LSP-copilot.sublime-settings

Does these happen even if you restart ST?

I get these

plugins loaded Failed to register plugin "LSP-copilot-master" Traceback (most recent call last): File "/Users/pod71/Library/Application Support/Sublime Text 3/Installed Packages/LSP.sublime-package/plugin/core/sessions.py", line 997, in _register_plugin_impl if client_configs.add_external_config(name, settings, base_file, notify_listener): File "/Users/pod71/Library/Application Support/Sublime Text 3/Installed Packages/LSP.sublime-package/plugin/core/settings.py", line 35, in add_external_config config = ClientConfig.from_sublime_settings(name, s, file) File "/Users/pod71/Library/Application Support/Sublime Text 3/Installed Packages/LSP.sublime-package/plugin/core/types.py", line 682, in from_sublime_settings base = sublime.decode_value(sublime.load_resource(file)) File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime.py", line 436, in load_resource raise IOError('resource "%s" not found' % name) OSError: resource "Packages/LSP-copilot-master/LSP-copilot-master.sublime-settings" not found

Failed to register plugin "LSP-copilot-master" Traceback (most recent call last): File "/Users/pod71/Library/Application Support/Sublime Text 3/Installed Packages/LSP.sublime-package/plugin/core/sessions.py", line 997, in _register_plugin_impl if client_configs.add_external_config(name, settings, base_file, notify_listener): File "/Users/pod71/Library/Application Support/Sublime Text 3/Installed Packages/LSP.sublime-package/plugin/core/settings.py", line 35, in add_external_config config = ClientConfig.from_sublime_settings(name, s, file) File "/Users/pod71/Library/Application Support/Sublime Text 3/Installed Packages/LSP.sublime-package/plugin/core/types.py", line 682, in from_sublime_settings base = sublime.decode_value(sublime.load_resource(file)) File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime.py", line 436, in load_resource raise IOError('resource "%s" not found' % name) OSError: resource "Packages/LSP-copilot-master/LSP-copilot-master.sublime-settings" not found

❌ Copilot has NOT been signed in. Package Control: No updated packages

jfcherng commented 1 year ago

Failed to register plugin "LSP-copilot-master"

So, it looks like you didn't installed this plugin with Package Control (?). But this is not the case in your previous report. I am confused by the situation now. Please remove Packages/LSP-copilot-master directory and restart ST.

bwalkernz commented 1 year ago

Failed to register plugin "LSP-copilot-master"

So, it looks like you didn't installed this plugin with Package Control (?). But this is not the case in your previous report. I am confused by the situation now. Please remove Packages/LSP-copilot-master directory and restart ST.

this worked thank you.

jfcherng commented 1 year ago

For people who are still suffering here, providing the output of following steps may help people to help you.

  1. After open a real file on your filesystem, is there LSP-copilot at the bottom-left of the ST window?
  2. What's the output of Copilot: Check Status from the command palette?
  3. What's the output of LSP: Troubleshoot Server from the command palette?
  4. Is there any error message in ST's console? (Ctrl+`)
tomohiro-sawada commented 1 year ago

Hello. I have the same issue.

  1. After open a real file on your filesystem, is there LSP-copilot at the bottom-left of the ST window? Yes, I get "LSP-copilot" at the bottom left of the screen when I open a php file.
Screenshot 2023-04-04 at 23 48 11
  1. What's the output of Copilot: Check Status from the command palette?

I get back "[LSP-copilot] You haven't signed in yet."

  1. What's the output of LSP: Troubleshoot Server from the command palette?

Troubleshooting: LSP-copilot

Version

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

Active view

Project / Workspace

LSP configuration

## System PATH - /Library/Frameworks/Python.framework/Versions/2.7/bin - /Library/Frameworks/Python.framework/Versions/3.9/bin - /Library/Frameworks/Python.framework/Versions/3.10/bin - /opt/local/bin - /opt/local/sbin - /usr/local/bin - /usr/bin - /bin - /usr/sbin - /sbin - /Library/TeX/texbin - /Library/Apple/usr/bin > 4. Is there any error message in ST's console? (Ctrl+`) Package Control: Skipping automatic upgrade, last run at 2023-04-04 23:17:47, next run at 2023-04-05 00:17:47 or after ignored packages updated to: ["LSP-copilot", "RichTextFormat", "Vintage"] unloading python 3.3 plugin LSP-copilot.boot reloading settings Packages/LSP-copilot/LSP-copilot.sublime-settings reloading settings Packages/LSP-copilot/LSP-copilot.sublime-settings reloading settings Packages/User/Package Control.sublime-settings reloading settings Packages/User/Preferences.sublime-settings error: Error trying to load settings: Settings must be a json object in Packages/LSP-copilot/LSP-copilot.sublime-settings Package Control: The package LSP-copilot has been removed reloading settings Packages/User/Package Control.sublime-settings Package Control: The orphaned dependency lsp_utils has been removed ignored packages updated to: ["0_package_control_loader", "LSP-copilot", "RichTextFormat", "Vintage"] unloading python 3.3 plugin 0_package_control_loader.00-package_control unloading python 3.3 plugin 0_package_control_loader.01-pygments unloading python 3.3 plugin 0_package_control_loader.01-sublime_lib unloading python 3.3 plugin 0_package_control_loader.10-lsp_utils unloading python 3.3 plugin 0_package_control_loader.50-backrefs unloading python 3.3 plugin 0_package_control_loader.50-bracex unloading python 3.3 plugin 0_package_control_loader.50-markupsafe unloading python 3.3 plugin 0_package_control_loader.50-pathlib unloading python 3.3 plugin 0_package_control_loader.50-python-markdown unloading python 3.3 plugin 0_package_control_loader.50-pyyaml unloading python 3.3 plugin 0_package_control_loader.51-python-jinja2 unloading python 3.3 plugin 0_package_control_loader.55-mdpopups unloading python 3.3 plugin 0_package_control_loader.55-wcmatch Package Control: The orphaned dependency sublime_lib has been removed reloading settings Packages/User/Package Control.sublime-settings reloading settings Packages/User/Preferences.sublime-settings reloading settings Packages/User/Package Control.sublime-settings reloading settings Packages/User/Preferences.sublime-settings ignored packages updated to: ["0_package_control_loader", "RichTextFormat", "Vintage"] reloading settings Packages/User/Package Control.sublime-settings reloading settings Packages/User/Preferences.sublime-settings generating syntax summary reloading settings Packages/User/Preferences.sublime-settings ignored packages updated to: ["RichTextFormat", "Vintage"] reloading python 3.3 plugin 0_package_control_loader.00-package_control reloading python 3.3 plugin 0_package_control_loader.01-pygments reloading python 3.3 plugin 0_package_control_loader.50-backrefs reloading python 3.3 plugin 0_package_control_loader.50-bracex reloading python 3.3 plugin 0_package_control_loader.50-markupsafe reloading python 3.3 plugin 0_package_control_loader.50-pathlib reloading python 3.3 plugin 0_package_control_loader.50-python-markdown reloading python 3.3 plugin 0_package_control_loader.50-pyyaml reloading python 3.3 plugin 0_package_control_loader.51-python-jinja2 reloading python 3.3 plugin 0_package_control_loader.55-mdpopups reloading python 3.3 plugin 0_package_control_loader.55-wcmatch reloading settings Packages/User/Package Control.sublime-settings reloading settings Packages/User/Preferences.sublime-settings reloading settings Packages/User/Preferences.sublime-settings ignored packages updated to: ["LSP-copilot", "RichTextFormat", "Vintage"] reloading settings Packages/User/Package Control.sublime-settings reloading settings Packages/User/Preferences.sublime-settings Package Control: The dependency 'lsp_utils' is not currently installed; installing... Package Control: The dependency 'lsp_utils' has successfully been installed or updated Package Control: The dependency 'sublime_lib' is not currently installed; installing... Package Control: The dependency 'sublime_lib' has successfully been installed or updated reloading settings Packages/User/Package Control.sublime-settings generating syntax summary ignored packages updated to: ["RichTextFormat", "Vintage"] reloading settings Packages/User/Package Control.sublime-settings reloading settings Packages/User/Preferences.sublime-settings reloading settings Packages/LSP-copilot/LSP-copilot.sublime-settings reloading python 3.3 plugin LSP-copilot.boot reloading settings Packages/User/Preferences.sublime-settings [lsp_utils] START output of command: "ci --omit=dev --scripts-prepend-node-path=true --verbose" npm verb cli /usr/local/bin/node /usr/local/bin/npm npm info using npm@9.5.1 npm info using node@v16.13.1 npm verb title npm ci npm verb argv "ci" "--omit" "dev" "--scripts-prepend-node-path" "true" "--loglevel" "verbose" npm verb logfile logs-max:10 dir:/Users/tomohirosawada/.npm/_logs/2023-04-05T04_02_13_900Z- npm verb logfile /Users/tomohirosawada/.npm/_logs/2023-04-05T04_02_13_900Z-debug-0.log npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 351ms npm http fetch GET 200 https://registry.npmjs.org/npm 439ms (cache updated) added 1 package, and audited 2 packages in 608ms found 0 vulnerabilities npm notice npm notice New minor version of npm available! 9.5.1 -> 9.6.3 npm notice Changelog: npm notice Run `npm install -g npm@9.6.3` to update! npm notice npm verb exit 0 npm info ok [lsp_utils] Command output END ❌ Copilot has NOT been signed in.
jfcherng commented 1 year ago

Hi @tomohiro-sawada , do you mean there is no Copilot: Sign In in the command palette for you? It looks like your LSP-copilot is just updated. Did you try to restart ST?

tomohiro-sawada commented 1 year ago

That's not it. I have Copilot: Sign In in the command palette when I open a .php file, and a login window pops up in my browser. However, even if I fill out the confirmation code, Sublime Text still says that I am not logged in.

On Wed, Apr 5, 2023 at 12:47 AM Jack Cherng @.***> wrote:

Hi @tomohiro-sawada https://github.com/tomohiro-sawada , do you mean there is no Copilot: Sign In in the command palette for you?

— Reply to this email directly, view it on GitHub https://github.com/TerminalFi/LSP-copilot/issues/93#issuecomment-1496911455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYT3JHWXZDGCGZR3YDZWQVTW7T2MTANCNFSM6AAAAAAV34T6N4 . You are receiving this because you were mentioned.Message ID: @.***>

jfcherng commented 1 year ago

After you fill out the confirmation code and back to ST to "Press OK when completed.", there should be another popup message box. What does it say?

tomohiro-sawada commented 1 year ago

I don't get a popup message box in Sublime Text after I press ok.

Screenshot 2023-04-05 at 13 43 58 Screenshot 2023-04-05 at 13 44 05 Screenshot 2023-04-05 at 13 44 12 Screenshot 2023-04-05 at 13 44 22 Screenshot 2023-04-05 at 13 44 22 Screenshot 2023-04-05 at 13 44 54

On Wed, Apr 5, 2023 at 1:36 AM Jack Cherng @.***> wrote:

After you fill out the confirmation code and back to ST to "Press OK when completed.", there should be another popup message box. What it says?

— Reply to this email directly, view it on GitHub https://github.com/TerminalFi/LSP-copilot/issues/93#issuecomment-1496942520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYT3JHUEB6IAR2CCTWM665DW7UAFXANCNFSM6AAAAAAV34T6N4 . You are receiving this because you were mentioned.Message ID: @.***>

jfcherng commented 1 year ago

I don't get a popup message box in Sublime Text after I press ok.

If so, any error in the console or LSP's log panel?

jfcherng commented 1 year ago

OK. So this is it, it failed to write into image

tomohiro-sawada commented 1 year ago

That's right. I don't know how to fix this though. hosts.json exists in that directory.

tomohiro-sawada commented 1 year ago

OK. So this is it, it failed to write into image

I just get back "❌ Copilot has NOT been signed in."

Screenshot 2023-04-05 at 13 51 40
jfcherng commented 1 year ago

Check the permission for sure. Or just chmod u+rw on that file. Or maybe something in the upper-level folder's permission gets wrong. Or maybe the file owner is wrong.

tomohiro-sawada commented 1 year ago

Check the permission for sure. Or just chmod u+rw on that file. Or maybe something in the upper-level folder's permission gets wrong. Or maybe the file owner is wrong.

Yes! That did the trick! Thank you very much!

shjohnson commented 1 year ago

Just wanted to add that i had a lot of the above problems and was only opening a file straight from terminal and wasnt working. I had to open a file through sublime (as mentioned i know 😞 ) to get things working in case someone else has this issue.

MillhioreBT commented 1 year ago

It had been a while since I last checked the repository since the time I asked if Copilot for ST existed. I have been experiencing this issue occasionally and it is very annoying, so I came to check if anyone else was experiencing it and yes, I can see that some are.

I suppose this is more related to LSP, although it's strange that LSP-lua doesn't have this issue...

jfcherng commented 1 year ago

Unfortunately, I just kind of never have this issue. On my side, it just works... no matter project is used or not, single file or not.

And saying not working is not helping. At least run troubleshooting and provide the result here.

MillhioreBT commented 1 year ago

Unfortunately, I just kind of never have this issue. On my side, it just works... no matter project is used or not, single file or not.

And saying not working is not helping. At least run troubleshooting and provide the result here.

I don't understand why it's happening but I'm 100% sure it's not this plugin, I checked the code and everything is fine. I did the tests you mentioned out of curiosity and everything is fine. This problem is probably something occasional with slow or intermittent internet connections.

You just need to restart ST and that's it.

If I find more information and discover something relevant, I will be happy to come back here and notify you. The idea is to always keep this add-on that I love so much as up-to-date as possible.

chustedde commented 1 year ago

I had issues similar to the ones above, where Copilot: Check Status wasn't showing up for me in the Command Palette after restarting ST4 and opening a real file.

In my case, I saw errors in the console when using the commands Preferences: LSP Settings and Preferences: Lsp-copilot Settings .

In both cases, ST4 was unable to find the settings files. Steps to resolve:

jfcherng commented 1 year ago
  • Created folders LSP and LSP-Copilot under C:\Users\<username>\AppData\Roaming\Sublime Text\Packages
  • Saved the files that came up for the general settings in the respective folders
  • Saved the files that came up for user settings under C:\Users\<username>\AppData\Roaming\Sublime Text\Packages\User

We recommend people installing this Package with Package Control.

chustedde commented 1 year ago
  • Created folders LSP and LSP-Copilot under C:\Users\<username>\AppData\Roaming\Sublime Text\Packages
  • Saved the files that came up for the general settings in the respective folders
  • Saved the files that came up for user settings under C:\Users\<username>\AppData\Roaming\Sublime Text\Packages\User

We recommend people installing this Package with Package Control.

I installed via Package Control and still ran into this issue.

jfcherng commented 1 year ago

I installed via Package Control and still ran into this issue.

See https://github.com/TerminalFi/LSP-copilot/issues/93#issuecomment-1470131102

chustedde commented 1 year ago

I installed via Package Control and still ran into this issue.

See #93 (comment)

Yes, that's actually the comment that helped me! I commented with the steps to resolve my situation, in case it helps others with similar issues with ST4 on Win11 who see this. I'm able to use the plugin now, I was just trying to potentially help others who also come across this issue, and document a case that was slightly different from others above.

cqc-alec commented 5 months ago

Had the same issue. Solved by restarting Sublime Text a second time. (I had already restarted it once as per the instructions.) There was also an LSP update at the same time; maybe that had something to do with it.