aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp/semantic_tokens_spec.lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-12-12 20:43:14 +0100
committerGitHub <noreply@github.com>2022-12-12 20:43:14 +0100
commit54d6a32fbdcbd5b26b72f4dca8906e60f5186d2c (patch)
tree263df641e5480ed7e0c36c5ce1858355d02183b2 /test/functional/plugin/lsp/semantic_tokens_spec.lua
parent3869a2e0cf25323a8e5235840678b147ca908517 (diff)
downloadrneovim-54d6a32fbdcbd5b26b72f4dca8906e60f5186d2c.tar.gz
rneovim-54d6a32fbdcbd5b26b72f4dca8906e60f5186d2c.tar.bz2
rneovim-54d6a32fbdcbd5b26b72f4dca8906e60f5186d2c.zip
feat(lsp): highlight semantic token modifiers (#21390)
Apply semantic token modifiers as separate extmarks with corresponding highlight groups (e.g., `@readonly`). This is a low-effort PR to enable the most common use cases (applying, e.g., italics or backgrounds on top of type highlights; language-specific fallbacks like `@global.lua` are also available). This can be replaced by more complicated selector-style themes later on.
Diffstat (limited to 'test/functional/plugin/lsp/semantic_tokens_spec.lua')
-rw-r--r--test/functional/plugin/lsp/semantic_tokens_spec.lua31
1 files changed, 17 insertions, 14 deletions
diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua
index e87e2a3334..e62a6f7086 100644
--- a/test/functional/plugin/lsp/semantic_tokens_spec.lua
+++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua
@@ -69,9 +69,12 @@ describe('semantic token highlighting', function()
[4] = { bold = true, foreground = Screen.colors.SeaGreen };
[5] = { foreground = tonumber('0x6a0dad') };
[6] = { foreground = Screen.colors.Blue1 };
+ [7] = { bold = true, foreground = Screen.colors.DarkCyan };
+ [8] = { bold = true, foreground = Screen.colors.SlateBlue };
}
command([[ hi link @namespace Type ]])
command([[ hi link @function Special ]])
+ command([[ hi @declaration gui=bold ]])
exec_lua(create_server_definition)
exec_lua([[
@@ -107,9 +110,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -199,9 +202,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -228,9 +231,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -251,9 +254,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -309,9 +312,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- ^int {3:x}(); |
+ ^int {8:x}(); |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {3:x} << "\n"; |
{6:#else} |
@@ -489,9 +492,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- int {2:x}; |
+ int {7:x}; |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |
@@ -513,9 +516,9 @@ describe('semantic token highlighting', function()
screen:expect { grid = [[
#include <iostream> |
|
- int {3:main}() |
+ int {8:main}() |
{ |
- ^int {2:x}(); |
+ ^int {7:x}(); |
#ifdef {5:__cplusplus} |
{4:std}::{2:cout} << {2:x} << "\n"; |
{6:#else} |