From 3869a2e0cf25323a8e5235840678b147ca908517 Mon Sep 17 00:00:00 2001 From: jdrouhard Date: Mon, 12 Dec 2022 11:42:37 -0600 Subject: perf(lsp): update semantic tokens algorithm for parsing modifiers (#21383) Instead of testing for every possible modifier type, only test bits up to the highest set in the token array. Saves many bit ops and comparisons when there are no modifiers or when the highest set bit is a lower bit than the highest possible in the legend on average. Can be further simplified when non-luaJIT gets the full bit module (see #21222) --- .../functional/plugin/lsp/semantic_tokens_spec.lua | 23 ---------------------- 1 file changed, 23 deletions(-) (limited to 'test/functional/plugin') diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua index 7a5494e9a5..e87e2a3334 100644 --- a/test/functional/plugin/lsp/semantic_tokens_spec.lua +++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua @@ -459,29 +459,6 @@ describe('semantic token highlighting', function() {1:~ }| | ]] } - - exec_lua([[ - vim.lsp.semantic_tokens.start(bufnr, client_id) - ]]) - - screen:expect { grid = [[ - #include | - | - int main() | - { | - int x; | - #ifdef __cplusplus | - std::cout << x << "\n"; | - #else | - printf("%d\n", x); | - #endif | - } | - ^} | - {1:~ }| - {1:~ }| - {1:~ }| - | - ]], unchanged = true } end) it('does not send delta requests if not supported by server', function() -- cgit