Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cereschen committed Aug 20, 2020
1 parent 833c374 commit 76e5573
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions server/src/modes/template/services/htmlCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function doComplete(

const offset = document.offsetAt(position);
const node = htmlDocument.findNodeBefore(offset);
if (!node || node.isInterpolation) {
if (!node || (node.isInterpolation && offset <= node.end)) {
return result;
}

Expand Down Expand Up @@ -285,11 +285,15 @@ export function doComplete(
break;
case TokenType.AttributeValue:
if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) {
return collectAttributeValueSuggestions(
currentAttributeName,
scanner.getTokenOffset(),
scanner.getTokenEnd()
);
if (currentAttributeName === 'style') {
return emmet.doComplete(document, position, 'css', emmetConfig);
} else {
return collectAttributeValueSuggestions(
currentAttributeName,
scanner.getTokenOffset(),
scanner.getTokenEnd()
);
}
}
break;
case TokenType.Whitespace:
Expand Down

0 comments on commit 76e5573

Please sign in to comment.