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
105 stars 43 forks source link

fix: add a new zone MACRO_SUB_OPT_NAME #1049

Open bitaoz opened 2 weeks ago

bitaoz commented 2 weeks ago

Summary Resolve https://github.com/sassoftware/vscode-sas-extension/issues/652, Add a new zone MACRO_SUB_OPT_NAME, which is similar to PROC_SUB_OPT_NAME, VIEW_OR_PGM_SUB_OPT_NAME. It's the subtype of SUB_OPT_NAME.

Testing Type "%macro test (test);" and "enter", Indentation works properly.

Zhirong2022 commented 1 week ago

New a .sas file, type code '%macro test;' at line1 and type Enter to the next line, type code '%let num=1;', it will indent automatically. image

Zhirong2022 commented 6 days ago

Auto indent works improperly with '%mend;' Type code below

%macro reportit(reuest);
    %if %upcase(&request)=STAT %then
        %do;
            proc means;
                title "summary of all numric variables";
            run;
        %end;
    %else %if %upcase(&request)=PRINTIT %then
        %do;
            proc print;
                title "listing of data";
            run;
        %end;
    %else %put incorrect type;
    title;

Type Enter at the end of 'title;', try to type '%mend;' image

Zhirong2022 commented 6 days ago

Indentation has different behavior with 'set' statement

data popstate;
    set pf70 pm70 pf80 pm80;

data _null_;
    set sashelp.cars(drop=origin enginesize cylinders horsepower weight  wheelbase length);

image image

Zhirong2022 commented 5 days ago

Auto indent works improperly with typing %mend + macro name; Scenario1: If the macro code block nested with other code block.

%macro test;
  %let num=1;
  proc print data=sashelp.cars(obs=1);
  run;
  %mend test;

Scenario2: Different behavior between topic build and main build image