| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This allows us to limit the number of results we return and still allow them
to be surfaced by refining a query (D39852).
The initial algorithm is very conservative - it accepts a completion if the
filter is any case-insensitive sub-sequence. It does not attempt to rank items
based on match quality.
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39882
llvm-svn: 319552
|
|
|
|
| |
llvm-svn: 319497
|
|
|
|
| |
llvm-svn: 319496
|
|
|
|
| |
llvm-svn: 318961
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In-memory preambles will not be copied anymore, so we need to make
sure they outlive the AST.
Reviewers: bkramer, sammccall, klimek
Reviewed By: sammccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40301
llvm-svn: 318944
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
[clangd] Tracing improvements
Compose JSON using JSONExpr
Allow attaching metadata to spans (and avoid it if tracing is off)
Attach IDs and responses of JSON RPCs to their spans
The downside is that large responses make the trace viewer sluggish.
We should make our responses less huge :-) Or fix trace viewer.
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40132
llvm-svn: 318928
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This scale is much easier to mix with other signals, such as fuzzy match strength.
Mostly NFC, but it does reorder some low-priority items that get folded together at a score of 0 (see completion-qualifiers.test).
Removed the exact sortText from the testcases, because it's the ranking that we want to test.
Reviewers: hokein
Subscribers: ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D40089
llvm-svn: 318927
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: (There must be some reason why D38077 didn't just do this, but I don't get it!)
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39836
llvm-svn: 318925
|
|
|
|
| |
llvm-svn: 318544
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: klimek, bkramer, sammccall
Reviewed By: sammccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39843
llvm-svn: 318412
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
All results are scored, we only process CodeCompletionStrings for the winners.
We now return CompletionList rather than CompletionItem[] (both are valid).
sortText is now based on CodeCompletionResult::orderedName (mostly the same).
This is the first clangd-only completion option, so plumbing changed.
It requires a small clangd patch (exposing CodeCompletionResult::orderedName).
(This can't usefully be enabled yet: we don't support server-side filtering)
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39852
llvm-svn: 318287
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Make clangd handle "textDocument/rename" request. The rename
functionality comes from the "local-rename" sub-tool of clang-refactor.
Currently clangd only supports local rename (only symbol occurrences in
the main file will be renamed).
Reviewers: sammccall, ilya-biryukov
Reviewed By: sammccall
Subscribers: cfe-commits, ioeric, arphaman, mgorny
Differential Revision: https://reviews.llvm.org/D39676
llvm-svn: 317780
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is (probably) not required by LSP, but at least one buggy client wants it.
It also simplifies some tests - changed a few completion tests to use -pretty.
Reviewers: hokein, malaperle
Subscribers: ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D39738
llvm-svn: 317670
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When an inclusion is not processed as part of the preamble, its path is
not made into an absolute path as part of the precompiled header code
(adjustFilenameForRelocatableAST in ASTWriter.cpp). Because of this,
when we convert a Decl location to retrieve the file name with
FileEntry->getName(), it is possible for this path to be relative.
Instead, we should try to use tryGetRealPathName first which returns
an absolute path.
Fixes bug 35217.
Reviewers: sammccall, ilya-biryukov, rwols, Nebiroth
Reviewed By: sammccall
Subscribers: cfe-commits, ilya-biryukov
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D39705
llvm-svn: 317585
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This lets you visualize clangd's activity on different threads over time,
and understand critical paths of requests and object lifetimes.
The data produced can be visualized in Chrome (at chrome://tracing), or
in a standalone copy of catapult (http://github.com/catapult-project/catapult)
This patch consists of:
- a command line flag "-trace" that causes clangd to emit JSON trace data
- an API (in Trace.h) allowing clangd code to easily add events to the stream
- several initial uses of this API to capture JSON-RPC requests, builds, logs
Example result: https://photos.app.goo.gl/12L9swaz5REGQ1rm1
Caveats:
- JSON serialization is ad-hoc (isn't it everywhere?) so the API is
limited to naming events rather than attaching arbitrary metadata.
I'd like to fix this (I think we could use a JSON-object abstraction).
- The recording is very naive: events are written immediately by
locking a mutex. Contention on the mutex might disturb performance.
- For now it just traces instants or spans on the current thread.
There are other things that make sense to show (cross-thread flows,
non-thread resources such as ASTs). But we have to start somewhere.
Reviewers: ioeric, ilya-biryukov
Subscribers: cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D39086
llvm-svn: 317193
|
|
|
|
| |
llvm-svn: 317083
|
|
|
|
|
|
| |
No functionality change intended.
llvm-svn: 316832
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bkramer, krasimir, sammccall
Reviewed By: krasimir
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D38731
llvm-svn: 316327
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: rwols, malaperle, krasimir, bkramer, sammccall
Reviewed By: rwols, sammccall
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D38720
llvm-svn: 316311
|
|
|
|
|
|
|
| |
Previsouly, `std::future` that were results of
`std::async(std::launch::deferred, ...` were used.
llvm-svn: 315325
|
|
|
|
| |
llvm-svn: 315149
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Makes clangd respond to a client's "textDocument/signatureHelp" request by
presenting function/method overloads.
Patch by Raoul Wols.
Reviewers: bkramer, ilya-biryukov, krasimir
Reviewed By: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38048
llvm-svn: 315055
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Completion results look much nicer without them.
Informative qualifiers are stored for every method from a base class, even when
calling those methods does not require any qualifiers. For example,
struct Foo { int foo(); };
struct Bar : Foo { };
void test() { Bar(). // Completion item label was 'Foo::foo' before,
// but inserted text was simply 'foo'.
// We now simply show 'foo' in completion item label.
They effectively cluttered the completion list without providing much value.
Reviewers: bkramer, krasimir, rwols
Reviewed By: rwols
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D38083
llvm-svn: 314445
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bkramer, krasimir
Reviewed By: krasimir
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D38077
llvm-svn: 313759
|
|
|
|
| |
llvm-svn: 313749
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This fixes a bunch of logging-related FIXMEs.
Reviewers: bkramer, krasimir, malaperle
Reviewed By: malaperle
Subscribers: malaperle, klimek, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D37972
llvm-svn: 313730
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enhances CompletionItemsCollector in such a way that snippet
completions can be presented to the client. Enable snippet completion
items by specifying -enable-snippets while invoking the clangd
executable.
See: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#completion-request
See: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/browser/snippet.md
Patch by Raoul Wols.
llvm-svn: 313029
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Calling addDocument after removeDocument could have resulted in an
invalid program state (AST and Preamble for the valid document could
have been incorrectly removed).
This commit also includes an improved CppFile::cancelRebuild
implementation that allows to cancel reparse without waiting for
ongoing rebuild to finish.
Reviewers: krasimir, bkramer, klimek
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D36397
llvm-svn: 310818
|
|
|
|
| |
llvm-svn: 309801
|
|
|
|
|
|
|
| |
It turns out MSVC does not allow non-copyable classes in std::future
and std::promise template arguments.
llvm-svn: 309720
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: The new implementation allows code completion that never waits for AST.
Reviewers: bkramer, krasimir, klimek
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D36133
llvm-svn: 309696
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Current algorithm incorrectly provides completion results in a reverse order.
Reviewers: krasimir, bkramer
Reviewed By: krasimir
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D35950
llvm-svn: 309295
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously we always queried the compilation database and discarded the results
if the file was already opened.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D35825
llvm-svn: 308970
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This refactoring does not aim to introduce any significant changes to
the behaviour of clangd to keep the change as simple as possible.
Reviewers: klimek, krasimir, bkramer
Reviewed By: krasimir
Subscribers: malaperle, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D35406
llvm-svn: 308738
|
|
|
|
|
|
| |
There was an access to unitialized memory because it wasn't checked.
llvm-svn: 306705
|
|
|
|
|
|
|
|
| |
* Enforce 80 characters limit where appropriate
* Use slightly more descriptive names for searched locations
* Update docs to reflect D34269, which adds "Go To Declaration" functionality
llvm-svn: 306598
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This change allows to navigate to most identifiers' declarations in code. This is a first step towards implementing "Go to Definition". It reuses clangIndex in order to detect which occurrences corresponds to the position requested. The occurrences' Decls are then used to generate locations suitable for navigating to the declarations.
Reviewers: krasimir, bkramer, ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: cfe-commits, mgorny
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D34269
llvm-svn: 306558
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bkramer, krasimir, klimek
Reviewed By: klimek
Subscribers: klimek, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D34470
llvm-svn: 306530
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch adds the priority of a completion item to the sort text of the
returned LSP result.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D34137
llvm-svn: 305454
|
|
|
|
| |
llvm-svn: 305046
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch adds information about the parameters and return types of completion
candidates.
Previously, for the following code:
```
struct S {
int func(int a, double b) const;
};
```
the completer would only return the label of the candidate `func`.
Now it will also return the return type `int` and will format the label for the
candidate as `func(int a, double b) const`.
Reviewers: bkramer, ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D34033
llvm-svn: 304980
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Custom vfs::FileSystem is currently used for unit tests.
This revision depends on https://reviews.llvm.org/D33397.
Reviewers: bkramer, krasimir
Reviewed By: bkramer, krasimir
Subscribers: klimek, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D33416
llvm-svn: 303977
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
And implemented a helper function to dump an AST of a file for
testing/debugging purposes.
Reviewers: bkramer, krasimir
Reviewed By: krasimir
Subscribers: klimek, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D33415
llvm-svn: 303634
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This speeds up code completion. All the cool kids (ycmd) are doing it.
Reviewers: bkramer, ilya-biryukov
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33350
llvm-svn: 303547
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This commit restores r303067(reverted by r303094) and fixes the 'formatting.test'
failure.
The failure is due to destructors of `ClangdLSPServer`'s fields(`FixItsMap` and
`FixItsMutex`) being called before destructor of `Server`. It led to the worker
thread calling `consumeDiagnostics` after `FixItsMutex` and `FixItsMap`
destructors were called.
Also, clangd is now run with '-run-synchronously' flag in 'formatting.test'.
Reviewers: bkramer, krasimir
Reviewed By: krasimir
Subscribers: mgorny, cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D33233
llvm-svn: 303151
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit r303067.
Caused http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/34305/
And even after Simon's fix there is still a test failure.
llvm-svn: 303094
|
|
Summary: Major refactoring to split LSP implementation, Clang API calls and threading(mostly synchronization)
Reviewers: bkramer, krasimir
Reviewed By: bkramer
Subscribers: cfe-commits, mgorny, klimek
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D33047
llvm-svn: 303067
|