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

"Run sas file" tasks do not respect selected code #1177

Closed ngriffiths21 closed 3 weeks ago

ngriffiths21 commented 1 month ago

When running the built in "Run sas file" task, or setting up a custom "Run sas file" task with an empty "file" parameter, the task always submits the entire active editor. This contradicts what is in the documentation here. It is important for custom tasks to respect code selection, otherwise custom preambles/postambles can only be applied to entire SAS files.

Steps to reproduce the behavior:

  1. Open a new editor window, set SAS language and enter:

%put hello 1; %put hello 2;

  1. Highlight only the second line
  2. Open the command palette, choose run task, and "Run sas file." The selection is ignored and both %put statements are submitted.

Environment:

Client OS: Windows 10 Extension version: v1.10.1 SAS version: 9.4, via SSH remote connection