Skip to content

Commit ab69471

Browse files
committed
fix: prevent emmet from expanding attribute name or vals
1 parent 44f8e25 commit ab69471

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • src/extensions/default/HTMLCodeHints

src/extensions/default/HTMLCodeHints/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ define(function (require, exports, module) {
9393
if (enabled) {
9494
this.editor = editor;
9595

96+
// check the context before showing emmet hints, because we don't want to show
97+
// emmet hints when its a Attribute name or value
98+
// cause for those cases AttrHints should handle it
99+
const pos = editor.getCursorPos();
100+
const tagInfo = HTMLUtils.getTagInfo(editor, pos);
101+
const tokenType = tagInfo.position.tokenType;
102+
103+
if (tokenType === HTMLUtils.ATTR_NAME || tokenType === HTMLUtils.ATTR_VALUE) {
104+
return false;
105+
}
106+
96107
const wordObj = getWordBeforeCursor(editor);
97108
// make sure we donot have empty spaces
98109
if (wordObj.word.trim()) {

0 commit comments

Comments
 (0)