Skip to content

Magic Command Support #1582

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Magic Command Support #1582

wants to merge 7 commits into from

Conversation

kpatl1
Copy link
Collaborator

@kpatl1 kpatl1 commented Jul 31, 2025

Summary
Added a MagicCommandProcessor and LanguageSwitcher. This is used in the controller file to allow for magic command support within a notebook. A user can type "%sas, %py, %md" and automatically have the cell change to that type. There are also other aliases that allow for the same changes.
Testing
Created a notebook and tested changing the first line of cells back and forth from different types and with different text.

@kpatl1 kpatl1 changed the title Kibpat 936 Magic Command Support Jul 31, 2025
@kpatl1 kpatl1 marked this pull request as ready for review July 31, 2025 12:23
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: feaa5e9
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 3c879e2
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 093db92
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 5c0b45f
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 9431297

Signed-off-by: Kishan Patel <[email protected]>
@kpatl1 kpatl1 requested a review from scnwwu August 1, 2025 15:07
@scnwwu
Copy link
Member

scnwwu commented Aug 4, 2025

I don't think we should do this.
#936 refers to Jupyter magic commands.
If you try it in Jupyter, Jupyter won't delete the first line. The first line stays there.
Looking at the documentation, it says

Magics must use a syntax element which is not valid in the underlying language.

But % invokes macro in SAS language. We should NOT interpret it to other things.

Also, in Jupyter, %%python will run in a separate subprocess. Not a simple language change.
The magic commands in Jupyter is handled by kernel, not a UI feature.

@kpatl1
Copy link
Collaborator Author

kpatl1 commented Aug 4, 2025

I understand. Is there a version of this feature that we should try and implement, or leave as is?

@scnwwu
Copy link
Member

scnwwu commented Aug 7, 2025

I understand. Is there a version of this feature that we should try and implement, or leave as is?

adding @snlwih

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants