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

JSON default snippets should respect indentation in file #19508

Closed
dbaeumer opened this issue Jan 27, 2017 · 5 comments
Closed

JSON default snippets should respect indentation in file #19508

dbaeumer opened this issue Jan 27, 2017 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues
Milestone

Comments

@dbaeumer
Copy link
Member

  • VSCode Version: 1.9
  • OS Version: Windows

Steps to Reproduce:

  1. Launch config
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations":
   [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${workspaceRoot}/bin/www",
      "cwd": "${workspaceRoot}"
    },
    {
      "type": "node",
      "request": "attach",
      "name": "Attach to Process",
      "port": 5858
    }
  ]
}
  1. Add Configuration, pick Launch via npm

You get

capture

@dbaeumer dbaeumer added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jan 27, 2017
@isidorn isidorn added this to the February 2017 milestone Jan 27, 2017
@isidorn isidorn changed the title Add Configuration messes with tabs and spaces and formats incorrect JSON default snippets should respect indentation in file Feb 1, 2017
@isidorn
Copy link
Contributor

isidorn commented Feb 1, 2017

Currently each debug extension contributes these snippets but the formating is done in the JSON world. To be more precise, each of these snippets is a default snippet in a json schema.
When inserting snippets json schema should respect the indentation of the file, thus forwarding to @aeschli

@isidorn isidorn modified the milestones: Backlog, February 2017 Feb 1, 2017
@isidorn isidorn assigned aeschli and unassigned isidorn Feb 1, 2017
@aeschli
Copy link
Contributor

aeschli commented Feb 7, 2017

Insertion of snippets is done in the SnippetControler. It is my understanding that the code there applies the correct indentation and indentation characters.

@aeschli aeschli assigned jrieken and unassigned aeschli Feb 7, 2017
@jrieken jrieken assigned isidorn and unassigned jrieken Feb 21, 2017
@jrieken
Copy link
Member

jrieken commented Feb 21, 2017

The snippet controller takes the indentation of the cursor and massages the snippet according to that. It seems like the 'Add Configuration' command doesn't always adjust the cursor properly before insert the snippet, for instance when at column 0

@jrieken
Copy link
Member

jrieken commented Feb 21, 2017

feb-21-2017 14-39-44

@isidorn isidorn added this to the Backlog milestone Mar 8, 2017
@isidorn isidorn added the feature-request Request for new features or functionality label Apr 13, 2017
@isidorn isidorn removed their assignment Oct 27, 2017
@weinand
Copy link
Contributor

weinand commented Nov 16, 2017

This sounds like a bug to me.

@weinand weinand added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Nov 16, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

5 participants