Skip to content

Migrate path completion to YARP - #873

Merged
andyw8 merged 1 commit into
yarpfrom
andyw8/migrate-path-completion-to-yarp
Aug 21, 2023
Merged

Migrate path completion to YARP#873
andyw8 merged 1 commit into
yarpfrom
andyw8/migrate-path-completion-to-yarp

Conversation

@andyw8

@andyw8andyw8 commented Aug 9, 2023

Copy link
Copy Markdown
Contributor

Partially addresses #449

Co-authored with @bitwise-aiden, cherry-picked from @vinistock's WIP version, then updated.

bin/test test/requests/path_completion_test.rb is passing

@andyw8andyw8 mentioned this pull request Aug 9, 2023
29 tasks
@github-actions

Copy link
Copy Markdown
Contributor

@andyw8
andyw8force-pushed the andyw8/migrate-path-completion-to-yarp branch 2 times, most recently from 697098f to a49bdc1CompareAugust 14, 2023 20:52
@github-actions

Copy link
Copy Markdown
Contributor

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

end_position = {
line: 0,
character: document.source.rindex('"'),
character: document.source.rindex('o')

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

As mentioned in #881

@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results in seconds (slowest at top)
textDocument/completion average: 0.308802 std_dev: 0.004856
textDocument/diagnostic average: 0.051102 std_dev: 0.012211
textDocument/definition average: 0.005978 std_dev: 0.003473
textDocument/documentHighlight average: 0.00177 std_dev: 0.000205
codeAction/resolve average: 0.001524 std_dev: 0.000165
textDocument/hover average: 0.001453 std_dev: 0.000162
textDocument/inlayHint average: 0.001316 std_dev: 0.000191
textDocument/semanticTokens/full average: 0.001076 std_dev: 0.000277
textDocument/documentLink average: 0.001061 std_dev: 0.000142
textDocument/documentSymbol average: 0.00105 std_dev: 0.000137
textDocument/codeLens average: 0.001046 std_dev: 0.00011
textDocument/semanticTokens/range average: 0.001001 std_dev: 9.3e-05
textDocument/formatting average: 0.000983 std_dev: 0.000371
textDocument/onTypeFormatting average: 0.000982 std_dev: 0.000135
textDocument/foldingRange average: 0.000975 std_dev: 0.000129
textDocument/selectionRange average: 0.000965 std_dev: 0.000158
textDocument/codeAction average: 0.000956 std_dev: 0.000111
================================================================================
Comparison with main branch:
textDocument/semanticTokens/full faster by 63.428 %
textDocument/semanticTokens/range faster by 48.215 %
textDocument/documentSymbol faster by 64.283 %
textDocument/foldingRange faster by 66.849 %
textDocument/formatting unchanged
textDocument/diagnostic unchanged
textDocument/documentLink faster by 63.754 %
textDocument/inlayHint faster by 18.744 %
textDocument/selectionRange faster by 80.676 %
textDocument/documentHighlight faster by 42.453 %
textDocument/hover faster by 11.897 %
textDocument/codeAction unchanged
textDocument/onTypeFormatting unchanged
codeAction/resolve faster by 10.891 %
textDocument/completion unchanged
textDocument/codeLens faster by 65.222 %
textDocument/definition unchanged
================================================================================
Missing benchmarks:
RubyLsp::Requests::ShowSyntaxTree

@andyw8
andyw8force-pushed the andyw8/migrate-path-completion-to-yarp branch 2 times, most recently from 31aaeb3 to d5460d2CompareAugust 18, 2023 20:33
@andyw8
andyw8 marked this pull request as ready for review August 18, 2023 20:35
@andyw8
andyw8 requested a review from a team as a code ownerAugust 18, 2023 20:35
def on_tstring_content(node)
@tree.search(node.value).sort.each do |path|
sig { params(node: YARP::StringNode).void }
def on_string_node(node)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
defon_string_node(node)
defon_string(node)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 fixed

@andyw8
andyw8force-pushed the andyw8/migrate-path-completion-to-yarp branch from d5460d2 to 2fa7421CompareAugust 21, 2023 13:50
end_position = {
line: 0,
character: document.source.rindex('"'),
character: T.must(document.source.rindex('"')) - 1,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These off by one errors need to be fixed in YARP. I wonder how hard it would be to help them get this done, so that we can stop altering our tests.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@andyw8
andyw8 merged commit 61c619d into yarpAug 21, 2023
@andyw8
andyw8 deleted the andyw8/migrate-path-completion-to-yarp branch August 21, 2023 20:37
vinistock added a commit that referenced this pull request Feb 28, 2024
Sign up for freeto 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

@andyw8@Morriar@vinistock