Skip to content

Commit d76e758

Browse files
committed
feat(ls): provide completions in template string
fix: convert change offsets correctly
1 parent 2486fda commit d76e758

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

client/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ng-template",
33
"displayName": "Angular Template",
44
"description": "Angular Template Service",
5-
"version": "0.0.4",
5+
"version": "0.0.5",
66
"publisher": "Google",
77
"engines": {
88
"vscode": "^1.4.0"
@@ -12,7 +12,8 @@
1212
],
1313
"activationEvents": [
1414
"onLanguage:ng-template",
15-
"onLanguage:html"
15+
"onLanguage:html",
16+
"onLanguage:typescript"
1617
],
1718
"main": "./out/extension",
1819
"contributes": {
@@ -26,7 +27,8 @@
2627
],
2728
"extensions": [
2829
".ng",
29-
".ngml"
30+
".ngml",
31+
".ng.html"
3032
],
3133
"configuration": "./language-configuration.json"
3234
}

client/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function activate(context: ExtensionContext) {
2121
// Options to control the language client
2222
let clientOptions: LanguageClientOptions = {
2323
// Register the server for Angular templates
24-
documentSelector: ['ng-template', 'html'],
24+
documentSelector: ['ng-template', 'html', 'typescript'],
2525

2626
// Information in the TypeScript project is necessary to generate Angular template completions
2727
synchronize: {

server/src/documents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ export class TextDocuments {
182182
if (positions) {
183183
this.changeNumber++;
184184
const mappedChanges = event.contentChanges.map((change, i) => {
185-
const start = positions[i % 2];
186-
const end = positions[i % 2 + 1];
185+
const start = positions[i * 2];
186+
const end = positions[i * 2 + 1];
187187
return {start, end, insertText: change.text};
188188
});
189189
this.projectService.clientFileChanges(file, mappedChanges);

0 commit comments

Comments
 (0)