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

Handled comments when resolving locations #670

Merged
merged 4 commits into from
Apr 2, 2024
Merged

Conversation

scohen
Copy link
Collaborator

@scohen scohen commented Mar 28, 2024

Previously, we would resolve commented out code as if it wasn't commented out, which caused a crash in #638.

Commented out code shouldn't resolve, but finding comments requires calling a different function with a different return shape than Code.string_to_quoted. This PR moves to
Code.string_to_quoted_with_comments and puts the comment metadata into the analysis struct where it can be queried.

Fixes #638

scohen added 2 commits March 29, 2024 08:16
Previously, we would resolve commented out code as if it wasn't
commented out, which caused a crash in #638.

Commented out code shouldn't resolve, but finding comments requires
calling a different function with a different return shape than
`Code.string_to_quoted`. This PR moves to
`Code.string_to_quoted_with_comments` and puts the comment metadata
into the analysis struct where it can be queried.

Fixes #638
@scohen scohen force-pushed the fix-entity-resolve-comments branch from b2ff386 to 9bbef97 Compare March 29, 2024 15:16
@Moosieus
Copy link
Collaborator

With this branch, I'm no longer getting errors on hover (#638), but I'm still receiving completions in comments:
image

Still a worthwhile improvement to merge, as it addresses the major usability concern here.

@scohen
Copy link
Collaborator Author

scohen commented Mar 30, 2024

Interesting. I’m not getting completions like that. Is the comment thing not working?

scohen added 2 commits April 1, 2024 11:12
Refactored detectors to take analyses rather than documents, added
detector csae for comments and added comment detection to code
intelligence's completions
@scohen
Copy link
Collaborator Author

scohen commented Apr 2, 2024

Answer: Because we explicitly enable completions for vscode regardless of everything else. I added an exemption for comments.

@scohen scohen merged commit 9bc3d15 into main Apr 2, 2024
9 checks passed
@scohen scohen deleted the fix-entity-resolve-comments branch April 2, 2024 18:00
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.

Hovering a commented function gives an error message
2 participants