Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copilot cannot be turned off #4679

Open
3 tasks done
szykes opened this issue Jan 10, 2025 · 4 comments
Open
3 tasks done

Copilot cannot be turned off #4679

szykes opened this issue Jan 10, 2025 · 4 comments
Labels

Comments

@szykes
Copy link

szykes commented Jan 10, 2025

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

I am not allowed to use copilot at my company, so I have set lsp-copilot-enabled to nil in customize-variable.

The lsp-copilot wants to install copilot-ls despite the config.

If I let it install the copilot-ls, it will ask for login.

Steps to reproduce

Set the lsp-copilot-enabled to nil
Open a file that triggers the copilot in lsp

Expected behavior

My expectation was that the disabled lsp-copilot does not want to either install the binary or ask for logging.

Which Language Server did you use?

lsp-copilot

OS

MacOS

Error callstack

No response

Anything else?

No response

@szykes szykes added the bug label Jan 10, 2025
@kassick
Copy link
Contributor

kassick commented Jan 10, 2025

Set the lsp-copilot-enabled to nil

See here for options on how to disable the server. There is a PR forcing copilot-ls to obey lsp-copilot-enabled. Meanwhile, (setq lsp-copilot-applicable-fn (lambda (&rest _) nil)) should do the trick.

@kassick
Copy link
Contributor

kassick commented Jan 10, 2025

The lsp-copilot wants to install copilot-ls despite the config.

I could not reproduce this in my setup. I have:

  1. removed ~/.emacs.d/.cache/lsp/npm/copilot-node-server
  2. started a new emacs process
  3. opened a python file

lsp starts pyright and ruff servers, and does not ask me to install copilot.

When exactly did lsp asked to install copilot-ls?

@szykes
Copy link
Author

szykes commented Jan 10, 2025

When exactly did lsp asked to install copilot-ls?

I have not realised the issue is conditioned and it occurred easily in my setup. Sorry for that.

The setup should rely only on (custom-set-variables '(lsp-copilot-enabled nil)) to disable lsp-copilot.

If I remove the bash-ls at ~/.emacs.d/.cache/lsp/npm/, and I open a .sh file, this will pop up:

2    Unable to find installed server supporting this file. The following servers could be installed automatically:
copilot-ls
bash-ls

If the bash-ls is installed, it will not ask for installing copilot-ls.

It is important to open a file that has not been opened before, or the buffer was killed.

So, probably some python related bins should be deleted in your case.

@kassick
Copy link
Contributor

kassick commented Jan 10, 2025

Ah, I see! I did not know that lsp-mode offered to download servers for clients marked as add-on! That's unfortunate in copilot case, specially with the disable flag still not working as expected.

Once the flag is fixed, maybe we could make copilot-ls handle C-g during the setup prompt to inform the user about the flag -- or even update customize.el to add the disabled flag ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants