invalid Json object results the wrong error in VSCode
Open
Nobody has claimed this yet.
🐛 bug
🐶 dogfood
🔌 vscode-extension
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 215
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 27
Description
I tried this:
This json is invalid (test in not defined):
class TestJson {
pub inflight testJson (): Json {
return {
"test": test,
};
}
}
This happened:
I expected this:
when trying to compile the code above, the compiler throws the correct error:
Is there a workaround?
compile and see the correct error
Anything else?
No response
Wing Version
0.51.12
Node.js Version
v19.3.0
Platform(s)
MacOS
Community Notes
- Please vote by adding a 👍 reaction to the issue to help us prioritize.
- If you are interested to work on this issue, please leave a comment.
Contributor guide
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
Start by reproducing the Wing code in VSCode and compiling it with Wing 0.51.12 on the reported setup. Compare the diagnostic for the undefined test identifier with the incorrect JSON-related error; done means the compiler or VSCode integration reports the expected error for this invalid object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100