Closed singularitti closed 2 months ago
I don't think this would be something Pylance would implement. Pylance is the language server here because the language in the notebook cell says 'Python'. If Wolfram Language Kernel isn't python, that cell should be changed to the language Wolfram or something like that. Then VS code would have a Wolfram language server.
I think this would be better as a request on the Jupyter extension. To auto switch the language of each cell when the kernel changes.
I'm encountering an issue when using the VSCode extension "Jupyter" with non-Python kernels, specifically the Wolfram Language kernel. When I open a Jupyter notebook with a non-Python kernel, Pylance begins checking types and syntax as if the notebook were using Python. This leads to errors such as undefined variables or functions (
Plot
,Sin
,x
, etc.) that are actually valid in the Wolfram Language.Environment data
Code Snippet
Repro Steps
Plot[Sin[x], {x, 0, 10}]
.Expected behavior
Pylance should detect that the notebook is using a non-Python kernel and automatically disable Python-specific checks.
Actual behavior
Pylance incorrectly applies Python-specific checks, resulting in false errors and warnings for valid code in other languages.
Please consider implementing a feature where Pylance automatically disables its checks whenever a Jupyter notebook is opened with a non-Python kernel. This would prevent unnecessary distractions and errors, improving the experience for users working with other programming languages in VSCode.