Skip to content

Move Dart extension into extensions/dart/ and split root workspace config - #6488

Open
DanTupBot wants to merge 2 commits into
Dart-Code:masterfrom
DanTupBot:issue6471_fix
Open

DanTupBot wants to merge 2 commits into
Dart-Code:masterfrom
DanTupBot:issue6471_fix

Conversation

@DanTupBot

Copy link
Copy Markdown
Collaborator

IMPORTANT: THIS PR MUST BE REBASE-COMMITTED (DO NOT SQUASH-MERGE)

Caution

Do NOT use the Squash Merge Queue or Squash & Merge. Commit 1 (Move Dart extension files into extensions/dart/) is intentionally a pure git mv commit with zero content edits so git log --follow rename history stays intact (100% similarity) across small files and the 3,800-line package.json. Land this PR via rebase-commit / non-squash admin merge.

Fixes #6471
Part of #6439 (Step 2 of 9).

Summary

Commit 1: Pure git mv commit (f12442c8f)

  • Moved media/ (including the media/doc-icons submodule in .gitmodules, preserving [submodule "media/doc-icons"] with path = extensions/dart/media/doc-icons), src/extension/, src/debug/, package.json, snippets/, syntaxes/, telemetry.json, .vscodeignore, CHANGELOG.md, and README.md into extensions/dart/ (200 renames at 100% similarity).
  • Kept root LICENSE in place and copied it to extensions/dart/LICENSE.

Commit 2: Workspace wiring commit (8157cb282)

  • Manifests & READMEs:
    • Created minimal root package.json ("name": "dart-code-workspace", "private": true, omitting version/publisher/engines) with updated scripts, and synced package-lock.json (removing the stale top-level "version").
    • Made extensions/dart/package.json a pure extension manifest (no scripts, dependencies, devDependencies, optionalDependencies), added "repository.directory": "extensions/dart", and fixed contributes.debuggers[0].program to ./out/dist/debug.js.
    • Updated extensions/dart/.vscodeignore (src/**, out/src/**, out/extensions/**, **/*.map, *.vsix, **/.git, **/.gitattributes, **/.gitignore, media/screenshots/**).
    • Updated the snippets URL in extensions/dart/README.md (https://github.com/Dart-Code/Dart-Code/tree/master/extensions/dart/snippets) and created a contributor-facing root README.md linking to files (extensions/dart/README.md, CONTRIBUTING.md, docs/README.md).
  • Relative imports:
    • Updated ../shared/ prefixes across 92 files in extensions/dart/src/{extension,debug}/** to ../../../../src/shared/ (leaving from "../shared" for views/shared.ts untouched), updated extension_api imports in extension.ts / api/extension_api.ts, and updated the 3 debug helper imports in src/test/.
  • Build, TS, ESLint, Coverage, & Dev/Tests/CI:
    • Updated webpack.config.js to emit extensions/dart/out/dist/{extension,debug}.js with devtoolModuleFilenameTemplate: "../../../../[resource-path]" and onlyCompileBundledFiles: true.
    • Set "rootDir": "." and "outDir": "extensions/dart/out" in tsconfig.json (with extensions/dart/out excluded from TS/ESLint/Git/VS Code/vsce). Emitting compiled test/shared output inside extensions/dart/out/ ensures VS Code's Extension Host natively resolves require("vscode") in tests to Dart-Code.dart-code's API instance so Sinon stubs on vs.window / vs.commands / vs.debug intercept extension calls cleanly without any module-loader shims.
    • Updated eslint.config.js, codecov.yml, .gitignore, .vscode/settings.json, .vscode/launch.json, AGENTS.md, src/test/helpers.ts (repoRoot), src/test/dart/util.test.ts, src/test/test_all.ts, .github/workflows/build-and-test.yml (Lychee link_check globs), and .github/workflows/nightly-build.yml.

Operational Notes

  • Existing local clones with initialized submodules will need git submodule sync && git submodule update --init && rm -rf media/ after pulling.
  • Follow up promptly with Steps 3 & 4 before the daily 06:00 UTC Dart-Code/E2E-Tests run, and avoid cutting releases from Dart-Code/Dart-Code until Step 7 lands.

Verification

  • git log --follow confirmed across the move for extensions/dart/package.json and extensions/dart/CHANGELOG.md
  • npm run lint, npm run build, npm run build-tests, npx tsc --noEmit, npx tsc -p ./tsconfig.build.json --noEmit
  • npm run test-grammar (4/4 snapshots passed) & npm run find-duplicates
  • npm run vscode:prepublish, (cd extensions/dart && ../../node_modules/.bin/vsce ls --no-dependencies), and vsce package --no-dependencies smoke check (10,237 files, 9.94 MB; confirmed out/src/**, out/extensions/**, src/**, **/*.map, and media/screenshots/** are excluded)
  • Targeted BOT=dart tests (564 passing, 3 conditional pending), BOT=misc src/test/not_activated/dart_create/extension.test.ts (2 passing, 1 skipped), and BOT=dart npm run test:with-coverage src/test/dart/extension.test.ts (10 passing; lcov.info SF: paths verified under extensions/dart/src/extension/ and src/shared/)

@DanTupBot DanTupBot added is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix. non-functional Something that doesn't affect users and should be excluded from release notes labels Nov 25, 2026
@DanTupBot
DanTupBot requested a review from DanTup November 25, 2026 14:27
@DanTupBot DanTupBot added this to the v3.148.0 milestone Nov 25, 2026
@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.76%. Comparing base (22cccae) to head (8157cb2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6488      +/-   ##
==========================================
- Coverage   81.95%   81.76%   -0.19%     
==========================================
  Files         173      170       -3     
  Lines       14034    13993      -41     
  Branches     2879     2865      -14     
==========================================
- Hits        11501    11441      -60     
- Misses       2069     2086      +17     
- Partials      464      466       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DanTup DanTup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some feedback, but since this is quite big and will conflict with other PRs, I think we should wait until after the upcoming release before landing any of this (so this will need updating/rebasing to not lose any of those changes in these moves).


- name: vsce package
run: vsce package
run: (cd extensions/dart && ../../node_modules/.bin/vsce package --no-dependencies -o ../..)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did we add --no-dependencies?

Comment on lines +1 to +9
src/**
out/src/**
out/extensions/**
**/*.map
*.vsix
**/.git
**/.gitattributes
**/.gitignore
media/screenshots/**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why did so much of this file get removed? There are lots of things listed in the original file that might exist on users machines even if they're not on yours.

@DanTup DanTup modified the milestones: v3.148.0, v3.150.0 Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix. non-functional Something that doesn't affect users and should be excluded from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Step 2: Move Dart extension into extensions/dart/ and split root workspace config

2 participants