HomePhabricator

[clangd] Added a colorizer to the vscode extension.

Authored by jvikstrom on Aug 26 2019, 4:36 AM.

Description

[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

Details

Committed
jvikstromAug 26 2019, 4:36 AM
Differential Revision
D66219: [clangd] Added a colorizer to the vscode extension.
Parents
rG0a9f47d7cc95: Breakpad: Add support for parsing STACK WIN records
Branches
Unknown
Tags
Unknown