Skip to content

refactor and fix bugs in CodeActionProvider#1753

Merged
DetachHead merged 6 commits intoDetachHead:mainfrom
NCBM:fix-dup-codeactions
Mar 17, 2026
Merged

refactor and fix bugs in CodeActionProvider#1753
DetachHead merged 6 commits intoDetachHead:mainfrom
NCBM:fix-dup-codeactions

Conversation

@NCBM
Copy link
Copy Markdown
Contributor

@NCBM NCBM commented Mar 15, 2026

  1. reorganize every sub-operations to individual functions. this also fixes some actions missing due to early returns.
  2. fix corrupt action order due to previous refactoring. now they can keep an order of "imports" - "regular fixes" - "ignore comments".
  3. ignore comment action for reportImportCycles rule is forbidden now due to unstable behavior (see # pyright: ignore[reportImportCycles] doesn't work #1312)

1. reorganize every sub-operations to individual functions. this also fixes some actions missing due to early returns.
2. fix corrupt action order due to previous refactoring. now they can keep an order of "imports" - "regular fixes" - "ignore comments".
Copy link
Copy Markdown
Owner

@DetachHead DetachHead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! i wanted to split these code actions up into separate methods for a while

Comment thread packages/pyright-internal/src/languageService/codeActionProvider.ts Outdated
Comment thread packages/pyright-internal/src/languageService/codeActionProvider.ts Outdated
Comment thread packages/pyright-internal/src/languageService/codeActionProvider.ts
Comment thread packages/pyright-internal/src/languageService/codeActionProvider.ts Outdated
@github-actions

This comment has been minimized.

- remove redundant comments
- disable ignore comment action for `reportImportCycles`
@NCBM NCBM requested a review from DetachHead March 15, 2026 13:32
Comment thread packages/pyright-internal/src/languageService/codeActionProvider.ts
@github-actions

This comment has been minimized.

Comment thread packages/pyright-internal/src/languageService/codeActionProvider.ts Outdated
@github-actions

This comment has been minimized.

@DetachHead DetachHead enabled auto-merge (squash) March 17, 2026 12:17
@DetachHead DetachHead disabled auto-merge March 17, 2026 12:18
@DetachHead DetachHead merged commit 8ebb5af into DetachHead:main Mar 17, 2026
14 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

2 participants