sassoftware / vscode-sas-extension

This SAS Extension for Visual Studio Code provides support for the SAS language, including features such as SAS syntax highlighting, code completion, hover help, code folding, outline, SAS code snippets and run SAS code.
https://sassoftware.github.io/vscode-sas-extension/
Apache License 2.0
117 stars 47 forks source link

[Syntax] Aggregation function support in proc sql #1094

Open Criptic opened 2 months ago

Criptic commented 2 months ago

Describe the bug When working with aggregation functions (as specified here: https://go.documentation.sas.com/doc/en/pgmsascdc/default/sqlproc/n123fsko39j44pn16zlt087e1m2h.htm) here the following do not get highligthed:

And the following are highlighted in yellow, instead of blue like the other functions:

Both categories also do not provide documentation tips and auto completion.

Steps to reproduce Steps to reproduce the behavior:

Paste the following code into a .sas file: ` %macro _ddd_interval_metrics(); %local i;

proc sql;
    create table work._ddd_baseline_interval as
        select
            %do i = 1 %to &_ddd_interval_counter.;
                "&&_ddd_interval_var_&i." as name_&i.,
                sum(&&_ddd_interval_var_&i.) as sum_&i.,
                min(&&_ddd_interval_var_&i.) as min_&i.,
                max(&&_ddd_interval_var_&i.) as max_&i.,
                avg(&&_ddd_interval_var_&i.) as avg_&i.,
                median(&&_ddd_interval_var_&i.) as median_&i.,
                nmiss(&&_ddd_interval_var_&i.) as nmiss_&i.,
                css(&&_ddd_interval_var_&i.) as css_&i.,
                cv(&&_ddd_interval_var_&i.) as cv_&i.,
                prt(&&_ddd_interval_var_&i.) as prt_&i.,
                range(&&_ddd_interval_var_&i.) as range_&i.,
                std(&&_ddd_interval_var_&i.) as std_&i.,
                stderr(&&_ddd_interval_var_&i.) as stderr_&i.,
                sumwgt(&&_ddd_interval_var_&i.) as sumwgt_&i.,
                t(&&_ddd_interval_var_&i.) as t_&i.,
                uss(&&_ddd_interval_var_&i.) as uss_&i.,
                %if &i. EQ &_ddd_interval_counter. %then %do;
                    var(&&_ddd_interval_var_&i.) as var_&i.
                %end;
                %else %do;
                    var(&&_ddd_interval_var_&i.) as var_&i.,
                %end;
            %end;
    from work._ddd_baseline;
run; quit;

%mend _ddd_interval_metrics; `

Expected behavior A clear and concise description of what you expected to happen.

Syntaxhighlighting (documentation and autocompletion) in the same way as the other aggregation functions in proc sql.

Screenshots If applicable, add screenshots to help explain your problem. image

Environment (please complete the following information): Client OS: Windows 11 Extension version: v1.10.0 SAS version: Viya 2024.06

Additional context Add any other context about the problem here.