rokucommunity / rokucommunity/brighterscript

Not gracefully handling unclosed conditional compilation

Open
#429 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
208
Forks
68
Avg merge
8h 39m
Merged PRs (30d)
39

Description

Getting the following in vscode when I was modifying the contents of a file and only had an opening #if block for conditional compilation but not a closing one. Would be great for the language server to gracefully handle this as best it can.
image

[Error - 11:36:11 AM] Request textDocument/codeAction failed.
Message: Request textDocument/codeAction failed with message: TypeError: Cannot read property 'end' of undefined
at Util.rangesIntersect (/Users/bleighty/.vscode/extensions/rokucommunity.brightscript-2.22.2/node_modules/brighterscript/dist/util.js:438:15)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the unmatched #if case in VS Code and trace the textDocument/codeAction request to Util.rangesIntersect in brighterscript's util module. Done means code actions no longer fail with a TypeError when conditional compilation is left unclosed.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.