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

Ensure "Source Actions..." request includes the "source" kind #2064

Merged
merged 3 commits into from
Sep 23, 2022

Conversation

rchl
Copy link
Member

@rchl rchl commented Sep 22, 2022

Makes sure that the code action request that we make when triggering the "Source actions..." command explicitly includes "only": ["source"] kind.

Related to #1846 (comment)

(More readable diff with Hide whitespace changes enabled)

@jwortmann

@jwortmann
Copy link
Member

This looks good to me, but beside that I would also suggest the following changes (not necessarily in this PR):

  • remove the "Source Action..." entry from the context menu (because source actions are not bound to a particular point or selection, but apply to the entire file)
  • Add "LSP: Source Actions..." to the "Edit" main menu, and either add another argument full_range: bool = False (or so) for the code actions command, which would be activated for the source actions menu entry, or alternatively derive this from whether only_kinds includes "source". So that the request for source actions would use the range of the entire file and also include all of the diagnostics in the file (this could be useful for the source.fixAll kind)

@rchl rchl merged commit 337ce5e into main Sep 23, 2022
@rchl rchl deleted the fix/source-action branch September 23, 2022 19:52
@rchl
Copy link
Member Author

rchl commented Sep 23, 2022

Created #2066 as a follow up.

rchl added a commit that referenced this pull request Sep 24, 2022
* main:
  Ensure "Source Actions..." request includes the "source" kind (#2064)
rchl added a commit that referenced this pull request Sep 27, 2022
* main:
  Fix issues with diagnostics panel toggling on save (#2063)
  Request color presentations when clicking on a color box (#2065)
  Import new imports like NotRequired from "typing"
  Ensure "Source Actions..." request includes the "source" kind (#2064)
  refactor(types): Mark properties with NotRequired (#2062)
  Add template variable `$text_document_position` in execute command (#2061)
  Only update content of diagnostics panel when visible (#2054)
  Remove Range class and rename RangeLsp to Range (#2058)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants