-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Magic Racket is not recognized as a racket formatter in Jupyter Notebooks #120
Comments
Very interesting, thanks for filing this issue. I've tried to reproduce this on my side (VS Code 1.81.1 on macOS), but I've hit an obstacle along the way... At moment, I don't see a way to choose Racket as a notebook cell language. When I create a new notebook, the cells start out as Python by default. I can click the "Python" marker in the bottom right of the cell to get a menu of languages, but it seems to be a subset of the languages that VS Code and my extensions are aware of, as only a few of them appear there, and Racket is not one of them. I wonder how this list of "notebook ready" languages is determined... |
Just to make sure, did you run the second command during IRacket installation?
https://docs.racket-lang.org/iracket/index.html On my system that was enough for Jupyter to start seeing the new language. |
Ah thanks, that helped. I am now able to select Racket as a language in notebook cells. Okay, it looks like this issue is similar to #113: this extension currently only registers itself for Just removing the filter and registered for all schemes is not enough, as presumably we need to do a bit of translation to get the content for notebook cells. Perhaps other extensions have found a good way to do that... |
Well, racket-fmt uses a Don't know if this could be applicable to LSP. |
Thanks, I noticed that as well. 🙂 In this case, it's a little different in that the language server currently assumes the document URI has a path-like shape to it. I believe the main options are either:
I need to review the language a bit more to make sure it does not actually use the file path to e.g. read content, and then from there I think a decent approach to move forward should become clear. |
At the moment, there are a few places where the language server assumes a filesystem. I have filed jeapostrophe/racket-langserver#122 to discuss this with others working on the language server. |
We've had a bit of progress on this front! jeapostrophe/racket-langserver#122 has been resolved on the langserver side, which means it is now compatible with non-file documents. The main issue that remains is that the langserver really wants To test out the current state:
|
Environment
Steps to reproduce
Expected
Magic Racket formats the cell.
Actual
VS Code error message:
Extension 'Magic Racket' is configured as formatter but it cannot format 'Racket'-files
Additional context
"Format Document With..." command inside .ipynb files reveals that Magic Racket is NOT present in the list of possible formatters.
Same command inside .rkt files correctly displays Magic Racket.
Same scenario with
racket-fmt
works correctly out of the box, so probably not complicated.Recording:
magic_racket_formatter_not_recognized_in_jupyter_notebooks.mp4
The text was updated successfully, but these errors were encountered: