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

Make document symbol extensible #949

Merged
merged 2 commits into from
Aug 30, 2023
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Aug 29, 2023

Motivation

By making DocumentSymbol request extensible, we can allow extensions to extend it. For example, users would be able to use document symbol feature to list Rails tests defined with test "name" too.

Implementation

I followed the common pattern for extension for this request as well. But for tests I added a test_extension helper to encapsulate some common boilerplate and essential cleanups.

Automated Tests

I added a new test case for the extension.

Manual Tests

@st0012 st0012 added the enhancement New feature or request 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 20:30
@st0012 st0012 requested review from Morriar and vinistock August 29, 2023 20:30
@github-actions
Copy link
Contributor

Benchmark results in seconds (slowest at top)

          textDocument/completion average: 0.239989 std_dev: 0.00549
          textDocument/diagnostic average: 0.05154 std_dev: 0.011734
          textDocument/definition average: 0.006179 std_dev: 0.003305
      textDocument/selectionRange average: 0.005126 std_dev: 0.000718
 textDocument/semanticTokens/full average: 0.003471 std_dev: 0.000876
   textDocument/documentHighlight average: 0.00328 std_dev: 0.000293
      textDocument/documentSymbol average: 0.003272 std_dev: 0.000375
            textDocument/codeLens average: 0.003165 std_dev: 0.000294
        textDocument/foldingRange average: 0.003052 std_dev: 0.000314
        textDocument/documentLink average: 0.003051 std_dev: 0.00027
textDocument/semanticTokens/range average: 0.002138 std_dev: 0.000233
               codeAction/resolve average: 0.00181 std_dev: 0.000175
               textDocument/hover average: 0.001748 std_dev: 0.000144
           textDocument/inlayHint average: 0.001738 std_dev: 0.00015
          textDocument/formatting average: 0.001103 std_dev: 0.000352
    textDocument/onTypeFormatting average: 0.001068 std_dev: 0.000123
          textDocument/codeAction average: 0.001015 std_dev: 0.000118


================================================================================
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 457f7ce into main Aug 30, 2023
31 checks passed
@st0012 st0012 deleted the make-document-symbol-extensible branch August 30, 2023 20:53
andyw8 pushed a commit that referenced this pull request Sep 5, 2023
* Make DocumentSymbol extensible

* Add test_extension helper for extension tests
vinistock pushed a commit that referenced this pull request Feb 28, 2024
…d-patch-52b27a3e81

Bump the minor-and-patch group with 2 updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants