Skip to content

fix(vscode): Use single source of truth for .vscode files generation#9399

Open
andrew-eldridge wants to merge 6 commits into
mainfrom
aeldridge/vscodeFilesRefresh
Open

fix(vscode): Use single source of truth for .vscode files generation#9399
andrew-eldridge wants to merge 6 commits into
mainfrom
aeldridge/vscodeFilesRefresh

Conversation

@andrew-eldridge

@andrew-eldridge andrew-eldridge commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Introduces new single source of truth for .vscode files (tasks.json, launch.json, settings.json, extensions.json). Previously there were multiple implementations of .vscode file generation and re-generation which mostly had the same behavior with some inconsistencies between implementations. Consolidating to simplify the code and prevent these from diverging again.

Impact of Change

  • Users: Fixes some edge case bugs in .vscode file generation depending on project type
  • Developers: Adds central source of truth for each .vscode file
  • System: N/A

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:

Contributors

@andrew-eldridge

@andrew-eldridge andrew-eldridge added the VSCode Issues or PRs specific to VS Code extension label Jul 15, 2026
Copilot AI review requested due to automatic review settings July 15, 2026 03:55
@andrew-eldridge andrew-eldridge added the risk:medium Medium risk change with potential impact label Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(vscode): Use single source of truth for .vscode files generation
  • Issue: None — uses a valid fix: prefix with scope and is descriptive.
  • Recommendation: No change needed.

Commit Type

  • Exactly one type selected (fix), which matches the title prefix.
  • No overloading detected.

Risk Level

  • Declared Medium (body + risk:medium label) matches the advised estimate. This consolidates .vscode file generation in the apps/vs-code-designer extension distribution, which ships to users — squarely Medium per the rubric. Label and body are consistent.

What & Why

  • Current: Clear explanation of consolidating multiple divergent .vscode generation implementations into a single source of truth.
  • Issue: None.
  • Recommendation: No change needed.

Impact of Change

  • All three audiences addressed (Users, Developers; System marked N/A which is acceptable).
  • Recommendation:
    • Users: Fixes edge-case .vscode generation bugs by project type.
    • Developers: Central source of truth via generators for each .vscode file.
    • System: N/A (acceptable).

Test Plan

  • Unit tests updated (confirmed in diff — CreateLogicAppVSCodeContents.test.ts, integration test, and removed obsolete tests refactored to the generator approach). Manual testing also checked. Passes CHECK TESTS.

Contributors

  • @andrew-eldridge credited.

⚠️ Screenshots/Videos

  • Not provided. This change touches apps/vs-code-designer config-generation logic, not designer-ui/designer/vs-code-react visual UI, so screenshots are not required. Add before/after generated JSON snippets if helpful, but not blocking.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level Medium is correct
What & Why No change needed
Impact of Change No change needed
Test Plan Unit tests present
Contributors Credited
Screenshots/Videos ⚠️ Optional — non-visual change

All required checks pass. This PR is compliant and cleared to merge.


Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Thu, 16 Jul 2026 04:17:36 GMT

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Check

The following changed files need attention:

apps/vs-code-designer/src/app/commands/initProjectForVSCode/initProjectLanguageStep.ts - 0% covered
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initProjectStepBase.ts - 0% covered

⚠️ apps/vs-code-designer/src/app/utils/customCodeUtils.ts - 78% covered (needs improvement)
⚠️ apps/vs-code-designer/src/app/utils/debug.ts - 7% covered (needs improvement)
⚠️ apps/vs-code-designer/src/app/utils/dotnet/dotnet.ts - 59% covered (needs improvement)

Please add tests for the uncovered files before merging.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates VS Code .vscode configuration generation (especially tasks.json) into a single generator implementation, and updates project-type modeling/detection so creation and regeneration paths share the same source of truth.

Changes:

  • Introduces a canonical generateTasksJson() implementation and migrates existing tasks.json writers to use it.
  • Renames WorkflowProjectTypeProjectPackageType and updates wizard context fields accordingly.
  • Adds/updates project detection helpers and adjusts unit/integration tests + VS Code mocks to support the new flows.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
libs/vscode-extension/src/lib/models/workflow.ts Renames workflow packaging model constant/type to ProjectPackageType.
libs/vscode-extension/src/lib/models/project.ts Updates wizard context field to projectPackageType.
apps/vs-code-designer/test-setup.ts Improves VS Code configuration mocking for tests.
apps/vs-code-designer/src/app/utils/vsCodeConfig/tasks.ts Switches tasks regeneration to use the shared generator + adds best-effort target framework lookup.
apps/vs-code-designer/src/app/utils/vsCodeConfig/generators/types.ts Adds types for generator inputs/outputs.
apps/vs-code-designer/src/app/utils/vsCodeConfig/generators/tasksGenerator.ts Adds the canonical tasks.json generator.
apps/vs-code-designer/src/app/utils/vsCodeConfig/generators/index.ts Exposes generator APIs.
apps/vs-code-designer/src/app/utils/vsCodeConfig/generators/test/tasksGenerator.test.ts Adds unit tests for generateTasksJson().
apps/vs-code-designer/src/app/utils/project.ts Adds shared detection for ProjectType and ProjectPackageType.
apps/vs-code-designer/src/app/utils/codeless/validateProjectArtifacts.ts Uses shared project-type detection during regeneration.
apps/vs-code-designer/src/app/utils/codeless/test/validateProjectArtifacts.test.ts Updates tests to match new detection behavior.
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initScriptProjectStep.ts Removes older script-specific .vscode task generation path.
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initProjectStepBase.ts Updates task input merge logic to use the new package-type field.
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initProjectStep.ts Uses generateTasksJson() for bundle projects.
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initProjectLanguageStep.ts Sets context.projectPackageType based on language.
apps/vs-code-designer/src/app/commands/initProjectForVSCode/initDotnetProjectStep.ts Uses generateTasksJson() for Nuget projects.
apps/vs-code-designer/src/app/commands/enableDevContainer/test/enableDevContainerIntegration.test.ts Adjusts assertions + VS Code config mocks for new generated tasks structure.
apps/vs-code-designer/src/app/commands/createProject/createCustomCodeProjectSteps/initCustomCodeScriptProjectStep.ts Removes older custom-code script-specific task generation path.
apps/vs-code-designer/src/app/commands/createProject/createCustomCodeProjectSteps/initCustomCodeProjectStepBase.ts Uses generateTasksJson() for custom code project tasks overwrite.
apps/vs-code-designer/src/app/commands/createProject/createCustomCodeProjectSteps/initCustomCodeProjectStep.ts Uses generateTasksJson() for custom code tasks.
apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppVSCodeContents.ts Writes tasks.json via generator instead of templates.
apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/test/CreateLogicAppWorkspaceIntegration.test.ts Mocks binaries detection to avoid VS Code API coupling in tests.
apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/test/CreateLogicAppVSCodeContents.test.ts Updates tests to validate generator-written tasks.json.


private insertNewTaskInputs(context: IProjectWizardContext, existingInputs: ITaskInputs[] = [], newInputs: ITaskInputs[]): ITaskInputs[] {
if (context.workflowProjectType === WorkflowProjectType.Bundle) {
if (context.projectPackageType === ProjectPackageType.Bundle) {
Comment on lines 101 to 109
protected getTasks(): TaskDefinition[] {
const commonArgs: string[] = ['/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'];
const releaseArgs: string[] = ['--configuration', 'Release'];
const funcBinariesExist = binariesExistSync(funcDependencyName);
const binariesOptions = funcBinariesExist ? getFuncHostTaskEnv({ cwd: this.debugSubpath }) : {};
return [
{
label: 'clean',
command: '${config:azureLogicAppsStandard.dotnetBinaryPath}',
args: ['clean', ...commonArgs],
type: 'process',
problemMatcher: '$msCompile',
},
{
label: 'build',
command: '${config:azureLogicAppsStandard.dotnetBinaryPath}',
args: ['build', ...commonArgs],
type: 'process',
dependsOn: 'clean',
group: {
kind: 'build',
isDefault: true,
},
problemMatcher: '$msCompile',
},
{
label: 'clean release',
command: '${config:azureLogicAppsStandard.dotnetBinaryPath}',
args: ['clean', ...releaseArgs, ...commonArgs],
type: 'process',
problemMatcher: '$msCompile',
},
{
label: dotnetPublishTaskLabel,
command: '${config:azureLogicAppsStandard.dotnetBinaryPath}',
args: ['publish', ...releaseArgs, ...commonArgs],
type: 'process',
dependsOn: 'clean release',
problemMatcher: '$msCompile',
},
{
label: 'func: host start',
type: funcBinariesExist ? 'shell' : func,
dependsOn: 'build',
...binariesOptions,
command: funcBinariesExist ? '${config:azureLogicAppsStandard.funcCoreToolsBinaryPath}' : hostStartCommand,
args: funcBinariesExist ? ['host', 'start'] : undefined,
isBackground: true,
problemMatcher: funcWatchProblemMatcher,
},
];
const { tasks } = generateTasksJson({
projectType: ProjectType.logicApp,
projectPackageType: ProjectPackageType.Nuget,
hasFuncBinaries: binariesExistSync(funcDependencyName),
targetFramework: this.targetFramework,
});
return tasks as TaskDefinition[];
}
Comment thread apps/vs-code-designer/src/app/utils/vsCodeConfig/tasks.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact VSCode Issues or PRs specific to VS Code extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants