Skip to content

feat(2280): Port implement interface quick fix#3499

Open
a-tarasyuk wants to merge 11 commits intomicrosoft:mainfrom
a-tarasyuk:feat/2280
Open

feat(2280): Port implement interface quick fix#3499
a-tarasyuk wants to merge 11 commits intomicrosoft:mainfrom
a-tarasyuk:feat/2280

Conversation

@a-tarasyuk
Copy link
Copy Markdown
Contributor

Fixes #2280

@a-tarasyuk a-tarasyuk marked this pull request as ready for review April 22, 2026 20:18
Copilot AI review requested due to automatic review settings April 30, 2026 21:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Ports/implements the “Implement interface” quick fix to address #2280, along with supporting infrastructure changes and updated baselines.

Changes:

  • Added a new code fix provider to implement missing interface/class members and supporting member generation utilities.
  • Extended the change tracker to support inserting members at the start of class/interface/object bodies with correct formatting.
  • Updated fourslash conversion/runtime to support range-based expected content and user preference overrides; refreshed relevant baselines.

Reviewed changes

Copilot reviewed 116 out of 120 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/ls/codeactions_fixclassincorrectlyimplementsinterface.go New code fix provider wiring + fix-all implementation for “Implement interface”.
internal/ls/codeactions_missingmemberfixer.go Core logic to synthesize missing members (methods/properties/accessors/index signatures) + auto-import support.
internal/ls/change/tracker.go Adds “insert-at-start” behavior and formatting adjustments to support new code fix output.
internal/fourslash/fourslash.go Extends code-fix verification to support range replacement and per-test user preferences.
internal/fourslash/_scripts/convertFourslash.mts Updates generator to allow the new fixId/prefix and emit new verification options.
internal/checker/* + internal/printer/* + internal/scanner/scanner.go Exposes helper APIs needed by the new code fix and adjusts error range behavior for class expressions.
testdata/* Baseline/acceptance list updates reflecting changed diagnostics ranges and comment placement.
Comments suppressed due to low confidence (5)

internal/ls/codeactions_missingmemberfixer.go:1

  • for i := range argCount does not compile in Go (you can’t range over an int). Replace this with an index loop such as for i := 0; i < argCount; i++ { ... } so the new code fix builds.
    internal/ls/codeactions_missingmemberfixer.go:1
  • This panic can crash the language server on malformed/partial ASTs (which is common while typing). Prefer returning no node / skipping this accessor (or surfacing a normal error) instead of panicking, so code actions remain robust.
    internal/fourslash/tests/gen/quickfixImplementInterfaceUnreachableTypeUsesRelativeImport_test.go:1
  • NewFileContent is empty, so the test will compare the post-edit content to "" and fail (unless the code fix somehow produces an empty file). Populate NewFileContent with the expected full file text after the fix, or use NewRangeContent if only a specific range should be asserted.
    internal/transformers/tstransforms/typeserializer.go:1
  • This helper was changed from unexported to exported, but (in this diff) it’s only used within this package/file and duplicates the new exported checker.GetSetAccessorValueParameter. Consider keeping it unexported (or adding a clear GoDoc and centralizing on the checker helper) to avoid unintentionally expanding the public surface area and creating duplicate APIs.
    internal/printer/utilities.go:1
  • This function is now exported but has no GoDoc comment. If this repo runs golint/staticcheck-style checks, this will be flagged; even if not, adding a short comment explaining the contract (e.g., whether it counts comments/trivia) will make the new API clearer.

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.

Port implement interface quick fix

2 participants