Skip to content

Test chars safely when highlighting #22918

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

The arrow test at lastOffset - 3 is out-of-range when highlighting, which parses a snippet of source.

Fixes #22906

Reproduces under scala-cli -rewrite -indent but not under vulpix. (It would be nice to know why.) (Needless to add, it shouldn't be a research project to get the test rig to just run a compilation. There is programmatic flag-setting that defies expectations.)

This commit also allows a test to using scala by ignoring it, as a convenience. When the directive parsing is completely aligned with scala-cli, it should completely ignore what is not supported, so that test files can be used both ways.

@som-snytt som-snytt force-pushed the issue/22906-bad-rewrite branch from 1f80504 to f553e23 Compare April 5, 2025 05:29
@som-snytt
Copy link
Contributor Author

It would be nice if the nuisance message did not make its way into the check file. The test rig could de-duplicate. Again, the goal is that I don't have to change my scala-cli reproduction just to use it as a test.

Output from 'tests/neg/i22906.scala' did not match check file. Actual output:
Flag -indent set repeatedly
-- Error: tests/neg/i22906.scala:5:15 ----------------------------------------------------------------------------------

The arrow test at lastOffset - 3 is out-of-range when highlighting,
which parses a snippet of source.
@som-snytt som-snytt force-pushed the issue/22906-bad-rewrite branch from f553e23 to 1898a5e Compare April 17, 2025 09:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect code causes the parser to crash when trying to rewrite
1 participant