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

New idea for handling intellisense #11

Merged
merged 4 commits into from
Sep 15, 2021
Merged

Conversation

rchiodo
Copy link
Contributor

@rchiodo rchiodo commented Sep 15, 2021

As I described here:
microsoft/vscode-jupyter#6333 (comment)

I had a new idea for handling intellisense that doesn't require a new pylance for every notebook (preliminary investigation seems to indicate about 100MB is allocated per instance).

The new idea is this:

  • Python extension would skip providing intellisense for notebook and interactive cells. (DocumentSelector would just not include these)
  • Jupyter extension would register a language server for every interpreter (after it's run at least once, or at least one for the active interpreter.
  • Jupyter extension registration would use the same Document Selector for all servers. Namely notebook/interactive cells.
    • Normally this would mean duplicate intellisense (cause you would have multiple servers running that matched each notebook cell)
    • However the middleware addon (code I'm changing here) can swallow all intellisense requests when the request is for a notebook that doesn't match the interpreter associated with a notebook.
    • This is done by passing a 'shouldProvideIntellisense' function into the middleware
    • The jupyter extension will pass a different version of this function down to each middleware piece (basically something that binds itself to the interpreter in use and then compares the controller for a notebook URI against that interpreter)
    • This should then cause only 1 of the language server's results to be returned for a notebook.

@rchiodo rchiodo requested a review from a team as a code owner September 15, 2021 17:01
@rchiodo rchiodo merged commit 6656681 into main Sep 15, 2021
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