Skip to content

refactor(code-action): reorganize code actions into dedicated files and test subdirectories#765

Merged
inclyc merged 3 commits into
mainfrom
feature/refactor-code-action
Jan 9, 2026
Merged

refactor(code-action): reorganize code actions into dedicated files and test subdirectories#765
inclyc merged 3 commits into
mainfrom
feature/refactor-code-action

Conversation

@takeokunn

@takeokunn takeokunn commented Jan 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR addresses the file structure suggestion from PR #764 review.

Commits

  1. refactor(code-action): extract code action implementations to dedicated files c68c266

    • Extract from CodeAction.cpp into Controller/CodeActions/ subdirectory
    • Create dedicated files: AttrName, FlattenAttrs, JsonToNix, NoogleDoc, PackAttrs, Utils
  2. test(code-action): reorganize test files into category subdirectories 078ba02

    • Move 63 test files into 6 category subdirectories
    • Categories: attr-name, flatten-attrs, json-to-nix, noogle-doc, pack-attrs, quick-fix

Motivation

The growing number of code actions warrants a dedicated subdirectory structure for better maintainability.

Testing

  • All unit tests pass
  • All regression tests pass

…ed files

Extract code action implementations from CodeAction.cpp into a dedicated
CodeActions/ subdirectory with separate files for each action type:

- AttrName.{h,cpp}: Quote/unquote attribute name actions
- FlattenAttrs.{h,cpp}: Flatten nested attribute set action
- JsonToNix.{h,cpp}: JSON to Nix conversion action
- NoogleDoc.{h,cpp}: Noogle documentation link action
- PackAttrs.{h,cpp}: Pack dotted paths to nested set actions
- Utils.{h,cpp}: Shared utilities (identifier validation, escaping, etc.)

This improves maintainability as the number of code actions grows,
following the suggestion from PR #764 review.
Move 63 test files from flat structure into category subdirectories
to improve discoverability and match the source code organization:

- attr-name/: Quote/unquote attribute name tests (14 files)
- flatten-attrs/: Flatten nested attribute set tests (7 files)
- json-to-nix/: JSON to Nix conversion tests (13 files)
- noogle-doc/: Noogle documentation link tests (4 files)
- pack-attrs/: Pack dotted paths tests (24 files)
- quick-fix/: Quick fix diagnostic tests (1 file)

This addresses the test directory organization suggested in PR #764 review.
@takeokunn takeokunn force-pushed the feature/refactor-code-action branch from bb39adb to 078ba02 Compare January 9, 2026 13:52
@takeokunn takeokunn marked this pull request as ready for review January 9, 2026 14:00
@takeokunn takeokunn requested a review from inclyc as a code owner January 9, 2026 14:00
@inclyc inclyc merged commit 628824e into main Jan 9, 2026
19 checks passed
@inclyc inclyc deleted the feature/refactor-code-action branch January 9, 2026 14:48
@inclyc inclyc added NFC No functional change nixd:controller labels Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NFC No functional change nixd:controller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants