refactor: trim comments in the inline-script quick fix - #1789
Closed
Stella Huang (StellaHuang95) wants to merge 1 commit into
Closed
Stella Huang (StellaHuang95) wants to merge 1 commit into
Stella Huang (StellaHuang95) wants to merge 1 commit into
Conversation
Condenses the comments added in microsoft#1788 down to what is not obvious from the code: the deliberate inclusion of reportMissingModuleSource, the reason the routing metadata is reseeded after a save, and the reason the companion extension version check sits outside the try block. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Closing for now - not ready to review yet. |
Stella Huang (StellaHuang95)
deleted the
stellahuang-microsoft-inline-script-code-action
branch
September 16, 2026 01:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1788 (merged). That PR's comments were heavier than they needed to be; this trims them down to the handful that carry information the code does not.
No behavior change. Only comments and JSDoc are touched — 33 comment lines removed, 8 added back in condensed form, for a net reduction of 25.
What is kept, and why
Three comments survive because each documents a decision a reviewer would otherwise read as a bug:
reportMissingModuleSourceis in the unresolved-import code set. Pylance's ownisMissingImportDiagnostic()excludes it, because for their change-spelling fix a stub-resolved module is correctly spelled. For us, "stub found but no source" means the package is not installed, which setting the environment up fixes. Reduced from a 6-line block to a trailing comment on the line itself.# /// scriptblock gains its identity mid-create, whichsetUpInlineScriptEnvironmentreads as a concurrent edit and silently skips the association. Reduced 3 lines to 2.promptUpdateExtensionsForInlineScripts()sits outside thetry. The environment is already set up by that point, so a failure in the follow-up must not be surfaced to the user as a setup failure. Reduced 2 lines to 1.The class-level JSDoc on
InlineScriptSetupCodeActionProvideris kept at 3 lines — it still records thatdiagnosticsandisPreferredare deliberately unset, which is the non-obvious part of the design.What is removed
UNRESOLVED_IMPORT_DIAGNOSTIC_CODES.isUnresolvedImportDiagnostic, condensed to one line.provideCodeActionsgating-order comment — the gate order is legible from the code.findOpenDocumentandsaveScriptBeforeSetup. The repo convention asks for docstrings on public functions; these are module-private.Every exported symbol still carries a docstring, per
.github/copilot-instructions.md.Validation
npm run lint— cleannpm run compile-tests— cleannpm run unittest— 2323 passing, 6 pending, 0 failing (unchanged from baseline)The feature remains behind
python-envs.inlineScripts.enabled, so nothing here is user-visible.