Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use language_server-protocol gem's SymbolKind constants #947

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Aug 29, 2023

Motivation

Instead of maintaining our own list of symbol kinds, we can use the language_server-protocol gem's SymbolKind constants, which will reduce a layer of conversion (symbol to integer) as well.

@st0012 st0012 added the chore Chore task label Aug 29, 2023
@st0012 st0012 added this to the 2023-Q3 milestone Aug 29, 2023
@st0012 st0012 self-assigned this Aug 29, 2023
@st0012 st0012 requested a review from a team as a code owner August 29, 2023 16:02
@st0012 st0012 requested review from Morriar and vinistock August 29, 2023 16:02
Instead of maintaining our own list of symbol kinds, we can use the
language_server-protocol gem's SymbolKind constants, which will reduce a
layer of conversion (symbol to integer) as well.
@st0012 st0012 force-pushed the remove-document-symbol-symbol-kind-constant branch from d1316af to d6ec989 Compare August 29, 2023 16:05
@github-actions
Copy link
Contributor

github-actions bot commented Aug 29, 2023

Benchmark results in seconds (slowest at top)

          textDocument/completion average: 0.204193 std_dev: 0.003472
          textDocument/diagnostic average: 0.042897 std_dev: 0.010538
          textDocument/definition average: 0.004928 std_dev: 0.002845
      textDocument/selectionRange average: 0.004203 std_dev: 0.000612
   textDocument/documentHighlight average: 0.002659 std_dev: 0.000198
      textDocument/documentSymbol average: 0.002603 std_dev: 0.000204
            textDocument/codeLens average: 0.002562 std_dev: 0.000201
        textDocument/documentLink average: 0.002559 std_dev: 0.000202
 textDocument/semanticTokens/full average: 0.002544 std_dev: 0.000362
        textDocument/foldingRange average: 0.002506 std_dev: 0.000229
textDocument/semanticTokens/range average: 0.001702 std_dev: 0.000136
               codeAction/resolve average: 0.001484 std_dev: 0.000122
           textDocument/inlayHint average: 0.001433 std_dev: 0.000128
               textDocument/hover average: 0.001419 std_dev: 0.000108
    textDocument/onTypeFormatting average: 0.000878 std_dev: 8.1e-05
          textDocument/formatting average: 0.000875 std_dev: 0.000164
          textDocument/codeAction average: 0.000851 std_dev: 7.7e-05


================================================================================
Comparison with main branch:

 textDocument/semanticTokens/full unchanged
textDocument/semanticTokens/range unchanged
      textDocument/documentSymbol unchanged
        textDocument/foldingRange unchanged
          textDocument/formatting unchanged
          textDocument/diagnostic unchanged
        textDocument/documentLink unchanged
           textDocument/inlayHint unchanged
      textDocument/selectionRange unchanged
   textDocument/documentHighlight unchanged
               textDocument/hover unchanged
          textDocument/codeAction unchanged
    textDocument/onTypeFormatting unchanged
               codeAction/resolve unchanged
          textDocument/completion unchanged
            textDocument/codeLens unchanged
          textDocument/definition unchanged


================================================================================
Missing benchmarks:

RubyLsp::Requests::ShowSyntaxTree

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@st0012 st0012 merged commit db36338 into main Aug 29, 2023
31 checks passed
@st0012 st0012 deleted the remove-document-symbol-symbol-kind-constant branch August 29, 2023 17:36
andyw8 pushed a commit that referenced this pull request Sep 5, 2023
Instead of maintaining our own list of symbol kinds, we can use the
language_server-protocol gem's SymbolKind constants, which will reduce a
layer of conversion (symbol to integer) as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants