test(language-service): Remove all markers from test project (#37475)

This commit removes all markers from the inline template in
`AppComponent` and external template in `TemplateReference`.

Test scenarios should be colocated with the test cases themselves.
Besides, many existing cases are invalid. For example, if we want to
test autocomplete for HTML element, the existing test case is like:
```
<~{cursor} h1>
```
This doesn't make much sense, becasue the language service already sees
the `h1` tag in the template. The correct test case should be:
```
<~{cursor
```
IMO, this reflects the real-world use case better.

This commit also uncovers a bug in the way HTML entities autocompletion
is done. There's an off-by-one error in which a cursor that immediately
trails the ampersand character fails to trigger HTML entities
autocompletion.

PR Close #37475
This commit is contained in:
Keen Yee Liau
2020-06-05 22:42:35 -07:00
committed by atscott
parent ed3c549063
commit 650974e1b3
5 changed files with 60 additions and 57 deletions

View File

@ -15,16 +15,9 @@ export interface Hero {
@Component({
selector: 'my-app',
template: `~{empty}
<~{start-tag}h~{start-tag-after-h}1~{start-tag-h1} ~{h1-after-space}>
~{h1-content} {{~{sub-start}title~{sub-end}}}
</h1>
~{after-h1}<h2>{{~{h2-hero}hero.~{h2-name}name}} details!</h2>
<div><label>id: </label>{{~{label-hero}hero.~{label-id}id}}</div>
<div ~{div-attributes}>
<label>name: </label>
</div>
&~{entity-amp}amp;
template: `
<h1>{{title}}</h1>
<h2>{{hero.name}} details!</h2>
`
})
export class AppComponent {

View File

@ -1,7 +1,2 @@
~{empty}
<~{start-tag}h~{start-tag-after-h}1~{start-tag-h1} ~{h1-after-space}>
~{h1-content} {{~{sub-start}title~{sub-end}}}
</h1>
~{after-h1}<h2>{{~{h2-hero}hero.~{h2-name}name}} details!</h2>
<div><label>id: </label>{{~{label-hero}hero.~{label-id}id}}</div>
&~{entity-amp}amp;
<h1>{{title}}</h1>
<h2>{{hero.name}} details!</h2>