microsoft / microsoft/TypeScript

auto align colons in object literals, variables, and equals like WebStorm

Open
#11,865 25 comments 48 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion VS Code Tracked
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

From @kinergy on October 17, 2016 2:56

  • VSCode Version: 1.6.1
  • OS Version: macOS 10.12

Using Format Code on a js file:

var abcde = 'abcde',
    def   = {
      a : 'aaa',
      bb: 'b'
    };

turns into:

var abcde = 'abcde',
  def = {
    a: 'aaa',
    bb: 'b'
  };

It would be really nice to have a setting to align the beginning of var names, align the equals, and align the colons in object literals like WebStorm. I tried looking for an extension, but wasn't able to identify one.

Copied from original issue: Microsoft/vscode#13841

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported Format Code behavior with the JavaScript example in the issue and compare it with the requested WebStorm-style alignment. Define how variable names, equals signs, and object-literal colons should align, then identify the formatter entry points and tests needed to verify the setting and its completed output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.