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

lsp-ccls has exited (exited abnormally with code 40) #10

Closed
kenkangxgwe opened this issue Aug 30, 2018 · 5 comments
Closed

lsp-ccls has exited (exited abnormally with code 40) #10

kenkangxgwe opened this issue Aug 30, 2018 · 5 comments

Comments

@kenkangxgwe
Copy link

kenkangxgwe commented Aug 30, 2018

Hi again, I finally compiled ccls with GCC, and try to use emacs-ccls to start the server. But after I opened a C project, it complained that

lsp-ccls has exited (exited abnormally with code 40)
Error during redisplay: (eval (lsp-mode-line)) signaled (wrong-type-argument lsp--workspace nil) [5 times]

I already have the compile_commands.json and .ccls-root in my dir. What might be the problem?

@MaskRay
Copy link
Member

MaskRay commented Sep 9, 2018

Do you mean Windows + MSYS2-MinGW64 GCC8 + MSYS2 clang/llvm ?

Suppose your build directory is ccls/Release. Run ccls/Release/ccls -help in a shell and see if it exits normally.

@kenkangxgwe
Copy link
Author

kenkangxgwe commented Sep 9, 2018

Yes, it is Windows + MSYS2-MinGW64 GCC 8.2.0 + MSYS2 clang/llvm 6.0.1.
It does exit without any error. It gives me:

PS D:\Projects\ccls\release> .\ccls.exe -help
OVERVIEW: C/C++/Objective-C language server

See more on https://github.com/MaskRay/ccls/wiki
USAGE: ccls.exe [options] extra

OPTIONS:

General options:

  -h                          - Alias for -help
  -init=<string>              - extra initialization options
  -log-file=<filename>        - log
  -log-file-append=<filename> - log
  -test-index=<string>        - run index tests
  -v=<int>                    - verbosity

Generic Options:

  -help                       - Display available options (-help-hidden for more)
  -help-list                  - Display list of available options (-help-list-hidden for more)
  -version                    - Display the version of this program

@MaskRay
Copy link
Member

MaskRay commented Sep 10, 2018

Make sure to use the correct -DLLVM_ENABLE_RTTI=on (or off) option.

See recommended configure options for various systems here https://github.com/MaskRay/ccls/wiki/Getting-started

Once you get Windows build working, could you please put some instructions there?

@kenkangxgwe
Copy link
Author

kenkangxgwe commented Sep 10, 2018

Ok, I will try.


Update:
I finally manage to enable the ccls server by replacing every \\ in the compile_commands.json to /.
Is it able to support \\ as the seperator of path?

@MaskRay
Copy link
Member

MaskRay commented Sep 10, 2018

This might be some Windows path normalization issue that @Riatre knows about.

LSP uses file:// style path names. So although JSONCompilationDatabase::getCompileCommands returns \-style (llvm::sys::path::native) paths, it might be better to change that back to /.

https://github.com/llvm-mirror/clang/tree/master/lib/Tooling/JSONCompilationDatabase.cpp#L220
https://github.com/llvm-mirror/llvm/tree/master/lib/Support/Path.cpp#L557

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

No branches or pull requests

2 participants