-
Notifications
You must be signed in to change notification settings - Fork 28
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
Implement syntax checking features #307
Conversation
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
👋 A new build is available for this PR based on 7282ae4. |
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
It sure appears to provide the same syntax check as running the SQL in ACS Run SQL Scripts :-) |
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@worksofliam Looking good and working fine with most samples. 👍
I found one issue:
- connect to IBM i (7.5 in my test)
- open a new SQL document
- enter the following source:
update qtemp.temp_rcpout
set COL1 = '123'
, COL2 = replace( COL2, 'a', 'A' )
, COL3 = replace( COL3, 'b', 'B' )
, COL4 = 'L'
, COL5 = '/dir1/'
, COL6 = 0
- press the button to syntax check
I then get this:
Signed-off-by: worksofliam <[email protected]>
@chrjorgensen Have another look. I added some additional logic to handle when the message ID is not returned, which is why you were seeing the blank message. It actually looks like this could be a bug in the system API, and IMO shouldn't be impactful to this PR. I also made it so |
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
@chrjorgensen I added a new VS Code configuration option to determine if warnings should be shown. It is false by default. |
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
There seems to be some issue with the syntax checking running when I comment out a line. I have the following
Which produces three errors. If i press CMD + / that line gets checked correctly. But if i comment out a second line, that second line does not get checked and the error remains. Same if i comment out a third line. The order of the lines do not seem to matter. |
Another issue found for CL commands. If i start with |
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
…st error offsets for syntax errors outside statement boundaries. Add test case for mixed valid and invalid SELECT statements. Signed-off-by: worksofliam <[email protected]>
… range in SQL validation Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
…modification Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
Signed-off-by: worksofliam <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job dealing with the side issues found during testing.
A very nice addition indeed.
Signed-off-by: worksofliam <[email protected]>
…to 500 and improve error handling during syntax validation. Signed-off-by: worksofliam <[email protected]>
… to 200 Signed-off-by: worksofliam <[email protected]>
…or messaging Signed-off-by: worksofliam <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be some issue with the syntax checking running when I comment out a line.
Actually this is still happening
Signed-off-by: worksofliam <[email protected]>
Introduce a problem provider that highlights SQL syntax issues and allows for configurable syntax check intervals. This feature will only syntax check as you are typing. If you're working in a document made up of multiple statements, it will only check the statement you're currently working on while you type. You can use the newly added button to check an entire document.
How to test while editing:
Test the Check Syntax button: