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

Introduction of unwanted changes to launch.json #537

Closed
bersbersbers opened this issue Jan 21, 2021 · 5 comments
Closed

Introduction of unwanted changes to launch.json #537

bersbersbers opened this issue Jan 21, 2021 · 5 comments
Assignees

Comments

@bersbersbers
Copy link

Installation/use of https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack reformats the launch.json file when adding its launch configs, thereby removing trailing commas (no big deal) and comments (BIG DEAL). I cannot say for sure when it happened, but it was around installation and short running/debugging a hello-world-example in Java. If people don't have their latest changes to comments in launch.json committed to version control, they are lost.

Environment:

  • VS Code Version: 1.52.1
  • Extension Version: 0.12.1
  • JDK Type & Version: irrelevant, I think
  • OS Type & Version: Linux

Step to Reproduce:

  • Work in a workspace with a launch.json having comments
  • Install extension

Expected Behavior:

  • Comments remain in launch.json

Actual Behavior:

  • Comments are removed from launch.json
@akaroml
Copy link
Member

akaroml commented Mar 22, 2021

@bersbersbers to help us investigate, would you please provide more info on the actual contents that are added to the launch.json file. With that we'll be able to identify the actual extension that is causing the problem.

@bersbersbers
Copy link
Author

Today, I was able to repro this by selecting

image

and choosing Java - hope this helps:

image

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Launch Current File",
            "request": "launch",
            "mainClass": "${file}"
        }
    ]
}

image

@testforstephen
Copy link
Contributor

Created an issue at VS Code to track it since our debugger extension is reusing VS Code API to read and update launch.json.
microsoft/vscode#119439

@bersbersbers
Copy link
Author

Thanks! I have to admit that when I tested briefly this morning, I only verified that a launch config is added that way - but in fact, the comments from launch.json are not removed. I cannot say whether that is due to improvements to VS Code between 1.52.1 and 1.54.3, or due to a different mechanism responsible for what I observed in January.

@bersbersbers
Copy link
Author

bersbersbers commented Mar 23, 2021

microsoft/vscode#110295 has repro steps, also showing why #537 (comment) does not repro the issue.

Follow microsoft/vscode#29453 for progress, Thanks!

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

3 participants