Skip to content

Remove the middleware addon component from all language servers - #23898

Merged
Don Jayamanne (DonJayamanne) merged 1 commit into
mainfrom
don/issue23897
Aug 6, 2024
Merged

Remove the middleware addon component from all language servers#23898
Don Jayamanne (DonJayamanne) merged 1 commit into
mainfrom
don/issue23897

Conversation

@DonJayamanne

Copy link
Copy Markdown

Fixes #23897


protected shouldCreateHidingMiddleware(jupyterDependencyManager: IJupyterExtensionDependencyManager): boolean {
return jupyterDependencyManager && jupyterDependencyManager.isJupyterExtensionInstalled;
return (

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this was a oversight.
Based on the comments of HidingMiddlewareAddon, we should only hide completions and the like only when using Pylance & not with Jedi

/**
 * This class is used to hide all intellisense requests for notebook cells.
 */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rich Chiodo (@rchiodo) would be the best person to ask (I think?) about how HidingMiddlewareAddon is expected to be used. He's back on Monday.

As of #20831, it appears that shouldCreateHidingMiddleware always returns false for Pylance (see NodeLanguageClientMiddleware). Given the derived class, I don't think the LanguageServerType.Node check is necessary.

I'm not sure what LanguageServerType.Microsoft represents. Is it a legacy option from the MPLS days?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LanguageServerType.Microsoft is from MPLS

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we don't ever need the middleware then.

@DonJayamanne Don Jayamanne (DonJayamanne) Aug 5, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the code that adds the middleware,
Had to force push as my previous commits weren't signed

@DonJayamanne Don Jayamanne (DonJayamanne) added skip package*.json package.json and package-lock.json don't both need updating skip tests Updates to tests unnecessary no-changelog No news entry required labels Aug 1, 2024
}

// eslint-disable-next-line class-methods-use-this
protected shouldCreateHidingMiddleware(_: IJupyterExtensionDependencyManager): boolean {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like none of the language servers need this anymore.
Hence removing this completely

@DonJayamanne Don Jayamanne (DonJayamanne) changed the title Hide nb completions only if using Pylance Remove the middleware addon component from all language servers Aug 5, 2024
@DonJayamanne
Don Jayamanne (DonJayamanne) marked this pull request as ready for review August 5, 2024 00:20
@vs-code-engineering vs-code-engineering Bot added this to the August 2024 milestone Aug 5, 2024
@rchiodo

Copy link
Copy Markdown

If I'm remembering correctly this was necessary when Pylance did it's own concatenation of notebook cells (it was necessary to skip intellisense for notebook cells so we wouldn't get dupes?)

I believe it's not used/necessary anymore too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No news entry required skip package*.json package.json and package-lock.json don't both need updating skip tests Updates to tests unnecessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

non-Pylance intellisense features fail in notebook context only

4 participants