summaryrefslogtreecommitdiff
path: root/clang-tools-extra/clangd/TidyProvider.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Initialize clang-tidy modules only onceKadir Cetinkaya2023-05-101-2/+10
| | | | | | | | | This is showing up on our profiles with ~100ms contribution @95th% for buildAST latencies. The patch is unlikely to address it all, but should help with some low-hanging fruit. Differential Revision: https://reviews.llvm.org/D150257
* [clangd] Disable modernize-macro-to-enum tidy checkKadir Cetinkaya2023-01-171-1/+1
| | | | | Check relies on seeing PP-directives from preamble, hence it's unusable. See https://github.com/clangd/clangd/issues/1464.
* [clang-tools-extra] Use std::optional instead of llvm::Optional (NFC)Kazu Hirata2023-01-021-1/+1
| | | | | | | This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
* [YAML] Convert Optional to std::optionalKrzysztof Parzyszek2022-12-061-5/+5
|
* Process: convert Optional to std::optionalKrzysztof Parzyszek2022-12-061-3/+4
| | | | This applies to GetEnv and FindInEnvPath.
* [clangd] Block clang-tidy misc-const-correctness checkSam McCall2022-10-131-2/+8
| | | | | | | | | | | This check performs an extremely large amount of work (for each variable, it runs very many full matcher-driven traversals of the whole scope the variable is defined in). When (inadvertently) enabled for Fuchsia, it regressed BuildAST times by >10x (400ms -> 7s on my machine). Differential Revision: https://reviews.llvm.org/D135829
* [clang-tools-extra] Use value_or instead of getValueOr (NFC)Kazu Hirata2022-06-191-1/+1
|
* [clangd] Clean up unused includes. NFCISam McCall2022-02-261-2/+0
| | | | | | Add includes where needed to fix build. Haven't systematically added used headers, so there is still accidental dependency on transitive includes.
* [clangd] Disable hicpp-invalid-access-moved inside clangdKadir Cetinkaya2021-11-251-1/+3
|
* [clangd] Expose absoluteParent helperKadir Cetinkaya2021-02-191-13/+3
| | | | | | | | Will be used in other components that need ancestor traversal. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D96123
* [clangd] Fix clang tidy provider when multiple config files exist in ↵Nathan James2021-02-121-1/+1
| | | | | | | | | | | directory tree Currently Clang tidy provider searches from the root directory up to the target directory, this is the opposite of how clang-tidy searches for config files. The result of this is .clang-tidy files are ignored in any subdirectory of a directory containing a .clang-tidy file. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D96204
* [clangd] Parse Diagnostics block, and nest ClangTidy block under it.Sam McCall2021-01-281-1/+1
| | | | | | | (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
* [clangd] Fix windows path handling in .clang-tidy parsingSam McCall2020-12-191-3/+8
|
* [clangd] Print .clang-tidy configuration parsing errors using [ev]?log.Nathan James2020-12-181-2/+20
| | | | | | | | | Currently warnings when parsing .clang-tidy are printed directly to errs. This is less than ideal as there is no synchronisation printing to errs, leading to potential races. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D93436
* [clangd] Validate clang-tidy Checks in clangd config.Nathan James2020-12-151-0/+23
| | | | | | | | | | | Add instrumentation in ConfigCompile to validate that items in ClangTidy:[Add|Remove] correspond to actual clang-tidy checks. If they don't a warning will be presented to the user. This is especially useful for catching typos in the glob items. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D92874
* [clang-tidy] Use a MemoryBufferRef when parsing configuration files.Nathan James2020-12-101-1/+2
| | | | | | | | Using a MemoryBufferRef, If there is an error parsing, we can point the user to the location of the file. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D93024
* [clangd] NFC: Use SmallVector<T> where possibleKirill Bobyrev2020-12-101-2/+2
| | | | | | | | SmallVector<T> with default size is now the recommended version (D92522). Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D92788
* [clangd] Cache .clang-tidy files again.Sam McCall2020-11-291-72/+104
| | | | | | | | | | | | | | This cache went away in 73fdd998701cce3aa6c4d8d2a73ab97351a0313b This time, the cache is periodically validated against disk, so config is still mostly "live". The per-file cache reuses FileCache, but the tree-of-file-caches is duplicated from ConfigProvider. .clangd, .clang-tidy, .clang-format, and compile_commands.json all have this pattern, we should extract it at some point. TODO for now though. Differential Revision: https://reviews.llvm.org/D92133
* [clangd] Implement clang-tidy options from configNathan James2020-11-251-0/+237
Added some new ClangTidyOptionsProvider like classes designed for clangd work flow. These providers are designed to source the options on the worker thread but in a thread safe manner. This is done through making the options getter take a pointer to the filesystem used by the worker thread which natuarally is from a ThreadsafeFS. Internal caching in the providers is also guarded. The providers don't inherit from `ClangTidyOptionsProvider` instead they share a base class which is able to create a provider for the `ClangTidyContext` using a specific FileSystem. This approach means one provider can be used for multiple contexts even though `ClangTidyContext` owns its provider. Depends on D90531 Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D91029