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

More parser error recovery, unlocking completions in more locations #1987

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

minestarks
Copy link
Member

@minestarks minestarks commented Oct 30, 2024

  1. Callable signatures tolerate a lot more broken syntax now. This allows us to complete type parameters correctly in broken syntax that we commonly see when the user is in the middle of typing:
operation Test<'T>() : () => |
operation Test<'T>(x: |)
operation Test<'T>() : |
operation Test<'T>(x: Std.|) : Unit {}
  1. Error recovery in notebook cells if a statement can't be parsed. Fixes Broken expression node at the end of a cell breaks the AST #1960 and allows completions to work in scenarios like this:
%%qsharp

function Foo() : Unit {}
let x = |  // expect Foo in the list

Copy link
Collaborator

@swernli swernli left a comment

Choose a reason for hiding this comment

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

This is a really nice change, thanks! Of note for those who think about perf, I did run comparisons against main and saw no impact on parser performance.

Copy link
Contributor

@orpuente-MS orpuente-MS left a comment

Choose a reason for hiding this comment

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

The code and logic seem fine. Approved. These are amazing improvements. Thanks!

@billti billti added this pull request to the merge queue Oct 31, 2024
@minestarks minestarks removed this pull request from the merge queue due to a manual request Oct 31, 2024
@minestarks minestarks added this pull request to the merge queue Oct 31, 2024
Merged via the queue into main with commit 922bbca Oct 31, 2024
18 checks passed
@minestarks minestarks deleted the minestarks/completions-tys-notebooks branch October 31, 2024 17:54
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.

Broken expression node at the end of a cell breaks the AST
3 participants