Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to launch.json/tasks.json #2780

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

gregg-miskelly
Copy link
Contributor

@gregg-miskelly gregg-miskelly commented Jan 5, 2019

This commit contains many improvements to our launch.json and task.json generation. Highlights:

  • Schema related changes:

    • Make most of the 'launchBrowser' attributes optional, remove the extra properties from the templates, and improve the schema
    • In the configuration resolver, add a default value for 'cwd' if we are local debugging
  • Generator related fixes:

    • Use a quick pick to allow the user to select which project to launch. Before we would always launch the first one OmniSharp returned.
    • Remove 'internalConsoleOptions' from the generated templates, and instead default it in the configuration resolver.
    • Fix several problems with regenerating launch/tasks.json in the case that the file already existed. We had code to delete the files and recreate it, but the logic was wrong leading us to sometimes duplicate content or not create the file at all.
    • Switch to using the '$tsc' problem matcher. We were using the '$msCompile' matcher, but that assumes that file names will be absolute paths, which isn't what 'dotnet build' provides.
    • Stop supporting project.json based projects for purposes of generating launch/tasks.json. Continuing to support these now that we let the user pick the startup project was going to be more work than it made sense to support.
    • In the case of generating launch.json through the configuration provider, we will no longer generate a set of generic configurations in error cases. We will now either use a fall back configuration which is designed to feel like an error, or we will put up an error prompt and return nothing.
    • Allow generating a tasks.json even if there is no launchable project. Note that we will not automatically generate a tasks.json in this case as I wasn't sure people would really like this, but the 'Generate Assets' command will force it.

Testing: Verified open folders/workspaces with the following conditions:

  • A single class library project
  • A single console app
  • A single ASP.NET app
  • A folder containing many launchable projects
  • A workspace with multiple folders, each of which has a launchable project

This fixes: #310, #2673 and #2703

@codecov
Copy link

codecov bot commented Jan 5, 2019

Codecov Report

Merging #2780 into master will decrease coverage by 0.27%.
The diff coverage is 30.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2780      +/-   ##
==========================================
- Coverage   65.13%   64.86%   -0.28%     
==========================================
  Files         104      104              
  Lines        4506     4505       -1     
  Branches      654      657       +3     
==========================================
- Hits         2935     2922      -13     
- Misses       1386     1396      +10     
- Partials      185      187       +2
Flag Coverage Δ
#integration 52.46% <30.76%> (-0.26%) ⬇️
#unit 86.18% <ø> (+0.62%) ⬆️
Impacted Files Coverage Δ
src/omnisharp/protocol.ts 89.74% <ø> (+4.24%) ⬆️
src/omnisharp/server.ts 69.49% <0%> (ø) ⬆️
src/assets.ts 47.47% <38.94%> (-2.53%) ⬇️
src/configurationProvider.ts 16.9% <8.82%> (-2.75%) ⬇️
src/omnisharp/delayTracker.ts 68.42% <0%> (-5.27%) ⬇️
src/features/diagnosticsProvider.ts 77.92% <0%> (-1.3%) ⬇️
src/common.ts 74.44% <0%> (+4.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 265499a...9323811. Read the comment docs.

src/tools/OptionsSchema.json Outdated Show resolved Hide resolved
src/assets.ts Outdated Show resolved Hide resolved
Copy link

@rchande rchande left a comment

Choose a reason for hiding this comment

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

Nice!

This commit contains many improvements to our launch.json and task.json generation. Highlights:

- Schema related changes:
  - Make most of the 'launchBrowser' attributes optional, remove the extra properties from the templates, and improve the schema
  - In the configuration resolver, add a default value for 'cwd' if we are local debugging

- Generator related fixes:
  - Use a quick pick to allow the user to select which project to launch. Before we would always launch the first one OmniSharp returned.
  - Remove 'internalConsoleOptions' from the generated templates, and instead default it in the configuration resolver.
  - Fix several problems with regenerating launch/tasks.json in the case that the file already existed. We had code to delete the files and recreate it, but the logic was wrong leading us to sometimes duplicate content or not create the file at all.
  - Switch to using the '$tsc' problem matcher. We were using the '$msCompile' matcher, but that assumes that file names will be absolute paths, which isn't what 'dotnet build' provides.
  - Stop supporting project.json based projects for purposes of generating launch/tasks.json. Continuing to support these now that we let the user pick the startup project was going to be more work than it made sense to support.
  - In the case of generating launch.json through the configuration provider, we will no longer generate a set of generic configurations in error cases. We will now either use a fall back configuration which is designed to feel like an error, or we will put up an error prompt and return nothing.
  - Allow generating a tasks.json even if there is no launchable project. Note that we will not automatically generate a tasks.json in this case as I wasn't sure people would really like this, but the 'Generate Assets' command will force it.
@gregg-miskelly gregg-miskelly merged commit b2581f6 into dotnet:master Jan 7, 2019
@gregg-miskelly gregg-miskelly deleted the SimplifyLaunchJson branch January 7, 2019 20:39
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.

Provide project selector to pick startup project
3 participants