Open yedane opened 5 years ago
Hi @yedane,
I don't think I have enough information to repro your issue.
The 'main.c' and 'Header file' you provided appear to be the same file. Did you intend to send another file? Perhaps one which declared the macros you are using?
Consider creating a repo with a self-contained example of the issue, which we could pull to investigate.
Thanks,
Hello @Colengms,
My bad, I edited my post
Dynamic SQL is not standard C++. Is it implemented using macros, a special compiler, or a preprocessor?
We don't support this syntax. We could consider this a feature request..
It's preprocessor.
Is it possible to ignore it during intellisense parsing ?
@yedane You could surround the SQL code in
#ifndef __INTELLISENSE__
#endif
...but I don't think there's any way for us to auto-detect this.
Hi @yedane,
I think if the Dynamic SQL were C++ preprocessor based, squiggles would be correct. IntelliSense parsing should consider macro contents. However, it's unclear to me what could be within a preceding macro that would make a ":" valid before a variable name. My suspicion is that it's not preprocessor based.
@Colengms
Dynamic SQL is implemented by using PRO C, it's finally a precompiler that transform into C code: PRO C More information
Here is an code example before and after compilation: Simple example
Thanks @yedane. Since the syntax is processed by an alternate (pre)compiler and not C++ preprocessor macros, that would explain the squiggle. Let's keep this issue open as a feature request to support (or at least not squiggle) Dynamic SQL syntax.
This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog.
If getting the C/C++ extension to understand embedded SQL is out of the question, perhaps you could add an option to ignore certain statements based on a regular expression. Then at least the embedded SQL statements wouldn't be flagged as problems or errors.
My project has lots of C code with embedded SQL processed by the Oracle ProC precompiler. (https://en.wikipedia.org/wiki/ProC) The SQL code is prefixed by "exec sql" (case insensitive) and terminated by a semi-colon (;), possibly multiple lines.
For example:
exec sql select count(*) into :PayerCnt from t_re_pat_liab where sak_recip = :sakRecip;
I have a team of C developers that I'd like to convince to use VS code, but this is going to be a problem. How do I vote for this feature?
@pbderr Voting is via
Our parser doesn't have the ability to skip over code based on a regular expression. You could potentially use a regular expression to surround the calls with #ifndef __INTELLISENSE__
.
This feature request has received enough votes to be added to our backlog.
Type: LanguageService
Describe the bug
We have to use dynamic SQL statements, and in the synthax we have to put a ":" before a variable, but it seems that break the IntelliSense. Please have a look on the documentation below: Oracle dynamic statements
Actually when we want to drive into dba_test_with_proc_and_without_colon function it show us the header instead of the function declaration. But when we drive into dba_test_with_proc_and_without_colon it shows us the declaration.
To Reproduce
Expected behavior
when we go to Declaration (F12) on the dba_test_with_proc_and_colon, it must drive to the function declaration instead of the header
Code source
main.c
hello.h
hello.c
In the zip, you can find the source with we repro the issue Intellisense.zip