-
Notifications
You must be signed in to change notification settings - Fork 23
Feat code actions #22
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
Conversation
on the topic of code-action vs formatting: I'm coming from I'm wondering if any opinions on that ? |
Nice changes! On the formatting vs. code action part: |
thanks for the quick response. (sorry in advance for the amount of text) i would like to keep the scope of this PR as it is (that is, exposing the individual fixes as proposed by ruff). i would be willing to send some more PRs, some ideas are described further down. this PRthis is what i want to do in the scope of this PR:
fixAllwhen having fixAll fix all the problems in the current file, i guess it would be best to let ruff do that itself, instead of trying to do that with reason being: ruff already respects fixable coming from the config. formattingi like the idea of regarding the default-codes, i think it makes sense to define a default for the repo "improvements"I'm proposing the following changes to the repo itself:
code improvementsSince mypy is a already setup in pre-commit, I'm proposing:
|
9cae0ff
to
2a1134e
Compare
Nice ideas in all, let's create new issues from your ideas to discuss. Specifically for the code base improvements I think we should discuss this to be done in |
i do agree, that it would be best if what are your opinions on what i wrote regarding fixall and formatting? |
You're right about the "Fix All" part, but we should nevertheless respect the user pylsp config settings, e.g. |
I'll start creating some issues. |
fa66a39
to
1ee45eb
Compare
fyi: i just found out about lsprotocol which is coming from upstream (microsoft), also uses so i changed this PR accordingly |
Yeah, |
1ee45eb
to
ccd8c57
Compare
ok. this now has some more code-actions:
|
|
sorry for the long delay, i was caught up in things. I'll try to get the tests done sometime within the next week. i was trying to get the formatting stuff in here also. but then i figured out that seems to require some more refactoring. so that's out of scope here now and will come as a separate PR. |
Yeah , good idea moving the code format to another PR. |
I will try to get this sorted. quick question tho: is it possible to change the configuration so that the pipeline run doesnt need your approval everytime? |
Found the issue... |
I reverted from using |
I added some tests for the code actions, PTAL if you see anything else @betaboon |
I'm just coming back to this seeing that you got pretty much everything done. awesome. thanks a bunch. I'm still curious why edit: |
e071cd2
to
cb1224e
Compare
Sorry, I forgot to push the new tests. Please review the unit tests if anything is missing, otherwise let's get this pushed! |
c90f745
to
0ede29a
Compare
0ede29a
to
8dfe5a6
Compare
i cleaned up the branch. |
seems it did not support some kinds of err, right? def f():
pass
ff() would not prompt code action for |
@Shane-XB-Qian That's because |
resolves #3
i tried my hand at surfacing the fixes that ruff proposes as code-actions.
i didn't yet add a fixAll action, as i was unsure about the semantics: