[clangd] Do not end inactiveRegions range at position 0 of line
authorNathan Ridge <zeratul976@hotmail.com>
Tue, 23 May 2023 08:17:09 +0000 (04:17 -0400)
committerNathan Ridge <zeratul976@hotmail.com>
Mon, 5 Jun 2023 07:51:15 +0000 (03:51 -0400)
commit8ec44987e54b5366a03716237feb79e37ae0634a
tree622f93304d5788cdd720d52088a0733a2507eb3b
parent95bfbf26ab97692fb33ea2a34506adaa9e0f72df
[clangd] Do not end inactiveRegions range at position 0 of line

This carries over the fix previously made for semantic highlighting
https://reviews.llvm.org/D92148, to the new inactiveRegions
protocol as well.

In addition, the directives at the beginning and end of an
inactive region are now excluded from the region.

Fixes https://github.com/clangd/clangd/issues/1631
Fixes https://github.com/clangd/clangd/issues/773

Differential Revision: https://reviews.llvm.org/D151190
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/SemanticHighlighting.cpp
clang-tools-extra/clangd/SemanticHighlighting.h
clang-tools-extra/clangd/unittests/ClangdTests.cpp
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp