Skip to content

Commit

Permalink
fix(auto-complete): replace text instead of inserting snippet only, r…
Browse files Browse the repository at this point in the history
…esolves #37
  • Loading branch information
Erik Lieben committed Feb 15, 2017
1 parent e57dbea commit e81e515
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/server/aurelia-languageservice/services/htmlCompletion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TextDocument, Position, CompletionList, CompletionItemKind, Range, InsertTextFormat } from 'vscode-languageserver-types';
import { TextDocument, Position, CompletionList, CompletionItemKind, Range, InsertTextFormat, TextEdit } from 'vscode-languageserver-types';
import { HTMLDocument } from '../parser/htmlParser';
import { TokenType, createScanner, ScannerState } from '../parser/htmlScanner';
import { getAureliaTagProvider } from '../parser/aureliaTagProvider';
Expand Down Expand Up @@ -48,7 +48,6 @@ export function doComplete(document: TextDocument, position: Position, htmlDocum
documentation: label,
kind: CompletionItemKind.Property,
label: tag,
//range,
});
});
return result;
Expand All @@ -67,12 +66,12 @@ export function doComplete(document: TextDocument, position: Position, htmlDocum
if (type !== 'v' && value.length) {
codeSnippet = codeSnippet + value;
}

result.items.push({
insertText: codeSnippet,
textEdit: TextEdit.replace(range, codeSnippet),
kind: type === 'handler' ? CompletionItemKind.Function : CompletionItemKind.Value,
label: attribute,
insertTextFormat : InsertTextFormat.Snippet
//range,
});
});
return result;
Expand Down

0 comments on commit e81e515

Please sign in to comment.