Commit Graph

13 Commits

Author SHA1 Message Date
Sam McCall c3df9d58c7 [clangd] Parse Diagnostics block, and nest ClangTidy block under it.
(ClangTidy configuration block hasn't been in any release, so we should be OK
to move it around like this)

Differential Revision: https://reviews.llvm.org/D95362
2021-01-28 01:36:23 +01:00
Sam McCall 118c33ef47 [clangd] Allow configuration database to be specified in config.
This allows for more flexibility than -compile-commands-dir or ancestor
discovery.

See https://github.com/clangd/clangd/issues/116

Differential Revision: https://reviews.llvm.org/D95057
2021-01-25 23:15:48 +01:00
Sam McCall 7e506b30a1 [clangd] Allow diagnostics to be suppressed with configuration
This has been specifically requested:
  https://github.com/clangd/vscode-clangd/issues/114
and various issues can be addressed with this as a workaround, e.g.:
  https://github.com/clangd/clangd/issues/662

Differential Revision: https://reviews.llvm.org/D95349
2021-01-25 15:59:07 +01:00
Kadir Cetinkaya 067ffbfe60
[clangd] Introduce ProjectAwareIndex
An index implementation that can dispatch to a variety of indexes
depending on the file path. Enables clangd to work with multiple indexes in the
same instance, configured via config files.

Depends on D90749, D90746

Differential Revision: https://reviews.llvm.org/D90750
2020-11-22 20:59:37 +01:00
Kadir Cetinkaya c9776c8d4e
[clangd] Introduce config compilation for External blocks
Compilation logic for External blocks. A few of the high level points:
- Requires exactly one-of File/Server at a time:
  - Server is ignored in case of both, with a warning.
  - Having none is an error, would render ExternalBlock void.
- Ensures mountpoint is an absolute path:
  - Interprets it as relative to FragmentDirectory.
  - Defaults to FragmentDirectory when empty.
- Marks Background as Skip.

Depends on D90748.

Differential Revision: https://reviews.llvm.org/D90749
2020-11-22 20:59:37 +01:00
Nathan James 20b69af7c9
[clangd] Add clang-tidy options to config
First step of implementing clang-tidy configuration into clangd config.
This is just adding support for reading and verifying the clang tidy options from the config fragments.
No support is added for actually using the options within clang-tidy yet.

That will be added in a follow up as its a little more involved.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D90531
2020-11-22 10:04:01 +00:00
Adam Czachorowski c894bfd1f5 [clangd] Add option for disabling AddUsing tweak on some namespaces.
For style guides forbid "using" declarations for namespaces like "std".
With this new config option, AddUsing can be selectively disabled on
those.

Differential Revision: https://reviews.llvm.org/D87775
2020-09-18 16:46:09 +02:00
Sam McCall dbf486c0de [clangd] Config: Index.Background
Summary:
We only support Build/Skip for now, but with 'Load' or similar as an
option for future (load existing shards but don't build new ones).

This requires creating the config for each TU on startup. In LLVM, this
is 4000 occurrences for a total of 800ms on my machine.
But together with caching from D83755 it is only 25ms.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83768
2020-07-14 19:04:11 +02:00
Sam McCall 9d3e9a3e3c [clangd] Remove const_cast. NFC 2020-07-13 20:44:11 +02:00
Sam McCall 1f14287eab [clangd] config() -> Config::current to avoid confict with NS 2020-06-29 23:05:19 +02:00
Sam McCall c5a6ee16f2 Reland [clangd] Config: config struct propagated through Context
This reverts commit a3684dfc45.
2020-06-29 21:49:25 +02:00
Sam McCall a3684dfc45 Revert "[clangd] Config: config struct propagated through Context"
This reverts commit 9963d93b07.

Fails on mac/win:
http://45.33.8.238/win/18704/step_9.txt
http://45.33.8.238/mac/16341/step_9.txt
2020-06-29 21:41:57 +02:00
Sam McCall 9963d93b07 [clangd] Config: config struct propagated through Context
Summary:
This introduces the "semantic form" of config exposed to features,
contrasted with the "syntactic form" exposed to users in e9fb1506b8.

The two are not connected, CompiledFragment and Provider will bridge that gap.
Nor is configuration actually set: that needs changes to ClangdServer,
TUScheduler, and BackgroundQueue.

Reviewers: hokein, kadircet

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82606
2020-06-29 20:18:48 +02:00