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

VSCode reports suggestions the CLI doesn't report #383

Open
2 tasks done
carlfriedrich opened this issue Aug 28, 2023 · 2 comments
Open
2 tasks done

VSCode reports suggestions the CLI doesn't report #383

carlfriedrich opened this issue Aug 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@carlfriedrich
Copy link

Checklist

  • I have searched the Sourcery documentation for the issue, and found nothing
  • I have checked there are no open bugs referencing the same bug or problem

Description

I have installed the Sourcery plugin for VS Code. Furthermore I have set up the Sourcery CLI. Both of them are configured to use the same .sourcery.yaml config file.

Now VS Code reports some suggestions that the CLI does not report, e.g. the use-contextlib-suppress suggestion:

grafik

Even when I explicitly enable it on the command line, the CLI does not find any issues:

grafik

The same happens with extract-method and extract-duplicate-method.

Where does the difference in behavior come from? How can I configure VS Code and the CLI to report the same suggestions?

Code snippet that reproduces issue

#!/usr/bin/env python3

def main():
    try:
        invalid = 1 / 0
    except ZeroDivisionError:
        pass

if __name__ == "__main__":
    main()

Debug Information

IDE Version:
VSCode 1.81.1

Sourcery Version:
Sourcery 1.6.0

Operating system and Version:
Ubuntu 22.04 via WSL

@carlfriedrich carlfriedrich added the bug Something isn't working label Aug 28, 2023
@carlfriedrich carlfriedrich changed the title VSCode reports suggestions the CLI doesn't VSCode reports suggestions the CLI doesn't report Aug 28, 2023
@ruancomelli ruancomelli added enhancement New feature or request and removed bug Something isn't working labels Aug 28, 2023
@ruancomelli
Copy link
Contributor

Hello, @carlfriedrich! Thanks for reporting this issue.

This is a known limitation in the Sourcery CLI - it cannot yet handle refactorings that add imports. The same limitation applies to both extract-method and extract-duplicate-method, as you mentioned. Enhancing the CLI to have those capabilities is already on our roadmap but may still take some time to be implemented.

@carlfriedrich
Copy link
Author

@ruancomelli Thanks for your quick reply. Looking forward to the implementation.

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

2 participants