sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.55k stars 68 forks source link

Refactoring not available #299

Closed dewilcox closed 1 year ago

dewilcox commented 1 year ago

Checklist

Description

I recently installed the Sourcery extension in VSCode. I'm evaluating it to see if it makes sense for my company to purchase several dozen seats of the "Team" license.

I love seeing great refactoring suggestions from Sourcery, like this: Sourcery problem

The problem is, I cannot get Sourcery to actually apply the changes:

Possibly this is a VSCode issue with quick fixes, but I'm not sure how to debug that

Debug Information

IDE Version: VSCode 1.73.0

Sourcery Version: 0.12.12

Operating system and Version: Ubuntu 20.04.5 LTS

Hellebore commented 1 year ago

Hi @dewilcox - thanks for raising this.

Could you possibly locate your sourcery.log file and post it here or email it to support@sourcery.ai?

https://docs.sourcery.ai/Product/Troubleshooting/#what-is-the-sourcery-log

dewilcox commented 1 year ago

Thank you @Hellebore. Here is the log. sourcery.log

Hellebore commented 1 year ago

Nothing obvious in the log file unfortunately.

Have you got a .sourcery.yaml file in the project, or one in your home directory under .config/sourcery/sourcery.yaml?

If so could you post it here?

Also are any error notifications or output being shown in vs code?

Hellebore commented 1 year ago

Oh and could you please let me know which other extensions you have installed?

dewilcox commented 1 year ago

Thank you for your support with this @Hellebore!

I don't have any .sourcery.yaml config file in the project, nor the one in the home directory.

I'm not seeing any error notifications nor output being shown in VSCode.

I have a lot of other extensions, which is perhaps part of the problem:

Of note, I'm not currently getting suggestions from the Python / Pylance extensions either, which hints that perhaps the Quick Fix mechanism in VSCode is somehow getting into some kind of infinite loop or something. This might not be a Sourcery problem at all, if Sourcery is dependent on the VSCode Quick Fix mechanism

Hellebore commented 1 year ago

Wow that's quite a few! Yes we do use the quick fix mechanism (we work via the language server protocol).

Something to try would be disabling other extensions, or possibly looking into: https://code.visualstudio.com/blogs/2021/02/16/extension-bisect

dewilcox commented 1 year ago

@Hellebore

If I turn off the Python extension (which turns off several Python-related extensions), then the Quick Fix mechanism works again and Sourcery allows me to apply refactorings. Thank you for your support and I apologize for filing a spurious bug.