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

Simplify constants' :: prefix handling #904

Merged
merged 1 commit into from
Aug 22, 2023
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Aug 17, 2023

Motivation

As discussed in #893 (comment), we could simplify visitor's :: handling by moving it fully_qualify_name.

Implementation

I decided to handle prefix in fully_qualify_name instead of Index#initialize because Index#initialize wouldn't be able to deal with the name pushed to IndexVisitor's stack.

Index.<< is also not ideal as when it's called entry.name would already have the prefix.

@st0012 st0012 added this to the 2023-Q3 milestone Aug 17, 2023
@st0012 st0012 self-assigned this Aug 17, 2023
@st0012 st0012 requested a review from a team as a code owner August 17, 2023 20:22
@github-actions
Copy link
Contributor

Benchmark results in seconds (slowest at top)

          textDocument/completion average: 0.267597 std_dev: 0.005312
          textDocument/diagnostic average: 0.043923 std_dev: 0.010385
          textDocument/definition average: 0.005631 std_dev: 0.003163
      textDocument/selectionRange average: 0.004271 std_dev: 0.000616
   textDocument/documentHighlight average: 0.002638 std_dev: 0.000275
      textDocument/documentSymbol average: 0.002574 std_dev: 0.000179
 textDocument/semanticTokens/full average: 0.002565 std_dev: 0.000389
            textDocument/codeLens average: 0.002559 std_dev: 0.000261
        textDocument/documentLink average: 0.002555 std_dev: 0.000198
        textDocument/foldingRange average: 0.002482 std_dev: 0.000202
textDocument/semanticTokens/range average: 0.001689 std_dev: 8.8e-05
               codeAction/resolve average: 0.001481 std_dev: 0.00014
               textDocument/hover average: 0.001425 std_dev: 0.000132
           textDocument/inlayHint average: 0.001422 std_dev: 0.000122
          textDocument/formatting average: 0.000856 std_dev: 0.000318
    textDocument/onTypeFormatting average: 0.000856 std_dev: 0.000103
          textDocument/codeAction average: 0.000836 std_dev: 7.5e-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

@st0012 st0012 requested a review from vinistock August 21, 2023 16:03
@st0012 st0012 merged commit 684aced into main Aug 22, 2023
@st0012 st0012 deleted the simplify-indexer-name-handling branch August 22, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants