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

Remove the middleware addon component from all language servers #23898

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

DonJayamanne
Copy link

Fixes #23897

@@ -42,7 +46,11 @@ export class LanguageClientMiddleware extends LanguageClientMiddlewareBase {
}

protected shouldCreateHidingMiddleware(jupyterDependencyManager: IJupyterExtensionDependencyManager): boolean {
return jupyterDependencyManager && jupyterDependencyManager.isJupyterExtensionInstalled;
return (
Copy link
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

Choose a reason for hiding this comment

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

@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
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
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.

Copy link
Author

@DonJayamanne DonJayamanne Aug 5, 2024

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 DonJayamanne requested a review from rchiodo August 1, 2024 01:59
@DonJayamanne 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
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 DonJayamanne changed the title Hide nb completions only if using Pylance Remove the middleware addon component from all language servers Aug 5, 2024
@DonJayamanne 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

rchiodo commented Aug 5, 2024

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.

@DonJayamanne DonJayamanne merged commit f6a6a32 into main Aug 6, 2024
73 checks passed
@DonJayamanne DonJayamanne deleted the don/issue23897 branch August 6, 2024 04:36
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