microsoft / microsoft/TypeScript
Disable formatting a region of code using directives
Open
Nobody has claimed this yet.
Awaiting More Feedback
Domain: Formatter
Suggestion
VS Code Tracked
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
From: https://github.com/Microsoft/vscode/issues/33772
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
Feature Request
Add a way to disable formatting of a region of code. An example of this is js beatuify's preserve directive:
// Use preserve when the content is not javascript, but you don't want it reformatted.
/* beautify preserve:start */
{
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
}
/* beautify preserve:end */
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or entry point is named. Start by reading the linked VS Code issue and the js-beautify preserve-directive example, then trace TypeScript's formatting entry points. Done means a directive-delimited region remains unformatted while surrounding code is formatted, with tests covering the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100