feat: Allow running Python code files in SAS Content #1815
Merged
Conversation
Signed-off-by: Tom Li <tom.li@sas.com>
Signed-off-by: Tom Li <tom.li@sas.com>
d3d90f1 to
43d9393
Compare
scottdover
reviewed
Mar 3, 2026
package.json
Outdated
| "keybindings": [ | ||
| { | ||
| "when": "editorFocus && editorLangId == sas && !SAS.hideRunMenuItem", | ||
| "when": "(editorLangId == sas || (editorLangId == python && resourceScheme =~ /^sas(Content|Server)(ReadOnly)?$/)) && !SAS.hideRunMenuItem", |
Contributor
There was a problem hiding this comment.
Looks like we probably want editorFocus here still
Contributor
There was a problem hiding this comment.
Also, this regex might be a little more concise and match what we need: /^sas(Content|Server).*/
Contributor
Author
There was a problem hiding this comment.
have modified @scottdover, please review.
updated all occurrences in to be more permissive and concise, use regular expression (resourceScheme =~ /^sas(Content|Server).*/). Signed-off-by: Tom Li <tom.li@sas.com>
f176e2f to
43dcee5
Compare
scottdover
approved these changes
Mar 6, 2026
Contributor
scottdover
left a comment
There was a problem hiding this comment.
Looks alright to me :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fix issue #258: Allow running Python code files in SAS Content. Currently, the "Run in SAS" button and related commands are hardcoded to only appear when editorLangId == sas. We need to broaden these when clauses in
package.json to also include .py files (editorLangId == python), provided they are opened from the SAS Content or SAS Server navigator (which use the URI schemes sasContent, sasContentReadOnly, sasServer, sasServerReadOnly).
Testing:
Automated Tests
Run the extension's unit tests using npm run test to make sure we didn't break basic startup or command execution.
Manual Verification
I compiled the UI and theoretically test opening a .py file from sasContent and verify that the context values effectively enable the play button.
TODOs: