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

Problems list not updated after remedying concern #206

Open
chris-miner opened this issue Feb 22, 2023 · 2 comments
Open

Problems list not updated after remedying concern #206

chris-miner opened this issue Feb 22, 2023 · 2 comments
Labels
possible bug Could be a bug

Comments

@chris-miner
Copy link
Contributor

I did the following:

  1. created a lexer grammar of common lexer rules
  2. imported that in my grammar
  3. added rules using the results of the lexer rules
  4. noticed there were no problems reported
  5. changed the name of the file imported
  6. noticed that all the tokens defined in the imported file were now listed as undefined in the problems tab
  7. changed the name of the file imported back to one that actually exists

found:
The list of issues reported in the problem tab did not update (ie disappear)

expected:
The list of issues reported would reflect the current status of the file.

extra info:
There's a line that was commented out in runSemanticAnalysisIfNeeded about 3 years ago.

       //this.diagnostics.length = 0; Don't, we would lose our syntax errors from last parse run.

except that we want to lose those errors that are no longer relevant. I uncommented that line, but that didn't remedy the problem. I ended up looking at checkSymbolExistence. Even after fixing the grammar, the symbol table doesn't include symbols defined in the imported lexer grammar.

Strangely, relaunching the extension results in the same errors even though the project contains correct files.

@mike-lischke
Copy link
Owner

My assumption is that the syntactic and semantic analysis is not triggered again. Need to investigate.

@mike-lischke mike-lischke added the possible bug Could be a bug label Feb 23, 2023
@mike-lischke
Copy link
Owner

@chris-miner I finally found time to come back to this issue, and I cannot reproduce it. When you rename your lexer grammar, new files are generated with the new name. But the old files persist, so the old lexer can still be imported into your parser. It's not the grammar that is actually imported, but the .tokens file. You can even remove the lexer grammar, the parser still would be built properly. So, it's unclear to me how you suddenly can see errors for the imported symbols (unless you have renamed all related files, including those that have been generated).

For a test I removed the .tokens file and changed something in the parser, which resulted in the reported errors. Then I renamed the lexer grammar which regenerated all the files. Another small change in the parser brought it back to a valid state. So, I'm a bit clueless now.

Do you still see this issue with the latest release of the extension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Could be a bug
Projects
None yet
Development

No branches or pull requests

2 participants