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

How can I modify the clangd.lua to make it support C++ 20? #1144

Closed
shaojunjie0912 opened this issue Jan 10, 2024 · 3 comments
Closed

How can I modify the clangd.lua to make it support C++ 20? #1144

shaojunjie0912 opened this issue Jan 10, 2024 · 3 comments
Labels
clangd Clangd(lsp) related issues educational Issues that contain useful content lsp LSP related issues usage User-specific issues

Comments

@shaojunjie0912
Copy link

Hi, I have some problems with modifying the clangd.lua to make it support C++ 20.

Snipaste_2024-01-10_16-03-25

How can I modify this?

@shaojunjie0912 shaojunjie0912 changed the title How should I modify the clangd.lua to make it support C++ 20? How can I modify the clangd.lua to make it support C++ 20? Jan 10, 2024
@Jint-lzxy
Copy link
Collaborator

afaik clangd doesn't support setting driver options thru command line options atm. But u can create a user or project config (see clangd:Configuration#files) and fill in the following content to make it work:

CompileFlags:
  Add: [-std=c++20] # or -std=gnu++20

Do note that support for c++20 by many open-source LSP vendors, including clangd, is still in the alpha stage, and many features that require compiler support have not (yet) been implemented. You may encounter a bunch of errors and it's expected, see my reply here.

@Jint-lzxy Jint-lzxy added lsp LSP related issues usage User-specific issues clangd Clangd(lsp) related issues labels Jan 10, 2024
@shaojunjie0912
Copy link
Author

Thank you! @Jint-lzxy
I will have a try.

@shaojunjie0912
Copy link
Author

It works!
Thanks a lot.

@CharlesChiuGit CharlesChiuGit added the educational Issues that contain useful content label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clangd Clangd(lsp) related issues educational Issues that contain useful content lsp LSP related issues usage User-specific issues
Projects
None yet
Development

No branches or pull requests

3 participants