superbol-studio-oss icon indicating copy to clipboard operation
superbol-studio-oss copied to clipboard

bind variables should be recognized (goto/show definition/references)

Open GitMensch opened this issue 1 year ago • 4 comments

bind variables (= variables that are from the COBOL part) are always prefixed with a double-colon:

EXEC SQL
    DELETE FROM TAB WHERE TABID = :VAR
END-EXEC

VAR should be referenced as COBOL variable and therefore goto/show definition should apply to it.

GitMensch avatar Jul 25 '24 10:07 GitMensch

Is that hard enough to postpone to ß - or is the later "in sight" already?

GitMensch avatar Aug 13 '24 10:08 GitMensch

Let's say a "dumb" preliminary implementation could be done quickly, especially for bound variables that appear somewhere in the PROCEDURE DIVISION. For EXECs that appear in the DATA DIVISION things may be more intricate; but may these EXECs feature bound variables?

nberth avatar Aug 13 '24 14:08 nberth

The bind variables are normally only in WORKING STORAGE or LINKAGE within EXEC SQL DECLARE or in copybooks included by EXEC SQL INCLUDE - and always "defined above" (no forward declarations).

So yes, in general the lookup seems "dumb" (and minimal more complex for the EXEC SQL INCLUDE copybookname case, but that's either understood by the LSP already or not [in this case it would be good to add it in general - that's just a COPY without REPLACE option done by the sql preprocessor before the compiler sees it]).

GitMensch avatar Aug 13 '24 14:08 GitMensch

Friendly ping as this is one of the "more missing" editing features compared to a setup with the cobol extension from spgennard.

GitMensch avatar Nov 27 '24 12:11 GitMensch