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

Wrong VSCode launch.json after au new -u -s http2,dotnet-core,typescript,htmlmin-min,vscode,scaffold-navigation #1135

Open
alexdresko opened this issue Jul 8, 2019 · 1 comment

Comments

@alexdresko
Copy link

I'm submitting a bug report

  • Library Version:
    Local aurelia-cli v1.0.2

Please tell us about your environment:
Windows 10

PS C:\code\test\au-css\aurelia-app> node -v
v12.3.1
PS C:\code\test\au-css\aurelia-app> npm -v
6.9.0

  • Browser:
    Chrome

  • Language:
    TypeScript

  • Loader/bundler:
    Webpack

Current behavior:

  1. au new aurelia-app -u -s http2,dotnet-core,typescript,htmlmin-min,vscode,scaffold-navigation

The following launch.json is created:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Chrome",
      "type": "chrome",
      "request": "launch",
      "url": "http://localhost:8080",
      "webRoot": "${workspaceRoot}/src",
      "userDataDir": "${workspaceRoot}/.chrome",
      "sourceMapPathOverrides": {
        "webpack:///./src/*": "${webRoot}/*"
      }
    }
  ]
}

Ideally, since I created this as an ASP.NET Core application, I should be able to open the new application in VSCode and press F5 to launch and debug the application. However, this launch.json file isn't correct for an ASP.NET Core application.

To get around the problem, I perform the following steps:

  1. delete launch.json

  2. shut down VSCode.

  3. start VSCode

  4. VSCode prompts again to create the file:
    image

  5. VSCode produces the correct launch.json:

    {
       // Use IntelliSense to find out which attributes exist for C# debugging
       // Use hover for the description of the existing attributes
       // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
       "version": "0.2.0",
       "configurations": [
            {
                "name": ".NET Core Launch (web)",
                "type": "coreclr",
                "request": "launch",
                "preLaunchTask": "build",
                // If you have changed target frameworks, make sure to update the program path.
                "program": "${workspaceFolder}/bin/Debug/netcoreapp2.1/project.dll",
                "args": [],
                "cwd": "${workspaceFolder}",
                "stopAtEntry": false,
                // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
                "serverReadyAction": {
                    "action": "openExternally",
                    "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"                
                },
                "env": {
                    "ASPNETCORE_ENVIRONMENT": "Development"
                },
                "sourceFileMap": {
                    "/Views": "${workspaceFolder}/Views"
                }
            },
            {
                "name": ".NET Core Attach",
                "type": "coreclr",
                "request": "attach",
                "processId": "${command:pickProcess}"
            }
        ]
    }
    
  • What is the expected behavior?
    VSCode should probably create the correct JSON file out of the box.

  • What is the motivation / use case for changing the behavior?
    It's not a very good developer experience for someone who is just getting started with Aurelia. It's not necessarily Aurelia's fault, but something is causing the wrong file to be created.

I suppose the reason for the existing launch.json file could be to support an au run scenario, but that doesn't feel like the typical development workflow for someone using VSCode.

@3cp
Copy link
Member

3cp commented Sep 16, 2019

Thx. If you would like to open a PR, @brandonseydel can help to review the change.
You might need some condition to skip non-dotnet app.

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

No branches or pull requests

2 participants