Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the copilot "Add Comments" feature is altering the actual code #43

Open
Ian-zygz opened this issue Apr 9, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@Ian-zygz
Copy link

Ian-zygz commented Apr 9, 2024

Describe the bug
When using the "Add Comment" feature on highlighted SAS code, the comments are added but the original SAS code highlighted is also changed at the same time the comments are added.

To Reproduce
Steps to reproduce the behavior:

  1. I generated SAS code from comments using the following comments
    - /* sashelp.class table printed and sorted by age */

  2. Accepted the option that gave me this output:

data class_sorted;
    set sashelp.class;
    proc sort data=class_sorted;
        by age;
    run;
    
    proc print data=class_sorted;
    run;
  1. Highlighted the above code and selected "Add Comments"

  2. The result was a new version of the code with comments. You can see that the code has been re-structured.

/* Sort the class dataset by Age */
data class_sorted;
  set sashelp.class;
run;


/* Sort class_sorted dataset by Age */
proc sort data=class_sorted;
  by age;
run;

/* Print the class_sorted dataset */
proc print data=class_sorted;
run;

Expected behavior
I wouldn't expect the code structure to be changed. If this is expected, using this feature on tested code would require additional testing if code is to be changed and would create more effort when building SAS programs.

Desktop (please complete the following information):

  • Windows 10 laptop
  • VSCode version:
    Version: 1.88.0 (system setup)
    Commit: 5c3e652f63e798a5ac2f31ffd0d863669328dc4c
    Date: 2024-04-03T13:26:18.741Z
    Electron: 28.2.8
    ElectronBuildId: 27744544
    Chromium: 120.0.6099.291
    Node.js: 18.18.2
    V8: 12.0.267.19-electron.0
    OS: Windows_NT x64 10.0.19045
@Ian-zygz Ian-zygz added the bug Something isn't working label Apr 9, 2024
@leah-gall
Copy link

I had a similar issue. I asked for comments on this data step:

data testset;
    set sashelp.class;
    rename name = var1
           age = var2
           height = var3;
    /* weight = var4
    sex = var5 */
run;

and got this back:

/* Renaming variables and excluding weight and sex variables */
data testset;
   set sashelp.class(rename=(name=var1 age=var2 height=var3));
   /* weight = var4
    sex = var5 */
run;

It didn't consistently give this result, but after trying it quite a few times, it seemed that most of the responses had problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants