dotnet / dotnet/vscode-csharp

Proposal: allow initiating compound in launch/task asset

Open
#4,433 0 comments 0 reactions 0 assignees View on GitHub
Launch and Task Assets
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

## Environment data
`dotnet --info` output:
- Version: 5.0.3
- Commit: c636bbdc8a
VS Code version: 1.54.1
C# Extension version: 1.23.9

## OmniSharp log

## Steps to reproduce

1. delete .vscode
2. create two net5.0 projects under the same `sln` file.
3. press F5
4. select a project to initiate launch.json/task.json
5. the pop-up has no "Compound (all the project above)" to choose

## Expected behavior

the pop-up has "Compound (all the project above)" to choose

## Actual behavior

the pop-up has no "Compound (all the project above)" to choose

## Context

I find the logic in `asset.ts`/`selectStartupProject()`. But the method strongly couples to select a single project at a time. If supporting this proposal, the logic might need to stay at a new method.

Besides, the configuration might need to change its name to avoid naming collapse:

```ts
export function createWebLaunchConfiguration(programPath: string, workingDirectory: string): string {
const configuration = {
"OS-COMMENT1": "Use IntelliSense to find out which attributes exist for C# debugging",
"OS-COMMENT2": "Use hover for the description of the existing attributes",
"OS-COMMENT3": "For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md",
"name": `.NET Core Launch (web) ${util.convertNativePathToPosix(workingDirectory)}`,
"type": "coreclr",
"request": "launch",
"preLaunchTask": `build_${util.convertNativePathToPosix(workingDirectory)}`,
"OS-COMMENT4": "If you have changed target frameworks, make sure to update the program path.",
"program": `${util.convertNativePathToPosix(programPath)}`,
"args": Array(0),
"cwd": `${util.convertNativePathToPosix(workingDirectory)}`,
"stopAtEntry": false,
"OS-COMMENT5": "Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "\${workspaceFolder}/Views"
}
};

return JSON.stringify(configuration);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.