Commit Graph

9 Commits

Author SHA1 Message Date
Haojian Wu f8c17fe111 [clangd] fixes semantic highlighting test
Summary: fixes https://github.com/clangd/clangd/issues/176

Patch by liu hui!

Reviewers: ilya-biryukov, hokein, sammccall

Reviewed By: hokein

Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D70078
2019-11-11 16:47:44 +01:00
Johan Vikstrom 2dddf3e4ff [clangd] Cleans up the semantic highlighting resources if clangd stops.
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
2019-08-28 13:46:22 +00:00
Johan Vikstrom 1c9aa70b04 [clangd] Handling text editor/document lifetimes in vscode extension.
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
2019-08-26 13:56:45 +00:00
Johan Vikstrom 3b6d7040cf [clangd] Added a colorizer to the vscode extension.
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
2019-08-26 11:36:11 +00:00
Johan Vikstrom 9fa2599e9b [clangd] Loading TokenColorRules as a class mapping the rules to their associated clangd TextMate scope index.
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
2019-08-14 12:11:58 +00:00
Johan Vikstrom 020eea0c16 [clangd] Added the vscode SemanticHighlighting feature code but did not enable it in the client.
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
2019-08-12 13:33:43 +00:00
Johan Vikstrom 57ced1e155 [clangd] Added a TextMate theme parser to the vscode extension.
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
2019-08-07 08:48:52 +00:00
Haojian Wu 13a81444cd [clangd][vscode] clang-format the the extension code.
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
2019-08-02 14:24:02 +00:00
Krasimir Georgiev 90573e49c9 [clangd] Add a toy VS Code integration for development purposes
Summary: This patch adds bare-bone VS Code integration for development purposes of clangd.

Reviewers: klimek, bkramer, mprobst

Reviewed By: bkramer

Subscribers: mprobst

Differential Revision: https://reviews.llvm.org/D30102

llvm-svn: 296618
2017-03-01 13:53:12 +00:00