vscode_deno
vscode_deno copied to clipboard
Jupyter kernel on vscode gives error about variables declared on above cells
To Reproduce
- Open deno kernel on vscode
- Create a variable in the first cell
- Use it on the second one
Expected behavior
None errors
Screenshots
Versions
vscode: 1.82.2 deno: 1.37 extension: v3.23.1
@bartlomieju
@nayeemrmn could you take a look what's going on here?
This will happen in the deno language server isn't being used - try adding "deno.enable": true
to your settings and see if the error goes away.
It looks like you can also put your notebooks in a specific directory and add that directory to deno.enablePaths
as recommended in the setting description.
But I would say it should be safe for the extension to always use the deno language server for a notebook that has a deno kernel selected.
But I would say it should be safe for the extension to always use the deno language server for a notebook that has a deno kernel selected.
I agree. Specifically because I don't want deno to be enabled on the global settings and I also don't want to save the notebook file sometimes.
I'm also seeing this issue and have "deno.enable": true
in my .vscode/settings.json
.
i'm wondering how this could be solved implementation-wise. my naive first impression was:
- join all typescript cells
- send the joined cell into tsc
- parse tsc diagnostics and re-map line numbers into splitted cells
I forgot to give an update here, this is blocked by https://github.com/gluon-lang/lsp-types/pull/268 which implements this API in the protocol https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notebookDocument_synchronization. This provides the minimum of getting the accurate order of the cells etc.
After that it's still going to be difficult and we'd likely have to do what @scarf005 proposed above. On the surface this isn't a problem with VSCode's built-in node TS server because it has notebook cells in script mode, where all vars are global. We might alternatively end up doing something similar.
Would this PR help somehow? https://github.com/denoland/deno/pull/21518
I'm also seeing this issue and have
"deno.enable": true
in my.vscode/settings.json
.
Same here. The Deno APIs are enabled as shown by this screenshot:
Jupyter support is the only reason why I started using Deno, and this issue is a blocker for me.
What a pitty, I was so excited to try out Deno inside of jupyter notebooks but having variables that don't remember their values makes it a no go. And yes, Deno is enabled in this workspace.
Just as a reminder, the code does work as expected, this issue is just about the lsp giving wrong diagnostics, but if you run the cell it will work.
Just as a reminder, the code does work as expected, this issue is just about the lsp giving wrong diagnostics, but if you run the cell it will work.
Unfortunately, even if it does execute, it's frustrating to lose all type information and be downgraded to any
after the first cell. So, no code completion or type checking, effectively losing all benefits of typescript. Any ETA on when this might be fixed?
Anyone have a work-around for this?
As it stands, it's nearly unusable. :(