emacs-lsp / emacs-ccls

Emacs client for ccls, a C/C++ language server
200 stars 29 forks source link

Add library folders #53

Closed rislah closed 5 years ago

rislah commented 5 years ago

It considers files in these folders as part of the active lsp workspace. Right now if you do "lsp-find-definition" and it goes to a header file in system include path, then you cant use "lsp-find-definition" in that file as lsp isnt working there. This fixes it

MaskRay commented 5 years ago

If you jump to a /usr/include file with lsp-find-definition, that file will be associated with the current workspace. Opening a file under /usr/include directly will not associate the workspace. Have you tried having two projects (with two language servers)? What will this change do?

rislah commented 5 years ago

If you jump to a /usr/include file with lsp-find-definition, that file will be associated with the current workspace. Opening a file under /usr/include directly will not associate the workspace.

Yes

Have you tried having two projects (with two language servers)? What will this change do?

-[-] ccls:19972
    |-[-] Buffers
    |  |-[+] stdio.h
    |  |-[+] clone.h
    |  -[+] bh.c
    -[+] Capabilities
-[-] ccls:20016
    |-[-] Buffers
    |  -[+] main.c
    -[+] Capabilities

The changed code is part of the lsp clients that come with lsp-mode by default. I just noticed its not implemented for ccls

MaskRay commented 5 years ago

See https://github.com/emacs-lsp/lsp-mode/pull/474

I'd like to keep the current behavior.

MaskRay commented 5 years ago

Jumping outside the work folders works correctly, but we can revisit this in the future. Closing.