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

.sasnb cell execution #1214

Open fabiocerutisas opened 1 week ago

fabiocerutisas commented 1 week ago

Describe the bug Running multiple cells in a row in .sasnb notebooks leads to errors. Specifically, if you do shift+enter and execute multiple cells, the second, third, ... cells do not wait for cell 1 to finish running. They all try to run simultaneously and not sequentially.

Steps to reproduce Steps to reproduce the behavior:

  1. Create a .sasnb notebook with a two or more cells that will each take a couple of seconds to run and that depend on each other (i.e., cell 1 creates an output table used in cell 2 and so on...)
  2. Go to cell 1 and press shift+enter as many times as you have created cells (this should lead to multiple cells running at the same time)
  3. See error: you will notice that cell 2,3,4, etc. start executing immediately without waiting for cell 1 to finish. This will cause errors as the needed inputs for cell 2 won't be available yet as cell 1 has yet to finish running.

Expected behavior The expected behavior in those scenarios is that cells should run one after the other and not simultaneously. The behavior should mimic that of .ipynb notebooks where if you use shift+enter to execute multiple cells, there will be a sequential running pattern and not a simultaneous one.

Screenshots NA

Environment (please complete the following information): SAS Viya Workbench

Additional context NA

scnwwu commented 1 week ago

also note #402

scnwwu commented 1 week ago

Note that the Execute Above Cells, Execute Cell and Below and Run All commands do execute cells in queue.

fabiocerutisas commented 1 week ago

Will it be possible to embed this capability when executing shift+enter? That's the most typical way to run cells in notebooks

fabiocerutisas commented 1 week ago

Also, from VSCode I am not seeing Execute Above Cells and Execute Cell and Below; if I click on the arrow on the left-hand side to run the cell I still experience simultaneous execution of multiple cells

scnwwu commented 6 days ago

Will it be possible to embed this capability when executing shift+enter? That's the most typical way to run cells in notebooks

Yes

Also, from VSCode I am not seeing Execute Above Cells and Execute Cell and Below;

It should be on the cell toolbar when focus is in a cell

capture

Also note that you can always call a command via Command Palette, and optionally assign a shortcut.