codefori / ileditor2-issues

A place where you can search and raise issues for ILEditor 2.
1 stars 0 forks source link

Bug: Cool features not working in SQLRPGLE source file #38

Closed richardm90 closed 4 years ago

richardm90 commented 4 years ago

Use tags for the following:

IBM i version = 7.4 System = Windows 10

I can't get some of the really cool features to work with SQLRPGLE source.

The two I'm struggling with are :

1) Compiler errors

I've checked the compile option and it does include OPTION(*EVENTF). When a compile fails it correctly reports the fact that it fails and includes the command user and the compiler messages but doesn't include the list of errors specific to the member.

I have this working successfully for an RPGLE source file.

2) Live errors

Similar to above I have this working in an RPGLE source file but can't get it to work for SQLRPGLE source files. I have "//live-error: crtsqlrpgi" specified as the third line in the source file.

worksofliam commented 4 years ago

@richardm90

Can you please share the compile command you are using, and also paste the compiler output?

Thanks!

richardm90 commented 4 years ago

@worksofliam

OK, I've a little bit more news. This isn't only the fact that it's an SQLRPGLE member type but could also be related to the size of the source member. A simple SQLRPGLE example with only a few lines does indeed work and I am seeing the specific member error messages.

This is the example output for a smallish SQLRPGLE member (TESTCOMP2) that worked as expected ...

Command used:

CRTSQLRPGI OBJ(RMTOOLS/TESTCOMP2) SRCFILE(RMTOOLS/QRPGLESRC) COMMIT(*NONE) OPTION(*EVENTF *XREF) RPGPPOPT(*LVL2) DBGVIEW(*SOURCE)
Compiler messages 16
CPD4090 Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.
CPC7301 File QSQLPRE created in library QTEMP.
CPC7305 Member TESTCOMP2 added to file QSQLPRE in QTEMP.
CPC3201 Member TESTCOMP2 file QSQLPRE in QTEMP changed.
RNS9307 Diagnostic check of source is complete. Highest severity is 00.
CPC2206 Ownership of object RETURNCODE in QTEMP type *DTAARA changed.
CPC0904 Data area RETURNCODE created in library QTEMP.
CPC7301 File QSQLTEMP1 created in library QTEMP.
CPD4090 Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.
CPC7305 Member TESTCOMP2 added to file QSQLTEMP1 in QTEMP.
CPF7302 File EVFTEMPF01 not created in library RMTOOLS.
CPD4090 Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.
CPD4090 Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.
CPF7302 File EVFTEMPF02 not created in library RMTOOLS.
RNS9308 Compilation stopped. Severity 30 errors found in program.
RNS9310 Compilation failed. Program TESTCOMP2 not created in library RMTOOLS.
CPC2206 Ownership of object QZSHSYSTEM in QTEMP type *USRSPC changed.
RMTOOLS/QRPGLESRC(TESTCOMP2)
4
50
RNS9308
Compilation stopped. Severity 30 errors found in program.
[0,0]
30
RNF7030
The name or indicator SURNAME is not defined.
[25,3]
30
RNF7503
Expression contains an operand that is not defined.
[25,3]
30
RNF7503
Expression contains an operand that is not defined.
[26,1]
QTEMP/QSQLPRE(TESTCOMP2)
1
10
SQL0053
No SQL statements found.
[0,0]

You have dropped the item. You have moved the item from position 2 to position 1 No Results found for \r

This is the output for a largish SQLRPGLE member that didn't work as expected ...

Command used:

CRTSQLRPGI OBJ(RMTOOLS/TESTCOMP3) SRCFILE(RMTOOLS/QRPGLESRC) COMMIT(*NONE) OPTION(*EVENTF *XREF) RPGPPOPT(*LVL2) DBGVIEW(*SOURCE)
Compiler messages
14
CPD4090 Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.
CPC7301 File QSQLPRE created in library QTEMP.
CPC7305 Member TESTCOMP3 added to file QSQLPRE in QTEMP.
CPC3201 Member TESTCOMP3 file QSQLPRE in QTEMP changed.
RNS9307 Diagnostic check of source is complete. Highest severity is 00.
CPC2206 Ownership of object RETURNCODE in QTEMP type *DTAARA changed.
CPC0904 Data area RETURNCODE created in library QTEMP.
CPC7301 File QSQLTEMP1 created in library QTEMP.
CPC7305 Member TESTCOMP3 added to file QSQLTEMP1 in QTEMP.
CPD4090 Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL.
CPF7302 File EVFTEMPF01 not created in library RMTOOLS.
RNS9308 Compilation stopped. Severity 30 errors found in program.
RNS9310 Compilation failed. Program TESTCOMP3 not created in library RMTOOLS.
CPC2206 Ownership of object QZSHSYSTEM in QTEMP type *USRSPC changed.

Note that if I try compiling TESTCOMP3 after TESTCOMP2 failed then I also see the specific member listings for TESTCOMP2 below the compiler messages for TESTCOMP3, if that makes sense. It's almost as if the EVENTF data for TESTCOMP3 isn't there or isn't brought back - possibly because of the size of the source? Looking in EVFEVENT I can see there are a good number of records, 406 to be precise.

Also note that I cannot get live errors to work in either example.

worksofliam commented 4 years ago

@richardm90

In your ILEditor 2 settings, is your build library or temporary library QTEMP?

Liam

richardm90 commented 4 years ago

No. temp library is ILEDITOR and build library is RMTOOLS.

worksofliam commented 4 years ago

@richardm90

How big is your 'largish' SQLRPGLE program? I will need a way to recreate this in our development system.

worksofliam commented 4 years ago

For the record - Richard and I had a phone call where he showed the problem on his end. He has given me the source code to recreate the issue but I am not having much luck creating it. I believe it has something to do with the compiler results.

I am continuing to investigate.

richardm90 commented 4 years ago

@worksofliam

I can easily replicate this so if it helps and you want to take control of my pc to debug then I'm more than happy to work with you on this, get you connected and leave you to it.

worksofliam commented 4 years ago

@richardm90

Here it is working with SQLRPGLE in a source member, although it doesn't work in every instance.

image

We may have to take this feature out, or maybe disable it for SQLRPGLE for the near future until I can spend some hard hours fixing it up. I totally blame the pre-compiler :)

worksofliam commented 4 years ago

@richardm90

Ok, I just made some very tedious fixes to the complication process and I am expecting some much better results for you now.

We're going to push out 0.6.1 tonight, which should help this a lot.

richardm90 commented 4 years ago

@worksofliam

I've been testing this on 0.6.1 and I am getting live errors and compile errors for a simple sqlrpgle source member.

One thing I am struggling with though is to incorporate my own custom compile commands. I have my own program that I use as a wrapper around the crt* commands. When I use my custom command to compile I see the compile errors, and the errors also appear in the source but I don't see the definition information. As soon as I swap back to a standard IBM command I do see the definition information.

I'll do some further checking on more complex sqlrpgle members.

worksofliam commented 4 years ago

@richardm90 about the custom compile commands:

The IDE will only look for an error listing if the compile command contains *EVENTF - we have no way if the errors were created otherwise.

Does that make sense?

richardm90 commented 4 years ago

@worksofliam

Yes, that makes sense and I checked the crt command that my custom command used and it was the same as the crt command that worked in the IDE - and included *EVENTF.

worksofliam commented 4 years ago

Okay, I have come to the decision that for the time being I am going to remove the Go-To Definition and Find All References feature. The reason we're doing this is that I can't get this feature to work consistently for all ILE language we're targetting.

The plan is to strip out the feature, get some other bits working, and then implement some more functional parsers to make it work even better.

Of course, I still need to confirm this with Connor..

richardm90 commented 4 years ago

@liam-barry

OK, tough decision to make as online errors and definitions are two killer features but I understand the reasoning.

worksofliam commented 4 years ago

@richardm90 Inline errors will actually be staying since that is not tied to the language (and also a great feature) - just the definitions and references part.