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

Python code will be removed after perform format document if having comment code between 'proc python' and 'submit;' #1226

Open Zhirong2022 opened 1 day ago

Zhirong2022 commented 1 day ago

Describe the bug Open VSC SAS Extension base on Main branch. Perform format document, python code will be removed in certain circumstance.

Steps to reproduce

  1. New a .sas file
  2. Type code below
    
    proc python;
    /* comment */
    submit;
    print('test')
    endsubmit;
    run;

3. format code through ContextMenu 'Format Document'

**Expected behavior**
The code is formatted correctly

**Screenshots**
![image](https://github.com/user-attachments/assets/3524c129-60b9-4638-9c7b-a608d9c83f5f)

**Environment (please complete the following information):**
Client OS: [e.g. Windows 11]
Extension version: [e.g. v1.10.2]
Zhirong2022 commented 1 day ago

The same happened if having global statement between 'proc python;' and 'submit;'

proc python;
    title 'title';
    submit;
    x='test'
    endinteractive;
run;

image