Skip to content

Commit

Permalink
Add option to show emmet suggestions as snippets #32346
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Aug 30, 2017
1 parent 9d1835d commit db05d0f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
6 changes: 3 additions & 3 deletions extensions/emmet/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions extensions/emmet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"type": "object",
"default": {},
"description": "%emmetIncludeLanguages%"
},
},
"emmet.variables": {
"type": "object",
"properties": {
Expand All @@ -60,14 +60,16 @@
"default": {},
"description": "%emmetVariables%"
},
"emmet.syntaxProfiles":{
"emmet.syntaxProfiles": {
"type": "object",
"default": {},
"description": "%emmetSyntaxProfiles%"
},
"emmet.excludeLanguages":{
"emmet.excludeLanguages": {
"type": "array",
"default": ["markdown"],
"default": [
"markdown"
],
"description": "%emmetExclude%"
},
"emmet.extensionsPath": {
Expand All @@ -80,7 +82,7 @@
"default": false,
"description": "%emmetTriggerExpansionOnTab%"
},
"emmet.preferences":{
"emmet.preferences": {
"type": "object",
"default": {},
"description": "%emmetPreferences%",
Expand Down Expand Up @@ -126,6 +128,11 @@
"description": "%emmetPreferencesStylusBetween%"
}
}
},
"emmet.showSuggestionsAsSnippets": {
"type": "boolean",
"default": false,
"description": "%emmetShowSuggestionsAsSnippets%"
}
}
},
Expand Down Expand Up @@ -255,11 +262,10 @@
"vscode": "1.0.1"
},
"dependencies": {

"@emmetio/html-matcher": "^0.3.1",
"@emmetio/css-parser": "ramya-rao-a/css-parser#vscode",
"@emmetio/math-expression": "^0.1.1",
"vscode-emmet-helper": "^1.1.3",
"vscode-emmet-helper": "^1.1.4",
"vscode-languageserver-types": "^3.0.3",
"image-size": "^0.5.2",
"vscode-nls": "2.0.2"
Expand Down
3 changes: 2 additions & 1 deletion extensions/emmet/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"emmetPreferencesStylusAfter": "Symbol to be placed at the end of CSS property when expanding CSS abbreviations in Stylus files",
"emmetPreferencesCssBetween": "Symbol to be placed at the between CSS property and value when expanding CSS abbreviations",
"emmetPreferencesSassBetween": "Symbol to be placed at the between CSS property and value when expanding CSS abbreviations in Sass files",
"emmetPreferencesStylusBetween": "Symbol to be placed at the between CSS property and value when expanding CSS abbreviations in Stylus files"
"emmetPreferencesStylusBetween": "Symbol to be placed at the between CSS property and value when expanding CSS abbreviations in Stylus files",
"emmetShowSuggestionsAsSnippets": "If true, then emmet suggestions will show up as snippets allowing you to order them as per editor.snippetSuggestions setting."
}
4 changes: 4 additions & 0 deletions extensions/emmet/src/defaultCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export class DefaultCompletionItemProvider implements vscode.CompletionItemProvi

newItem.filterText = item.filterText;
newItem.sortText = item.sortText;

if (emmetConfig['showSuggestionsAsSnippets'] === true) {
newItem.kind = vscode.CompletionItemKind.Snippet;
}
newItems.push(newItem);
});
}
Expand Down

0 comments on commit db05d0f

Please sign in to comment.