Skip to content

JSON default snippets should respect indentation in file #19508

Closed

Description

  • 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

Activity

  1. added
    debug
    on Jan 27, 2017
  2. changed the title [-]Add Configuration messes with tabs and spaces and formats incorrect[/-] [+]JSON default snippets should respect indentation in file[/+] on Feb 1, 2017
  3. isidorn commented on Feb 1, 2017

    @isidorn

    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 Martin Aeschlimann (@aeschli)

  4. aeschli commented on Feb 7, 2017

    @aeschli
    Contributor

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

  5. jrieken commented on Feb 21, 2017

    @jrieken
    Contributor

    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

  6. jrieken commented on Feb 21, 2017

    @jrieken
    Contributor

    feb-21-2017 14-39-44

  7. added
    feature-request
    on Apr 13, 2017
  8. weinand commented on Nov 16, 2017

    @weinand
    Contributor

    This sounds like a bug to me.

  9. added
    bug
    and removed
    feature-request
    on Nov 16, 2017
  10. locked and limited conversation to collaborators on Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdebug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions