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

Introduce indexables #950

Merged
merged 1 commit into from
Sep 1, 2023
Merged

Introduce indexables #950

merged 1 commit into from
Sep 1, 2023

Conversation

vinistock
Copy link
Member

Motivation

First step for #938

In order to provide require path completion through our index, we need to first remember what are the require paths for each entry. We currently only use the full path.

I think it'll be useful to have a concept of an Indexable as the unit of items to be indexed. In the future, if we need to include the gem name where we found an entry, we will also be able to do that.

Implementation

I recommend reviewing by commit:

  • Add Indexable
  • Started returning indexables instead of strings from the configuration
  • Started using indexables in Index
  • Started using indexables for synchronizing document modifications
  • Fixed tests

Automated Tests

Adapted existing tests.

@vinistock vinistock added this to the 2023-Q3 milestone Aug 29, 2023
@vinistock vinistock self-assigned this Aug 29, 2023
@vinistock vinistock requested a review from a team as a code owner August 29, 2023 21:01
@github-actions
Copy link
Contributor

github-actions bot commented Aug 29, 2023

Benchmark results in seconds (slowest at top)

          textDocument/completion average: 0.185742 std_dev: 0.012852
          textDocument/diagnostic average: 0.043778 std_dev: 0.010057
          textDocument/definition average: 0.004789 std_dev: 0.002784
      textDocument/selectionRange average: 0.004206 std_dev: 0.000656
        textDocument/documentLink average: 0.002621 std_dev: 0.000525
            textDocument/codeLens average: 0.002593 std_dev: 0.000337
      textDocument/documentSymbol average: 0.002551 std_dev: 0.000365
   textDocument/documentHighlight average: 0.002549 std_dev: 0.000353
 textDocument/semanticTokens/full average: 0.002546 std_dev: 0.00041
        textDocument/foldingRange average: 0.002347 std_dev: 0.000308
textDocument/semanticTokens/range average: 0.001609 std_dev: 0.000253
               codeAction/resolve average: 0.001397 std_dev: 0.000269
           textDocument/inlayHint average: 0.001391 std_dev: 0.000302
               textDocument/hover average: 0.001332 std_dev: 0.000345
    textDocument/onTypeFormatting average: 0.000841 std_dev: 0.000138
          textDocument/formatting average: 0.000839 std_dev: 0.000342
          textDocument/codeAction average: 0.000826 std_dev: 0.000182


================================================================================
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

@vinistock vinistock force-pushed the vs/move_prefix_tree_to_indexer branch 2 times, most recently from 1197e26 to b8fb36b Compare September 1, 2023 15:56
Base automatically changed from vs/move_prefix_tree_to_indexer to main September 1, 2023 17:11
@vinistock vinistock enabled auto-merge (squash) September 1, 2023 17:28
@vinistock vinistock merged commit 3c39ada into main Sep 1, 2023
28 of 29 checks passed
@vinistock vinistock deleted the vs/introduce_indexables branch September 1, 2023 17:33
andyw8 pushed a commit that referenced this pull request Sep 5, 2023
Create Indexable as the unit of items to be indexed
vinistock added a commit that referenced this pull request Feb 28, 2024
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