codefori / vscode-rpgle

RPGLE language tools for VS Code
MIT License
39 stars 20 forks source link

missing semicolon (";") detection improvement #233

Open ThomasBarberot opened 1 year ago

ThomasBarberot commented 1 year ago

Hello.

Feature request description I help some new RPG developers using VSCode/Code for i. And the most encoureted error is a missing semicolon (" ; ") at the end of an instruction, especially at the declaration level (dcl-s and dcl-ds).

And sometimes, I don't see it quickly and spend a lot of time to seek something else.

RDi comparison In VSCode, when I remove an ending semicolon in a DS declaration (or after a calculation intruction), it appears this way: CodeForI As you can see, there is no warning to indicate that the second DS cannot be resolved because of the missing semicolon.

In RDi, the same member appears this way: RDi As you can see, on the line following the one where the semicolon is missing, there is a red cross to indicate the parsing issue.

Describe the solution you'd like It would be great to indicate on the following line that the semicolon is missing, with a message or underlines like other errors.

Describe alternatives you've considered I didnt't found anywhere to set on something to help to set focus on an error like missing semicolon. Perhaps I missed something.

Thanks for your great job around Code for i!

worksofliam commented 1 year ago

If you add a lint configuration file with valid indentation, you will get a bunch of warnings :) I will see about how we can add this.

ThomasBarberot commented 1 year ago

I tried to apply your advice (I spent some time trying to find out how to activate the linter! I tried it a few months ago!). And this is what I see with the linter solution (with the indentation):

If I remove the semicolon at the end of a calculation line, no warning appears: VSC_c

If I remove the semicolon at the end of a calculation line and the second DS, no warning appears: VSC_d02

If I remove the semicolon at the end of a calculation line and the second DS and the first DS, warning appears: VSC_d01

So the solution is working, but not completely because all the cases of missing semicolon are not covered.