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

Fix incomplete_tag generation with trailing whitespace #518

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

c42f
Copy link
Member

@c42f c42f commented Dec 6, 2024

Previously we relied on the last SyntaxNode consuming all trailing whitespace when detecting incomplete syntax. However this assumption was broken by #397 and is generally fragile with respect to any extra bump_trivia() calls. Fix this by just comparing to the stream position before any bumping of remaining trivia.

Should fix #512

Previously we relied on the last SyntaxNode consuming all trailing
whitespace when detecting incomplete syntax. However this assumption was
broken by #397 and is generally fragile with respect to any extra
bump_trivia() calls. Fix this by just comparing to the stream position
before any bumping of remaining trivia.
@c42f c42f force-pushed the caf/fix-incomplete-tag-with-whitespace branch from e5e19c1 to 9fcc903 Compare December 6, 2024 07:54
@c42f c42f mentioned this pull request Dec 6, 2024
@Keno
Copy link
Member

Keno commented Dec 6, 2024

The additional test cases I had were "CompletionFoo.test(1, 1, " (which is the one that base depends on so good to CI test here) and "[x)". They both look good here so LGTM.

@c42f
Copy link
Member Author

c42f commented Dec 7, 2024

Ah now I see.

The CompletionFoo stuff is all in the REPL stdlib tests and tests a lot more than the parser.

But the JuliaSyntax tests are drawn from Base tests in test/client.jl (plus additional cases I constructed).

@c42f c42f merged commit 2d19c06 into main Dec 8, 2024
36 checks passed
@c42f c42f deleted the caf/fix-incomplete-tag-with-whitespace branch December 8, 2024 10:32
c42f added a commit that referenced this pull request Dec 8, 2024
Previously we relied on the last SyntaxNode consuming all trailing
whitespace when detecting incomplete syntax. However this assumption was
broken by #397 and is generally fragile with respect to any extra
bump_trivia() calls. Fix this by just comparing to the stream position
before any bumping of remaining trivia.
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.

Regression in incomplete_tag
2 participants