Component Template Formatting & Auto Complete
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angular, typescript
- Domain
- tooling
Research direction
No files, tests, or entry points are named in the issue. Start by locating the Sublime plugin's handling for Angular component templates, formatting, and autocomplete; done means preserving template formatting and providing useful element completion inside the template.
Written by the indexing model from the issue text.
Description
I don't think these are bugs, just a features that are missing/needed/would be super nice to have.
Component Template Formatting
When inside of a @Component using `` it does not respect the formatting and always removes it when formatting your code. In VisualStudio Code it doesn't format the code automatically, but it does respect the formatting you give it. In Sublime it just aligns everything on one level for almost everything. Some things like [ngClass] it does indent, but most other things do not. This formatting does seem to work for "Styles", but not "template".
Ex.
import {Component, Input} from 'angular2/core';
@Component({
selector: 'zippy',
styles: [`
.zippy {
border: 1px solid #ccc;
border-radius: 2px;
}
.zippy .zippy-title {
padding: 20px;
font-weight: bold;
}
.zippy .zippy-title:hover{
background: #f0f0f0;
cursor: pointer;
}
.zippy .zippy-content {
padding: 20px;
}
`],
template: `
<div class="zippy">
<div
class="zippy-title"
(click)="toggle()">
{{ title }}
<i
class="pull-right glyphicon"
[ngClass]="
{
'glyphicon-chevron-down': !isExpanded,
'glyphicon-chevron-up': isExpanded
}">
</i>
</div>
<div *ngIf="isExpanded" class="zippy-content">
<ng-content></ng-content>
</div>
</div>
`
})
export class ZippyComponent {
isExpanded = false;
@Input() title: string;
toggle() {
this.isExpanded = !this.isExpanded;
}
}
Auto Complete
Again when inside of @Component "template" auto-complete does not exist, which gets very cumbersome very fast. It would be nice if there was a way to have elements auto complete here.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 236
- Avg merge
- 21d 13h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
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.
More from microsoft/TypeScript-Sublime-Plugin
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
microsoft/TypeScript-Sublime-Plugin#786 · 3 comments · 45 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/TypeScript-Sublime-Plugin#782 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoft/TypeScript-Sublime-Plugin#781 · 7 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/TypeScript-Sublime-Plugin#779 · 1 comment ·
All issues in microsoft/TypeScript-Sublime-Plugin
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100