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

[feature request] Add Quick-Fix for misspelled APIs, e.g., Module 're' has no 'findAll' member; maybe 'findall'? Pylint E1101:no-member #6960

Open
hamirmahal opened this issue Feb 15, 2025 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@hamirmahal
Copy link

Problem

Extension users have to manually correct misspelled APIs, .e.g,

Module 're' has no 'findAll' member; maybe 'findall'? Pylint E1101:no-member

Desired Solution

There is an option in the Quick Fix... dropdown in VSCode that automatically suggests the appropriate APIs, like findall in the above example.

@hamirmahal
Copy link
Author

Image

@hamirmahal
Copy link
Author

The current Quick Fix options only include AI assistance, which can take a while and may not be available to everyone.

@hamirmahal
Copy link
Author

The replacement behavior suggested here is usually instant, with other language extensions.

@hamirmahal
Copy link
Author

Image

@karthiknadig
Copy link
Member

Even though the error is from pylint this type of correction can probably be done generically in Pylance. Moving this there for further discussion.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-pylint Feb 18, 2025
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Feb 18, 2025
@karthiknadig karthiknadig marked this as a duplicate of microsoft/vscode-mypy#345 Feb 18, 2025
@karthiknadig
Copy link
Member

Related: microsoft/vscode-mypy#345

@debonte
Copy link
Contributor

debonte commented Feb 18, 2025

Pylance has a spelling suggestion code action (see below), but it seems to only work in certain scenarios. For example, it didn't work for the re.findall scenario that you mentioned above or for the findall method that I show in the screenshot. But it did work for suggesting a fix for the MyClass class name. So maybe we just need to extend this code action to support other scenarios?

Image

@StellaHuang95 StellaHuang95 added enhancement New feature or request and removed needs repro Issue has not been reproduced yet labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants