Unsaved buffer makes raise-syntax-error inconsistent
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 516
- Forks
- 103
- PR merge metrics
- No merged PRs in 30d
Description
Running an unsaved buffer from keyboard shortcut seems to make raise-syntax-error on phase 0 behave different from running by clicking the Run button. In particular, the error highlighting and the error message are different.
Observation: if the buffer is saved, there will be no problem. Or, if raise-syntax-error is done on phase X (X > 0), there will be no problem as well.
Steps to reproduce:
-
Paste the following code in an unsaved buffer (unsaved editor):
#lang racket (define-syntax-rule (foo . xs) #'xs) (define stx (foo 1 2 3 4)) (raise-syntax-error 'foo "foo" stx) -
Hit the run keyboard shortcut (e.g.,
cmd+Rfor Mac). Observe that there's an error highlighting along with the error messagefoo: foo in: (1 2 3 4) -
Hit the run keyboard shortcut again. Now there's no error highlighting anymore, and the error message becomes:
unsaved editor:4:12: foo: foo in: (1 2 3 4) -
To get an error highlighting again, I need to edit the buffer (say, adding a whitespace) and Cmd-R again.
-
Open a new unsaved buffer and repeat the process, but this time, click the Run button instead. In this scenario, there's no error highlighting and the error message is consistently:
unsaved editor:4:12: foo: foo in: (1 2 3 4)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in an unsaved DrRacket buffer using the provided syntax-error example. Compare running with the keyboard shortcut against clicking the Run button, focusing on phase 0, error highlighting, and source-location text. Done means both paths behave consistently and the reported highlighting and message match the intended behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100