Skip to content
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

[Notebooks] Diagnostics are not removed when language is changed #3555

Closed
claudiaregio opened this issue Oct 31, 2022 · 3 comments
Closed

[Notebooks] Diagnostics are not removed when language is changed #3555

claudiaregio opened this issue Oct 31, 2022 · 3 comments
Assignees
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@claudiaregio
Copy link

Steps to reproduce:

  1. Open a Polyglot Notebook
  2. Sometimes kernel is set to a Python kernel by default
  3. Switch kernel to .NET Interactive
  4. Pylance diagnostics do not go away once the correct kernel is assigned to notebook

Below shows a notebook where .NET Interactive has been set as the kernel for Polyglot notebooks, yet Pylance is still claiming there are errors on a cell that is actually C# code, not Python.

image

@debonte debonte self-assigned this Oct 31, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Oct 31, 2022

Looking at the LSP messages, it seems we don't clear diagnostics when the notebook close event comes?

I see this when I switch languages:

[Trace - 9:53:10 AM] Sending notification 'notebookDocument/didClose'.
Params: {
    "notebookDocument": {
        "uri": "untitled:Untitled-1.ipynb?jupyter-notebook"
    },
    "cellTextDocuments": [
        {
            "uri": "vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#W0sdW50aXRsZWQ%3D"
        }
    ]
}

@rchiodo rchiodo added needs investigation Could be an issue - needs investigation and removed triage-needed labels Oct 31, 2022
@debonte
Copy link
Contributor

debonte commented Oct 31, 2022

Related to https://github.com/microsoft/pyrx/pull/2873. Closing a notebook cell means that it is deleted and we should remove all info about it. Which is different from closing a document which is temporary -- the user could immediately reopen it.

@debonte debonte assigned heejaechang and unassigned debonte Nov 3, 2022
@debonte debonte added bug Something isn't working and removed needs investigation Could be an issue - needs investigation labels Nov 3, 2022
@debonte debonte changed the title [Notebooks] [Notebooks] Diagnostics are not removed when language is changed Nov 3, 2022
@debonte debonte added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Nov 3, 2022
@rchiodo rchiodo closed this as completed Nov 10, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Nov 10, 2022

This issue has been fixed in prerelease version 2022.11.21, which we've just released. You can find the changelog here: CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

4 participants