Summary:
We have turned on the flag manually and used it for a while, and don't see any
major issues, let's enable it by default.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68077
llvm-svn: 372969
Summary:
so that we don't have too many usage from the client side (just a single
occurrance for register), this also aligns with how other builtin feature
being implemented in vscode.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67165
llvm-svn: 371036
Summary:
Add event listener that listens to configuration changes and reloads the ThemeRuleMatcher when the theme changes.
Right now it will not recolor the files, depends on the colorizer CL for that.
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66406
llvm-svn: 370305
Summary: We miss a few places where we need to add them to the subscriptions.
Reviewers: jvikstrom
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66881
llvm-svn: 370218
Summary: Disposes of the vscode listeners when clangd crashes and reuses the old highlighter when it restarts. The reason for reusing the highlighter is because this way the highlightings will not disappear as we won't have to dispose of them.
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66743
llvm-svn: 370202
Summary:
Just reapplies highlightings for all files when visible text editors change. Could find the correct text editor that should be reapplied but going for a simple implementation instead.
Removes the associated highlighting entry from the Colorizer when a text document is closed.
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66735
llvm-svn: 369911
Summary:
Adds the main colorizer component. It colorizes every time clangd sends a publishSemanticHighlighting notification.
Every time it colorizes it does a full recolorization (removes all decorations from the editor and applies new ones). The reason for this is that all ranges for the same scope share a TextEditorDecorationType. This is due to TextEditorDecorationTypes being very expensive to create. The prototype used one DecorationType per range but that ran into very big performance problems (it took >100 ms to apply 600 lines of highlightings which froze the editor).
This version does not share the problem of being extremly slow, but there is probably potential to optimize it even more.
No document/texteditor lifecycle management code in this CL, that will come in the next one.
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66219
llvm-svn: 369893
Summary:
The current behavior for a failed request is just to log it in the
output panel. When applyTweak fails for whatever reason, users usually don't get
informed (unless they open the output panel and dig the log).
this patch is to surface these errors by prompting up a message diag.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66211
llvm-svn: 368851
Summary: Loads a mapping of the clangd scope lookup table scopes to the most specific rule with the highest "precedence" on initialize. Preprocesses into a class so it's simple/fast to access when doing the actual coloring later.
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65856
llvm-svn: 368834
Summary: Added the code for the StaticFeature that must be registered to the client. Also decoding the notification data into objects. Did not register it to the client yet.
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65998
llvm-svn: 368568
Summary:
Adds a TextMate parser module to the vscode extension. It parses a theme into an array of a pair of TextMate scopes and text colors.
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65738
llvm-svn: 368136
Summary:
As we are going to grow the extension in the near future, it is time to
formalize the TS code format/style of our extension (although we'd lose the
history).
We use default options of clang-format:
- 80 max line length
- 2 space indent
Reviewers: ilya-biryukov, sammccall, jvikstrom
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65657
llvm-svn: 367684
Summary:
Matching the "C++" pattern on the first line of the file doesn't cover
all cases, MSVC C++ headers doesn't have such pattern. This patch
introduce a new heuristic to detect language based on the file path.
MSVC C++ standard headers are in the directory like
"c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include"
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63483
llvm-svn: 363662
Summary:
Extend our extension to support detecting these files as C++ files based on the first
line (`-*- C++ -*-`), it will make clangd work on C++ standard headers
(e.g. iostream).
We use the contributes.languages[1] to enrich the builtin VScode C++
support.
[1]: https://code.visualstudio.com/api/references/contribution-points#contributes.languages
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63397
llvm-svn: 363554
CHANGELOG:
- use the vscode-buildin feature to detect language (rather than using
file extensions), this fixes the extension not working on
non-standard C++ files (e.g. via files.associations)
llvm-svn: 363375
Summary:
There is no need to maintain this list by ourself, vscode already
provides this feature.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63323
llvm-svn: 363372
Summary:
Clangd is already resolving symlinks on the server side, therefore
there is no more need to handle it in client side. This was also resulting in
breakages whenever index contained a symbol coming from a non-existent file(like
a generated file), e.g. during workspace symbols whole response was dropped
since stat had failed.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62288
llvm-svn: 361475
CHANGELOG:
- add an explicit command to activate the extension.
- support .cu files (the extension is not activated for .cu files by default,
you need to manually activate the extension).
llvm-svn: 357082
Summary:
This would help minizime the annoying part of not activating the extension
for .cu file.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59817
llvm-svn: 357075
Summary:
clangd should be able to handle those with a proper compilation
database. However, users using 'nvcc' might start seeing spurious errors
in '.cu' files after this change.
My plan is to land and release this, but be ready to revert in
case of negative user feedback.
Reviewers: hokein
Reviewed By: hokein
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59759
llvm-svn: 356916
Summary:
The version bumps are a result of running `npm audit`, which found
3 security issues in previous versions of our dependencies.
Also add 'package-lock.json' to the repo, it's a common practice to
check in those files into the repository to get consistent versions of
dependencies when running on different machines.
Reviewers: hokein
Reviewed By: hokein
Subscribers: dschuff, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D57814
llvm-svn: 353296
Summary:
Clear the cached file statuses, otherwise we will leave some garbage texts on
the status bar when clangd crashes.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D56540
llvm-svn: 352049
Summary:
The file status will be shown in the status bar.
Depends on D55363.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D55374
llvm-svn: 350210