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

signature helps are not shown if the target code has comments #829

Merged

Conversation

tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Jul 2, 2023

SignatureHelpProvider fails to detect the cursor position correctly because it uses source code from AST node instead of original source code. Therefore it misdetects the cursor position if the source code contains comments. As a result, it does not show signature helps it the source code contains comments.

SignatureHelpProvider fails to detect the cursor position correctly
because it uses source code from AST node instead of original
source code.  Therefore it misdetects the cursor position if the
source code contains comments.  As a result, it does not show signature
helps it the source code contains comments.
Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Thank you for the fix. It makes sense!

How about simply using the source.buffer? If it works, I also want to ask you to add a test case that has comments before the Ruby code.

@tk0miya
Copy link
Contributor Author

tk0miya commented Jul 3, 2023

Thank you for your valuable comment. I updated this PR :-)

@tk0miya tk0miya force-pushed the signature_help_is_not_shown_if_comment_found branch from e6d6cc8 to 233e23c Compare July 3, 2023 18:09
Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

🎉

@soutaro soutaro merged commit 4d0e2b2 into soutaro:master Jul 4, 2023
@tk0miya tk0miya deleted the signature_help_is_not_shown_if_comment_found branch July 4, 2023 02:07
@soutaro soutaro added this to the Steep 1.5 milestone Jul 5, 2023
@soutaro soutaro added the Released The PR is already included in a published release label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released The PR is already included in a published release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants