chore(vscode): update to 1.54.2
This commit is contained in:
@ -1,445 +1,447 @@
|
||||
{
|
||||
"name": "emmet",
|
||||
"displayName": "Emmet",
|
||||
"description": "%description%",
|
||||
"version": "1.0.0",
|
||||
"publisher": "vscode",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"vscode": "^1.13.0"
|
||||
},
|
||||
"icon": "images/icon.png",
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/vscode-emmet"
|
||||
},
|
||||
"activationEvents": [
|
||||
"onStartupFinished",
|
||||
"onCommand:emmet.expandAbbreviation",
|
||||
"onLanguage:html",
|
||||
"onLanguage:css",
|
||||
"onLanguage:scss",
|
||||
"onLanguage:less"
|
||||
],
|
||||
"main": "./out/node/emmetNodeMain",
|
||||
"browser": "./dist/browser/emmetBrowserMain",
|
||||
"contributes": {
|
||||
"configuration": {
|
||||
"type": "object",
|
||||
"title": "Emmet",
|
||||
"properties": {
|
||||
"emmet.showExpandedAbbreviation": {
|
||||
"type": [
|
||||
"string"
|
||||
],
|
||||
"enum": [
|
||||
"never",
|
||||
"always",
|
||||
"inMarkupAndStylesheetFilesOnly"
|
||||
],
|
||||
"default": "always",
|
||||
"markdownDescription": "%emmetShowExpandedAbbreviation%"
|
||||
},
|
||||
"emmet.showAbbreviationSuggestions": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "%emmetShowAbbreviationSuggestions%"
|
||||
},
|
||||
"emmet.includeLanguages": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": {},
|
||||
"markdownDescription": "%emmetIncludeLanguages%"
|
||||
},
|
||||
"emmet.variables": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"lang": {
|
||||
"type": "string",
|
||||
"default": "en"
|
||||
},
|
||||
"charset": {
|
||||
"type": "string",
|
||||
"default": "UTF-8"
|
||||
}
|
||||
},
|
||||
"default": {},
|
||||
"description": "%emmetVariables%"
|
||||
},
|
||||
"emmet.syntaxProfiles": {
|
||||
"type": "object",
|
||||
"default": {},
|
||||
"description": "%emmetSyntaxProfiles%"
|
||||
},
|
||||
"emmet.excludeLanguages": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"markdown"
|
||||
],
|
||||
"description": "%emmetExclude%"
|
||||
},
|
||||
"emmet.extensionsPath": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"default": null,
|
||||
"description": "%emmetExtensionsPath%"
|
||||
},
|
||||
"emmet.triggerExpansionOnTab": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "%emmetTriggerExpansionOnTab%"
|
||||
},
|
||||
"emmet.preferences": {
|
||||
"type": "object",
|
||||
"default": {},
|
||||
"description": "%emmetPreferences%",
|
||||
"properties": {
|
||||
"css.intUnit": {
|
||||
"type": "string",
|
||||
"default": "px",
|
||||
"description": "%emmetPreferencesIntUnit%"
|
||||
},
|
||||
"css.floatUnit": {
|
||||
"type": "string",
|
||||
"default": "em",
|
||||
"description": "%emmetPreferencesFloatUnit%"
|
||||
},
|
||||
"css.propertyEnd": {
|
||||
"type": "string",
|
||||
"default": ";",
|
||||
"description": "%emmetPreferencesCssAfter%"
|
||||
},
|
||||
"sass.propertyEnd": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "%emmetPreferencesSassAfter%"
|
||||
},
|
||||
"stylus.propertyEnd": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "%emmetPreferencesStylusAfter%"
|
||||
},
|
||||
"css.valueSeparator": {
|
||||
"type": "string",
|
||||
"default": ": ",
|
||||
"description": "%emmetPreferencesCssBetween%"
|
||||
},
|
||||
"sass.valueSeparator": {
|
||||
"type": "string",
|
||||
"default": ": ",
|
||||
"description": "%emmetPreferencesSassBetween%"
|
||||
},
|
||||
"stylus.valueSeparator": {
|
||||
"type": "string",
|
||||
"default": " ",
|
||||
"description": "%emmetPreferencesStylusBetween%"
|
||||
},
|
||||
"bem.elementSeparator": {
|
||||
"type": "string",
|
||||
"default": "__",
|
||||
"description": "%emmetPreferencesBemElementSeparator%"
|
||||
},
|
||||
"bem.modifierSeparator": {
|
||||
"type": "string",
|
||||
"default": "_",
|
||||
"description": "%emmetPreferencesBemModifierSeparator%"
|
||||
},
|
||||
"filter.commentBefore": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "%emmetPreferencesFilterCommentBefore%"
|
||||
},
|
||||
"filter.commentAfter": {
|
||||
"type": "string",
|
||||
"default": "\n<!-- /[#ID][.CLASS] -->",
|
||||
"description": "%emmetPreferencesFilterCommentAfter%"
|
||||
},
|
||||
"filter.commentTrigger": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"id",
|
||||
"class"
|
||||
],
|
||||
"description": "%emmetPreferencesFilterCommentTrigger%"
|
||||
},
|
||||
"format.noIndentTags": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"html"
|
||||
],
|
||||
"description": "%emmetPreferencesFormatNoIndentTags%"
|
||||
},
|
||||
"format.forceIndentationForTags": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"body"
|
||||
],
|
||||
"description": "%emmetPreferencesFormatForceIndentTags%"
|
||||
},
|
||||
"profile.allowCompactBoolean": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "%emmetPreferencesAllowCompactBoolean%"
|
||||
},
|
||||
"css.webkitProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%emmetPreferencesCssWebkitProperties%"
|
||||
},
|
||||
"css.mozProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%emmetPreferencesCssMozProperties%"
|
||||
},
|
||||
"css.oProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%emmetPreferencesCssOProperties%"
|
||||
},
|
||||
"css.msProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%emmetPreferencesCssMsProperties%"
|
||||
},
|
||||
"css.fuzzySearchMinScore": {
|
||||
"type": "number",
|
||||
"default": 0.3,
|
||||
"description": "%emmetPreferencesCssFuzzySearchMinScore%"
|
||||
}
|
||||
}
|
||||
},
|
||||
"emmet.showSuggestionsAsSnippets": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"markdownDescription": "%emmetShowSuggestionsAsSnippets%"
|
||||
},
|
||||
"emmet.optimizeStylesheetParsing": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "%emmetOptimizeStylesheetParsing%"
|
||||
}
|
||||
}
|
||||
"name": "emmet",
|
||||
"displayName": "Emmet",
|
||||
"description": "%description%",
|
||||
"version": "1.0.0",
|
||||
"publisher": "vscode",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"vscode": "^1.13.0"
|
||||
},
|
||||
"icon": "images/icon.png",
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/vscode.git"
|
||||
},
|
||||
"activationEvents": [
|
||||
"onStartupFinished",
|
||||
"onCommand:emmet.expandAbbreviation",
|
||||
"onLanguage:html",
|
||||
"onLanguage:css",
|
||||
"onLanguage:scss",
|
||||
"onLanguage:less"
|
||||
],
|
||||
"main": "./out/node/emmetNodeMain",
|
||||
"browser": "./dist/browser/emmetBrowserMain",
|
||||
"contributes": {
|
||||
"configuration": {
|
||||
"type": "object",
|
||||
"title": "Emmet",
|
||||
"properties": {
|
||||
"emmet.showExpandedAbbreviation": {
|
||||
"type": [
|
||||
"string"
|
||||
],
|
||||
"enum": [
|
||||
"never",
|
||||
"always",
|
||||
"inMarkupAndStylesheetFilesOnly"
|
||||
],
|
||||
"default": "always",
|
||||
"markdownDescription": "%emmetShowExpandedAbbreviation%"
|
||||
},
|
||||
"commands": [
|
||||
{
|
||||
"command": "editor.emmet.action.wrapIndividualLinesWithAbbreviation",
|
||||
"title": "%command.wrapIndividualLinesWithAbbreviation%",
|
||||
"category": "Emmet"
|
||||
"emmet.showAbbreviationSuggestions": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "%emmetShowAbbreviationSuggestions%"
|
||||
},
|
||||
"emmet.includeLanguages": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": {},
|
||||
"markdownDescription": "%emmetIncludeLanguages%"
|
||||
},
|
||||
"emmet.variables": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"lang": {
|
||||
"type": "string",
|
||||
"default": "en"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.wrapWithAbbreviation",
|
||||
"title": "%command.wrapWithAbbreviation%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.removeTag",
|
||||
"title": "%command.removeTag%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.updateTag",
|
||||
"title": "%command.updateTag%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.matchTag",
|
||||
"title": "%command.matchTag%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.balanceIn",
|
||||
"title": "%command.balanceIn%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.balanceOut",
|
||||
"title": "%command.balanceOut%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.prevEditPoint",
|
||||
"title": "%command.prevEditPoint%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.nextEditPoint",
|
||||
"title": "%command.nextEditPoint%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.mergeLines",
|
||||
"title": "%command.mergeLines%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.selectPrevItem",
|
||||
"title": "%command.selectPrevItem%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.selectNextItem",
|
||||
"title": "%command.selectNextItem%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.splitJoinTag",
|
||||
"title": "%command.splitJoinTag%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.toggleComment",
|
||||
"title": "%command.toggleComment%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.evaluateMathExpression",
|
||||
"title": "%command.evaluateMathExpression%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.updateImageSize",
|
||||
"title": "%command.updateImageSize%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByOneTenth",
|
||||
"title": "%command.incrementNumberByOneTenth%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByOne",
|
||||
"title": "%command.incrementNumberByOne%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByTen",
|
||||
"title": "%command.incrementNumberByTen%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByOneTenth",
|
||||
"title": "%command.decrementNumberByOneTenth%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByOne",
|
||||
"title": "%command.decrementNumberByOne%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByTen",
|
||||
"title": "%command.decrementNumberByTen%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.reflectCSSValue",
|
||||
"title": "%command.reflectCSSValue%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "workbench.action.showEmmetCommands",
|
||||
"title": "%command.showEmmetCommands%",
|
||||
"category": ""
|
||||
"charset": {
|
||||
"type": "string",
|
||||
"default": "UTF-8"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"commandPalette": [
|
||||
{
|
||||
"command": "editor.emmet.action.wrapIndividualLinesWithAbbreviation"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.wrapWithAbbreviation"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.removeTag"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.updateTag"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.matchTag"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.balanceIn"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.balanceOut"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.prevEditPoint"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.nextEditPoint"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.mergeLines"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.selectPrevItem"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.selectNextItem"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.splitJoinTag"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.toggleComment"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.evaluateMathExpression"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.updateImageSize",
|
||||
"when": "resourceScheme =~ /^file$/"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByOneTenth"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByOne"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByTen"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByOneTenth"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByOne"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByTen"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.reflectCSSValue"
|
||||
}
|
||||
]
|
||||
},
|
||||
"default": {},
|
||||
"description": "%emmetVariables%"
|
||||
},
|
||||
"emmet.syntaxProfiles": {
|
||||
"type": "object",
|
||||
"default": {},
|
||||
"description": "%emmetSyntaxProfiles%"
|
||||
},
|
||||
"emmet.excludeLanguages": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"markdown"
|
||||
],
|
||||
"description": "%emmetExclude%"
|
||||
},
|
||||
"emmet.extensionsPath": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"default": null,
|
||||
"description": "%emmetExtensionsPath%"
|
||||
},
|
||||
"emmet.triggerExpansionOnTab": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "%emmetTriggerExpansionOnTab%"
|
||||
},
|
||||
"emmet.preferences": {
|
||||
"type": "object",
|
||||
"default": {},
|
||||
"description": "%emmetPreferences%",
|
||||
"properties": {
|
||||
"css.intUnit": {
|
||||
"type": "string",
|
||||
"default": "px",
|
||||
"description": "%emmetPreferencesIntUnit%"
|
||||
},
|
||||
"css.floatUnit": {
|
||||
"type": "string",
|
||||
"default": "em",
|
||||
"description": "%emmetPreferencesFloatUnit%"
|
||||
},
|
||||
"css.propertyEnd": {
|
||||
"type": "string",
|
||||
"default": ";",
|
||||
"description": "%emmetPreferencesCssAfter%"
|
||||
},
|
||||
"sass.propertyEnd": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "%emmetPreferencesSassAfter%"
|
||||
},
|
||||
"stylus.propertyEnd": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "%emmetPreferencesStylusAfter%"
|
||||
},
|
||||
"css.valueSeparator": {
|
||||
"type": "string",
|
||||
"default": ": ",
|
||||
"description": "%emmetPreferencesCssBetween%"
|
||||
},
|
||||
"sass.valueSeparator": {
|
||||
"type": "string",
|
||||
"default": ": ",
|
||||
"description": "%emmetPreferencesSassBetween%"
|
||||
},
|
||||
"stylus.valueSeparator": {
|
||||
"type": "string",
|
||||
"default": " ",
|
||||
"description": "%emmetPreferencesStylusBetween%"
|
||||
},
|
||||
"bem.elementSeparator": {
|
||||
"type": "string",
|
||||
"default": "__",
|
||||
"description": "%emmetPreferencesBemElementSeparator%"
|
||||
},
|
||||
"bem.modifierSeparator": {
|
||||
"type": "string",
|
||||
"default": "_",
|
||||
"description": "%emmetPreferencesBemModifierSeparator%"
|
||||
},
|
||||
"filter.commentBefore": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "%emmetPreferencesFilterCommentBefore%"
|
||||
},
|
||||
"filter.commentAfter": {
|
||||
"type": "string",
|
||||
"default": "\n<!-- /[#ID][.CLASS] -->",
|
||||
"description": "%emmetPreferencesFilterCommentAfter%"
|
||||
},
|
||||
"filter.commentTrigger": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"id",
|
||||
"class"
|
||||
],
|
||||
"description": "%emmetPreferencesFilterCommentTrigger%"
|
||||
},
|
||||
"format.noIndentTags": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"html"
|
||||
],
|
||||
"description": "%emmetPreferencesFormatNoIndentTags%"
|
||||
},
|
||||
"format.forceIndentationForTags": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"body"
|
||||
],
|
||||
"description": "%emmetPreferencesFormatForceIndentTags%"
|
||||
},
|
||||
"profile.allowCompactBoolean": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "%emmetPreferencesAllowCompactBoolean%"
|
||||
},
|
||||
"css.webkitProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%emmetPreferencesCssWebkitProperties%"
|
||||
},
|
||||
"css.mozProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%emmetPreferencesCssMozProperties%"
|
||||
},
|
||||
"css.oProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%emmetPreferencesCssOProperties%"
|
||||
},
|
||||
"css.msProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"markdownDescription": "%emmetPreferencesCssMsProperties%"
|
||||
},
|
||||
"css.fuzzySearchMinScore": {
|
||||
"type": "number",
|
||||
"default": 0.3,
|
||||
"description": "%emmetPreferencesCssFuzzySearchMinScore%"
|
||||
},
|
||||
"output.reverseAttributes": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "%emmetPreferencesOutputReverseAttributes%"
|
||||
},
|
||||
"css.color.short": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "%emmetPreferencesCssColorShort%"
|
||||
}
|
||||
}
|
||||
},
|
||||
"emmet.showSuggestionsAsSnippets": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"markdownDescription": "%emmetShowSuggestionsAsSnippets%"
|
||||
},
|
||||
"emmet.optimizeStylesheetParsing": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "%emmetOptimizeStylesheetParsing%"
|
||||
}
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"watch": "gulp watch-extension:emmet",
|
||||
"compile": "gulp compile-extension:emmet",
|
||||
"deps": "yarn add vscode-emmet-helper"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.19.9",
|
||||
"emmet": "https://github.com/rzhao271/emmet.git#1b2df677d8925ef5ea6da9df8845968403979a0a"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emmetio/abbreviation": "^2.2.0",
|
||||
"@emmetio/css-parser": "ramya-rao-a/css-parser#vscode",
|
||||
"@emmetio/html-matcher": "^0.3.3",
|
||||
"@emmetio/math-expression": "^1.0.4",
|
||||
"image-size": "^0.5.2",
|
||||
"vscode-emmet-helper": "2.2.4",
|
||||
"vscode-languageserver-textdocument": "^1.0.1"
|
||||
"commands": [
|
||||
{
|
||||
"command": "editor.emmet.action.wrapWithAbbreviation",
|
||||
"title": "%command.wrapWithAbbreviation%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.removeTag",
|
||||
"title": "%command.removeTag%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.updateTag",
|
||||
"title": "%command.updateTag%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.matchTag",
|
||||
"title": "%command.matchTag%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.balanceIn",
|
||||
"title": "%command.balanceIn%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.balanceOut",
|
||||
"title": "%command.balanceOut%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.prevEditPoint",
|
||||
"title": "%command.prevEditPoint%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.nextEditPoint",
|
||||
"title": "%command.nextEditPoint%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.mergeLines",
|
||||
"title": "%command.mergeLines%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.selectPrevItem",
|
||||
"title": "%command.selectPrevItem%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.selectNextItem",
|
||||
"title": "%command.selectNextItem%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.splitJoinTag",
|
||||
"title": "%command.splitJoinTag%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.toggleComment",
|
||||
"title": "%command.toggleComment%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.evaluateMathExpression",
|
||||
"title": "%command.evaluateMathExpression%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.updateImageSize",
|
||||
"title": "%command.updateImageSize%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByOneTenth",
|
||||
"title": "%command.incrementNumberByOneTenth%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByOne",
|
||||
"title": "%command.incrementNumberByOne%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByTen",
|
||||
"title": "%command.incrementNumberByTen%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByOneTenth",
|
||||
"title": "%command.decrementNumberByOneTenth%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByOne",
|
||||
"title": "%command.decrementNumberByOne%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByTen",
|
||||
"title": "%command.decrementNumberByTen%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.reflectCSSValue",
|
||||
"title": "%command.reflectCSSValue%",
|
||||
"category": "Emmet"
|
||||
},
|
||||
{
|
||||
"command": "workbench.action.showEmmetCommands",
|
||||
"title": "%command.showEmmetCommands%",
|
||||
"category": ""
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"commandPalette": [
|
||||
{
|
||||
"command": "editor.emmet.action.wrapWithAbbreviation"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.removeTag"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.updateTag"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.matchTag"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.balanceIn"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.balanceOut"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.prevEditPoint"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.nextEditPoint"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.mergeLines"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.selectPrevItem"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.selectNextItem"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.splitJoinTag"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.toggleComment"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.evaluateMathExpression"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.updateImageSize",
|
||||
"when": "resourceScheme =~ /^file$/"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByOneTenth"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByOne"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.incrementNumberByTen"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByOneTenth"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByOne"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.decrementNumberByTen"
|
||||
},
|
||||
{
|
||||
"command": "editor.emmet.action.reflectCSSValue"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"watch": "gulp watch-extension:emmet",
|
||||
"compile": "gulp compile-extension:emmet",
|
||||
"deps": "yarn add vscode-emmet-helper"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.19.9"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emmetio/abbreviation": "^2.2.0",
|
||||
"@emmetio/css-parser": "ramya-rao-a/css-parser#vscode",
|
||||
"@emmetio/html-matcher": "^0.3.3",
|
||||
"@emmetio/math-expression": "^1.0.4",
|
||||
"image-size": "^0.5.2",
|
||||
"vscode-emmet-helper": "^2.3.0",
|
||||
"vscode-languageserver-textdocument": "^1.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"description": "Emmet support for VS Code",
|
||||
"command.wrapWithAbbreviation": "Wrap with Abbreviation",
|
||||
"command.wrapIndividualLinesWithAbbreviation": "Wrap Individual Lines with Abbreviation",
|
||||
"command.removeTag": "Remove Tag",
|
||||
"command.updateTag": "Update Tag",
|
||||
"command.matchTag": "Go to Matching Pair",
|
||||
@ -55,5 +54,7 @@
|
||||
"emmetPreferencesCssOProperties": "Comma separated CSS properties that get the 'o' vendor prefix when used in Emmet abbreviation that starts with `-`. Set to empty string to always avoid the 'o' prefix.",
|
||||
"emmetPreferencesCssMsProperties": "Comma separated CSS properties that get the 'ms' vendor prefix when used in Emmet abbreviation that starts with `-`. Set to empty string to always avoid the 'ms' prefix.",
|
||||
"emmetPreferencesCssFuzzySearchMinScore": "The minimum score (from 0 to 1) that fuzzy-matched abbreviation should achieve. Lower values may produce many false-positive matches, higher values may reduce possible matches.",
|
||||
"emmetOptimizeStylesheetParsing": "When set to `false`, the whole file is parsed to determine if current position is valid for expanding Emmet abbreviations. When set to `true`, only the content around the current position in css/scss/less files is parsed."
|
||||
"emmetOptimizeStylesheetParsing": "When set to `false`, the whole file is parsed to determine if current position is valid for expanding Emmet abbreviations. When set to `true`, only the content around the current position in css/scss/less files is parsed.",
|
||||
"emmetPreferencesOutputReverseAttributes": "If `true`, reverses attribute merging directions when resolving snippets.",
|
||||
"emmetPreferencesCssColorShort": "If `true`, color values like #f will be expanded to #fff instead of #ffffff."
|
||||
}
|
||||
|
@ -6,19 +6,12 @@
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { Node, HtmlNode, Rule, Property, Stylesheet } from 'EmmetFlatNode';
|
||||
import { getEmmetHelper, getFlatNode, getMappingForIncludedLanguages, validate, getEmmetConfiguration, isStyleSheet, getEmmetMode, parsePartialStylesheet, isStyleAttribute, getEmbeddedCssNodeIfAny, allowedMimeTypesInScriptTag, toLSTextDocument } from './util';
|
||||
import { getEmmetHelper, getFlatNode, getMappingForIncludedLanguages, validate, getEmmetConfiguration, isStyleSheet, getEmmetMode, parsePartialStylesheet, isStyleAttribute, getEmbeddedCssNodeIfAny, allowedMimeTypesInScriptTag, toLSTextDocument, isOffsetInsideOpenOrCloseTag } from './util';
|
||||
import { getRootNode as parseDocument } from './parseDocument';
|
||||
import { MarkupAbbreviation } from 'emmet';
|
||||
// import { AbbreviationNode } from '@emmetio/abbreviation';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
const trimRegex = /[\u00a0]*[\d#\-\*\u2022]+\.?/;
|
||||
const hexColorRegex = /^#[\da-fA-F]{0,6}$/;
|
||||
// const inlineElements = ['a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo',
|
||||
// 'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i',
|
||||
// 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'object', 'q',
|
||||
// 's', 'samp', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup',
|
||||
// 'textarea', 'tt', 'u', 'var'];
|
||||
|
||||
interface ExpandAbbreviationInput {
|
||||
syntax: string;
|
||||
@ -26,6 +19,8 @@ interface ExpandAbbreviationInput {
|
||||
rangeToReplace: vscode.Range;
|
||||
textToWrap?: string[];
|
||||
filter?: string;
|
||||
indent?: string;
|
||||
baseIndent?: string;
|
||||
}
|
||||
|
||||
interface PreviewRangesWithContent {
|
||||
@ -33,22 +28,15 @@ interface PreviewRangesWithContent {
|
||||
originalRange: vscode.Range;
|
||||
originalContent: string;
|
||||
textToWrapInPreview: string[];
|
||||
baseIndent: string;
|
||||
}
|
||||
|
||||
export function wrapWithAbbreviation(args: any) {
|
||||
return doWrapping(true, args);
|
||||
}
|
||||
|
||||
export function wrapIndividualLinesWithAbbreviation(args: any) {
|
||||
return doWrapping(true, args);
|
||||
}
|
||||
|
||||
function doWrapping(_: boolean, args: any) {
|
||||
if (!validate(false) || !vscode.window.activeTextEditor) {
|
||||
return;
|
||||
export async function wrapWithAbbreviation(args: any): Promise<boolean> {
|
||||
if (!validate(false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const editor = vscode.window.activeTextEditor!;
|
||||
const document = editor.document;
|
||||
|
||||
args = args || {};
|
||||
@ -59,44 +47,68 @@ function doWrapping(_: boolean, args: any) {
|
||||
const syntax = getSyntaxFromArgs(args) || 'html';
|
||||
const rootNode = parseDocument(document, true);
|
||||
|
||||
let inPreview = false;
|
||||
let currentValue = '';
|
||||
const helper = getEmmetHelper();
|
||||
|
||||
// Fetch general information for the succesive expansions. i.e. the ranges to replace and its contents
|
||||
const rangesToReplace: PreviewRangesWithContent[] = editor.selections.sort((a: vscode.Selection, b: vscode.Selection) => { return a.start.compareTo(b.start); }).map(selection => {
|
||||
let rangeToReplace: vscode.Range = selection.isReversed ? new vscode.Range(selection.active, selection.anchor) : selection;
|
||||
if (!rangeToReplace.isSingleLine && rangeToReplace.end.character === 0) {
|
||||
// in case of multi-line, exclude last empty line from rangeToReplace
|
||||
const previousLine = rangeToReplace.end.line - 1;
|
||||
const lastChar = document.lineAt(previousLine).text.length;
|
||||
rangeToReplace = new vscode.Range(rangeToReplace.start, new vscode.Position(previousLine, lastChar));
|
||||
} else if (rangeToReplace.isEmpty) {
|
||||
const { active } = selection;
|
||||
const activeOffset = document.offsetAt(active);
|
||||
const currentNode = getFlatNode(rootNode, activeOffset, true);
|
||||
if (currentNode) {
|
||||
const currentNodeStart = document.positionAt(currentNode.start);
|
||||
const currentNodeEnd = document.positionAt(currentNode.end);
|
||||
if (currentNodeStart.line === active.line || currentNodeEnd.line === active.line) {
|
||||
// wrap around entire node
|
||||
rangeToReplace = new vscode.Range(currentNodeStart, currentNodeEnd);
|
||||
}
|
||||
else {
|
||||
// wrap line that cursor is on
|
||||
rangeToReplace = new vscode.Range(rangeToReplace.start.line, 0, rangeToReplace.start.line, document.lineAt(rangeToReplace.start.line).text.length);
|
||||
}
|
||||
} else {
|
||||
// wrap line that cursor is on
|
||||
rangeToReplace = new vscode.Range(rangeToReplace.start.line, 0, rangeToReplace.start.line, document.lineAt(rangeToReplace.start.line).text.length);
|
||||
const operationRanges = editor.selections.sort((a, b) => a.start.compareTo(b.start)).map(selection => {
|
||||
let rangeToReplace: vscode.Range = selection;
|
||||
// wrap around the node if the selection falls inside its open or close tag
|
||||
{
|
||||
let { start, end } = rangeToReplace;
|
||||
|
||||
const startOffset = document.offsetAt(start);
|
||||
const startNode = getFlatNode(rootNode, startOffset, true);
|
||||
if (startNode && isOffsetInsideOpenOrCloseTag(startNode, startOffset)) {
|
||||
start = document.positionAt(startNode.start);
|
||||
const nodeEndPosition = document.positionAt(startNode.end);
|
||||
end = nodeEndPosition.isAfter(end) ? nodeEndPosition : end;
|
||||
}
|
||||
|
||||
const endOffset = document.offsetAt(end);
|
||||
const endNode = getFlatNode(rootNode, endOffset, true);
|
||||
if (endNode && isOffsetInsideOpenOrCloseTag(endNode, endOffset)) {
|
||||
const nodeStartPosition = document.positionAt(endNode.start);
|
||||
start = nodeStartPosition.isBefore(start) ? nodeStartPosition : start;
|
||||
const nodeEndPosition = document.positionAt(endNode.end);
|
||||
end = nodeEndPosition.isAfter(end) ? nodeEndPosition : end;
|
||||
}
|
||||
|
||||
rangeToReplace = new vscode.Range(start, end);
|
||||
}
|
||||
// in case of multi-line, exclude last empty line from rangeToReplace
|
||||
if (!rangeToReplace.isSingleLine && rangeToReplace.end.character === 0) {
|
||||
const previousLine = rangeToReplace.end.line - 1;
|
||||
rangeToReplace = new vscode.Range(rangeToReplace.start, document.lineAt(previousLine).range.end);
|
||||
}
|
||||
// wrap line the cursor is on
|
||||
if (rangeToReplace.isEmpty) {
|
||||
rangeToReplace = document.lineAt(rangeToReplace.start).range;
|
||||
}
|
||||
|
||||
const firstLineOfSelection = document.lineAt(rangeToReplace.start).text.substr(rangeToReplace.start.character);
|
||||
const matches = firstLineOfSelection.match(/^(\s*)/);
|
||||
const extraWhitespaceSelected = matches ? matches[1].length : 0;
|
||||
rangeToReplace = new vscode.Range(rangeToReplace.start.line, rangeToReplace.start.character + extraWhitespaceSelected, rangeToReplace.end.line, rangeToReplace.end.character);
|
||||
// ignore whitespace on the first line
|
||||
const firstLineOfRange = document.lineAt(rangeToReplace.start);
|
||||
if (!firstLineOfRange.isEmptyOrWhitespace && firstLineOfRange.firstNonWhitespaceCharacterIndex > rangeToReplace.start.character) {
|
||||
rangeToReplace = rangeToReplace.with(new vscode.Position(rangeToReplace.start.line, firstLineOfRange.firstNonWhitespaceCharacterIndex));
|
||||
}
|
||||
|
||||
return rangeToReplace;
|
||||
}).reduce((mergedRanges, range) => {
|
||||
// Merge overlapping ranges
|
||||
if (mergedRanges.length > 0 && range.intersection(mergedRanges[mergedRanges.length - 1])) {
|
||||
mergedRanges.push(range.union(mergedRanges.pop()!));
|
||||
} else {
|
||||
mergedRanges.push(range);
|
||||
}
|
||||
return mergedRanges;
|
||||
}, [] as vscode.Range[]);
|
||||
|
||||
// Backup orginal selections and update selections
|
||||
// Also helps with https://github.com/microsoft/vscode/issues/113930 by avoiding `editor.linkedEditing`
|
||||
// execution if selection is inside an open or close tag
|
||||
const oldSelections = editor.selections;
|
||||
editor.selections = operationRanges.map(range => new vscode.Selection(range.start, range.end));
|
||||
|
||||
// Fetch general information for the succesive expansions. i.e. the ranges to replace and its contents
|
||||
const rangesToReplace: PreviewRangesWithContent[] = operationRanges.map(rangeToReplace => {
|
||||
let textToWrapInPreview: string[];
|
||||
const textToReplace = document.getText(rangeToReplace);
|
||||
|
||||
@ -104,10 +116,10 @@ function doWrapping(_: boolean, args: any) {
|
||||
// this assumption helps with applyPreview later
|
||||
const wholeFirstLine = document.lineAt(rangeToReplace.start).text;
|
||||
const otherMatches = wholeFirstLine.match(/^(\s*)/);
|
||||
const precedingWhitespace = otherMatches ? otherMatches[1] : '';
|
||||
const baseIndent = otherMatches ? otherMatches[1] : '';
|
||||
textToWrapInPreview = rangeToReplace.isSingleLine ?
|
||||
[textToReplace] :
|
||||
textToReplace.split('\n' + precedingWhitespace).map(x => x.trimEnd());
|
||||
textToReplace.split('\n' + baseIndent).map(x => x.trimEnd());
|
||||
|
||||
// escape $ characters, fixes #52640
|
||||
textToWrapInPreview = textToWrapInPreview.map(e => e.replace(/(\$\d)/g, '\\$1'));
|
||||
@ -116,31 +128,13 @@ function doWrapping(_: boolean, args: any) {
|
||||
previewRange: rangeToReplace,
|
||||
originalRange: rangeToReplace,
|
||||
originalContent: textToReplace,
|
||||
textToWrapInPreview
|
||||
textToWrapInPreview,
|
||||
baseIndent
|
||||
};
|
||||
});
|
||||
|
||||
// if a selection falls on a node, it could interfere with linked editing,
|
||||
// so back up the selections, and change selections to wrap around the node
|
||||
const oldSelections = editor.selections;
|
||||
const newSelections: vscode.Selection[] = [];
|
||||
editor.selections.forEach(selection => {
|
||||
let { start, end } = selection;
|
||||
const startOffset = document.offsetAt(start);
|
||||
const startNode = <HtmlNode>getFlatNode(rootNode, startOffset, true);
|
||||
const endOffset = document.offsetAt(end);
|
||||
const endNode = <HtmlNode>getFlatNode(rootNode, endOffset, true);
|
||||
if (startNode) {
|
||||
start = document.positionAt(startNode.start);
|
||||
}
|
||||
if (endNode) {
|
||||
end = document.positionAt(endNode.end);
|
||||
}
|
||||
// don't need to preserve active/anchor order since the selection changes
|
||||
// after wrapping anyway
|
||||
newSelections.push(new vscode.Selection(start, end));
|
||||
});
|
||||
editor.selections = newSelections;
|
||||
const { tabSize, insertSpaces } = editor.options;
|
||||
const indent = insertSpaces ? ' '.repeat(tabSize as number) : '\t';
|
||||
|
||||
function revertPreview(): Thenable<boolean> {
|
||||
return editor.edit(builder => {
|
||||
@ -168,16 +162,10 @@ function doWrapping(_: boolean, args: any) {
|
||||
// get the current preview range, format the new wrapped text, and then replace
|
||||
// the text in the preview range with that new text
|
||||
const oldPreviewRange = rangesToReplace[i].previewRange;
|
||||
const preceedingText = editor.document.getText(new vscode.Range(oldPreviewRange.start.line, 0, oldPreviewRange.start.line, oldPreviewRange.start.character));
|
||||
const indentPrefix = (preceedingText.match(/^(\s*)/) || ['', ''])[1];
|
||||
|
||||
let newText = expandedText;
|
||||
newText = newText.replace(/\n/g, '\n' + indentPrefix); // Adding indentation on each line of expanded text
|
||||
newText = newText.replace(/\$\{[\d]*\}/g, '|'); // Removing Tabstops
|
||||
newText = newText.replace(/\$\{[\d]*(:[^}]*)?\}/g, (match) => { // Replacing Placeholders
|
||||
return match.replace(/^\$\{[\d]*:/, '').replace('}', '');
|
||||
});
|
||||
newText = newText.replace(/\\\$/g, '$'); // Remove backslashes before $
|
||||
const newText = expandedText
|
||||
.replace(/\$\{[\d]*\}/g, '|') // Removing Tabstops
|
||||
.replace(/\$\{[\d]*:([^}]*)\}/g, (_, placeholder) => placeholder) // Replacing Placeholders
|
||||
.replace(/\\\$/g, '$'); // Remove backslashes before $
|
||||
builder.replace(oldPreviewRange, newText);
|
||||
|
||||
// calculate the new preview range to use for future previews
|
||||
@ -198,12 +186,10 @@ function doWrapping(_: boolean, args: any) {
|
||||
// plus the number of characters between both selections.
|
||||
newPreviewStart = lastNewPreviewRange.end.character + (oldPreviewRange.start.character - lastOldPreviewRange.end.character);
|
||||
newPreviewEnd += newPreviewStart;
|
||||
}
|
||||
else if (i > 0 && newPreviewLineStart === lastNewPreviewRange.end.line) {
|
||||
} else if (i > 0 && newPreviewLineStart === lastNewPreviewRange.end.line) {
|
||||
// Same as above but expandedTextLines.length > 1 so newPreviewEnd keeps its value.
|
||||
newPreviewStart = lastNewPreviewRange.end.character + (oldPreviewRange.start.character - lastOldPreviewRange.end.character);
|
||||
}
|
||||
else if (expandedTextLines.length === 1) {
|
||||
} else if (expandedTextLines.length === 1) {
|
||||
// If the expandedText is single line, add the length of preceeding text as it will not be included in line length.
|
||||
newPreviewEnd += oldPreviewRange.start.character;
|
||||
}
|
||||
@ -216,66 +202,64 @@ function doWrapping(_: boolean, args: any) {
|
||||
}, { undoStopBefore: false, undoStopAfter: false });
|
||||
}
|
||||
|
||||
function makeChanges(inputAbbreviation: string | undefined, definitive: boolean): Thenable<boolean> {
|
||||
if (!inputAbbreviation || !inputAbbreviation.trim() || !helper.isAbbreviationValid(syntax, inputAbbreviation)) {
|
||||
return inPreview ? revertPreview().then(() => { return false; }) : Promise.resolve(inPreview);
|
||||
}
|
||||
|
||||
const extractedResults = helper.extractAbbreviationFromText(inputAbbreviation);
|
||||
let inPreviewMode = false;
|
||||
async function makeChanges(inputAbbreviation: string | undefined, previewChanges: boolean): Promise<boolean> {
|
||||
const isAbbreviationValid = !!inputAbbreviation && !!inputAbbreviation.trim() && helper.isAbbreviationValid(syntax, inputAbbreviation);
|
||||
const extractedResults = isAbbreviationValid ? helper.extractAbbreviationFromText(inputAbbreviation!) : undefined;
|
||||
if (!extractedResults) {
|
||||
return Promise.resolve(inPreview);
|
||||
} else if (extractedResults.abbreviation !== inputAbbreviation) {
|
||||
// Not clear what should we do in this case. Warn the user? How?
|
||||
if (inPreviewMode) {
|
||||
inPreviewMode = false;
|
||||
await revertPreview();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const { abbreviation, filter } = extractedResults;
|
||||
if (definitive) {
|
||||
const revertPromise = inPreview ? revertPreview() : Promise.resolve(true);
|
||||
return revertPromise.then(() => {
|
||||
const expandAbbrList: ExpandAbbreviationInput[] = rangesToReplace.map(rangesAndContent => {
|
||||
const rangeToReplace = rangesAndContent.originalRange;
|
||||
let textToWrap: string[];
|
||||
// if (individualLines) {
|
||||
textToWrap = rangesAndContent.textToWrapInPreview;
|
||||
// } else {
|
||||
// // use the p tag as a dummy element to get Emmet to wrap the expression properly
|
||||
// textToWrap = rangeToReplace.isSingleLine ?
|
||||
// ['$TM_SELECTED_TEXT'] : ['<p>$TM_SELECTED_TEXT</p>'];
|
||||
// }
|
||||
return { syntax: syntax || '', abbreviation, rangeToReplace, textToWrap, filter };
|
||||
});
|
||||
return expandAbbreviationInRange(editor, expandAbbrList, false).then(() => { return true; });
|
||||
});
|
||||
if (abbreviation !== inputAbbreviation) {
|
||||
// Not clear what should we do in this case. Warn the user? How?
|
||||
}
|
||||
|
||||
const expandAbbrList: ExpandAbbreviationInput[] = rangesToReplace.map(rangesAndContent => {
|
||||
return { syntax: syntax || '', abbreviation, rangeToReplace: rangesAndContent.originalRange, textToWrap: rangesAndContent.textToWrapInPreview, filter };
|
||||
});
|
||||
if (previewChanges) {
|
||||
const expandAbbrList: ExpandAbbreviationInput[] = rangesToReplace.map(rangesAndContent =>
|
||||
({ syntax, abbreviation, rangeToReplace: rangesAndContent.originalRange, textToWrap: rangesAndContent.textToWrapInPreview, filter, indent, baseIndent: rangesAndContent.baseIndent })
|
||||
);
|
||||
|
||||
return applyPreview(expandAbbrList);
|
||||
inPreviewMode = true;
|
||||
return applyPreview(expandAbbrList);
|
||||
}
|
||||
|
||||
const expandAbbrList: ExpandAbbreviationInput[] = rangesToReplace.map(rangesAndContent =>
|
||||
({ syntax, abbreviation, rangeToReplace: rangesAndContent.originalRange, textToWrap: rangesAndContent.textToWrapInPreview, filter, indent })
|
||||
);
|
||||
|
||||
if (inPreviewMode) {
|
||||
inPreviewMode = false;
|
||||
await revertPreview();
|
||||
}
|
||||
|
||||
return expandAbbreviationInRange(editor, expandAbbrList, false);
|
||||
}
|
||||
|
||||
let currentValue = '';
|
||||
function inputChanged(value: string): string {
|
||||
if (value !== currentValue) {
|
||||
currentValue = value;
|
||||
makeChanges(value, false).then((out) => {
|
||||
inPreview = out;
|
||||
});
|
||||
makeChanges(value, true);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
const prompt = localize('wrapWithAbbreviationPrompt', "Enter Abbreviation");
|
||||
const abbreviationPromise: Thenable<string | undefined> = (args && args['abbreviation']) ?
|
||||
Promise.resolve(args['abbreviation']) :
|
||||
vscode.window.showInputBox({ prompt, validateInput: inputChanged });
|
||||
return abbreviationPromise.then(async (inputAbbreviation) => {
|
||||
const changesWereMade = await makeChanges(inputAbbreviation, true);
|
||||
if (!changesWereMade) {
|
||||
editor.selections = oldSelections;
|
||||
}
|
||||
return changesWereMade;
|
||||
});
|
||||
const inputAbbreviation = (args && args['abbreviation'])
|
||||
? (args['abbreviation'] as string)
|
||||
: await vscode.window.showInputBox({ prompt, validateInput: inputChanged });
|
||||
|
||||
const changesWereMade = await makeChanges(inputAbbreviation, false);
|
||||
if (!changesWereMade) {
|
||||
editor.selections = oldSelections;
|
||||
}
|
||||
|
||||
return changesWereMade;
|
||||
}
|
||||
|
||||
export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined> {
|
||||
@ -654,36 +638,13 @@ function expandAbbreviationInRange(editor: vscode.TextEditor, expandAbbrList: Ex
|
||||
// all cursors are maintained after snippet insertion
|
||||
const anyExpandAbbrInput = expandAbbrList[0];
|
||||
const expandedText = expandAbbr(anyExpandAbbrInput);
|
||||
const allRanges = expandAbbrList.map(value => {
|
||||
return new vscode.Range(value.rangeToReplace.start.line, value.rangeToReplace.start.character, value.rangeToReplace.end.line, value.rangeToReplace.end.character);
|
||||
});
|
||||
const allRanges = expandAbbrList.map(value => value.rangeToReplace);
|
||||
if (expandedText) {
|
||||
return editor.insertSnippet(new vscode.SnippetString(expandedText), allRanges);
|
||||
}
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
// /*
|
||||
// * Walks the tree rooted at root and apply function fn on each node.
|
||||
// * if fn return false at any node, the further processing of tree is stopped.
|
||||
// */
|
||||
// function walk(root: AbbreviationNode, fn: ((node: AbbreviationNode) => boolean)): boolean {
|
||||
// if (fn(root) === false || walkChildren(root.children, fn) === false) {
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// function walkChildren(children: AbbreviationNode[], fn: ((node: AbbreviationNode) => boolean)): boolean {
|
||||
// for (let i = 0; i < children.length; i++) {
|
||||
// const child = children[i];
|
||||
// if (walk(child, fn) === false) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Expands abbreviation as detailed in given input.
|
||||
*/
|
||||
@ -699,54 +660,26 @@ function expandAbbr(input: ExpandAbbreviationInput): string | undefined {
|
||||
}
|
||||
expandOptions['text'] = input.textToWrap;
|
||||
|
||||
// Below fixes https://github.com/microsoft/vscode/issues/29898
|
||||
// With this, Emmet formats inline elements as block elements
|
||||
// ensuring the wrapped multi line text does not get merged to a single line
|
||||
if (!input.rangeToReplace.isSingleLine && expandOptions.options) {
|
||||
expandOptions.options['output.inlineBreak'] = 1;
|
||||
if (expandOptions.options) {
|
||||
// Below fixes https://github.com/microsoft/vscode/issues/29898
|
||||
// With this, Emmet formats inline elements as block elements
|
||||
// ensuring the wrapped multi line text does not get merged to a single line
|
||||
if (!input.rangeToReplace.isSingleLine) {
|
||||
expandOptions.options['output.inlineBreak'] = 1;
|
||||
}
|
||||
|
||||
if (input.indent) {
|
||||
expandOptions.options['output.indent'] = input.indent;
|
||||
}
|
||||
if (input.baseIndent) {
|
||||
expandOptions.options['output.baseIndent'] = input.baseIndent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let expandedText;
|
||||
let expandedText: string | undefined;
|
||||
try {
|
||||
// Expand the abbreviation
|
||||
if (input.textToWrap && !isStyleSheet(input.syntax)) {
|
||||
const parsedAbbr = <MarkupAbbreviation>helper.parseAbbreviation(input.abbreviation, expandOptions);
|
||||
// if (input.rangeToReplace.isSingleLine && input.textToWrap.length === 1) {
|
||||
// // Fetch rightmost element in the parsed abbreviation (i.e the element that will contain the wrapped text).
|
||||
// const wrappingNodeChildren = parsedAbbr.children;
|
||||
// let wrappingNode = wrappingNodeChildren[wrappingNodeChildren.length - 1];
|
||||
// while (wrappingNode && wrappingNode.children && wrappingNode.children.length > 0) {
|
||||
// wrappingNode = wrappingNode.children[wrappingNode.children.length - 1];
|
||||
// }
|
||||
|
||||
// // If wrapping with a block element, insert newline in the text to wrap.
|
||||
// // const format = expandOptions.options ? (expandOptions.options['output.format'] ?? true) : true;
|
||||
// // if (wrappingNode && wrappingNode.name && wrappingNode.value
|
||||
// // && inlineElements.indexOf(wrappingNode.name) === -1
|
||||
// // && format) {
|
||||
// // wrappingNode.value[0] = '\n\t' + wrappingNode.value[0] + '\n';
|
||||
// // }
|
||||
// }
|
||||
|
||||
// Below fixes https://github.com/microsoft/vscode/issues/78219
|
||||
// walk the tree and remove tags for empty values
|
||||
// walkChildren(parsedAbbr.children, node => {
|
||||
// if (node.name !== null && node.value && node.value[0] === '' && !node.selfClosing && node.children.length === 0) {
|
||||
// node.name = '';
|
||||
// node.value[0] = '\n';
|
||||
// }
|
||||
// return true;
|
||||
// });
|
||||
|
||||
expandedText = helper.expandAbbreviation(parsedAbbr, expandOptions);
|
||||
// All $anyword would have been escaped by the emmet helper.
|
||||
// Remove the escaping backslash from $TM_SELECTED_TEXT so that VS Code Snippet controller can treat it as a variable
|
||||
expandedText = expandedText.replace('<p>\\$TM_SELECTED_TEXT</p>', '$TM_SELECTED_TEXT');
|
||||
} else {
|
||||
expandedText = helper.expandAbbreviation(input.abbreviation, expandOptions);
|
||||
}
|
||||
|
||||
expandedText = helper.expandAbbreviation(input.abbreviation, expandOptions);
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage('Failed to expand abbreviation');
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { DefaultCompletionItemProvider } from './defaultCompletionProvider';
|
||||
import { expandEmmetAbbreviation, wrapWithAbbreviation, wrapIndividualLinesWithAbbreviation } from './abbreviationActions';
|
||||
import { expandEmmetAbbreviation, wrapWithAbbreviation } from './abbreviationActions';
|
||||
import { removeTag } from './removeTag';
|
||||
import { updateTag } from './updateTag';
|
||||
import { matchTag } from './matchTag';
|
||||
@ -23,15 +23,12 @@ import { addFileToParseCache, removeFileFromParseCache } from './parseDocument';
|
||||
|
||||
export function activateEmmetExtension(context: vscode.ExtensionContext) {
|
||||
registerCompletionProviders(context);
|
||||
updateEmmetExtensionsPath();
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('editor.emmet.action.wrapWithAbbreviation', (args) => {
|
||||
wrapWithAbbreviation(args);
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('editor.emmet.action.wrapIndividualLinesWithAbbreviation', (args) => {
|
||||
wrapIndividualLinesWithAbbreviation(args);
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('emmet.expandAbbreviation', (args) => {
|
||||
expandEmmetAbbreviation(args);
|
||||
}));
|
||||
@ -129,8 +126,6 @@ export function activateEmmetExtension(context: vscode.ExtensionContext) {
|
||||
vscode.commands.executeCommand('workbench.action.quickOpen', '>Emmet: ');
|
||||
}));
|
||||
|
||||
updateEmmetExtensionsPath();
|
||||
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e) => {
|
||||
if (e.affectsConfiguration('emmet.includeLanguages')) {
|
||||
registerCompletionProviders(context);
|
||||
|
@ -37,6 +37,13 @@ suite('Tests for completion in CSS embedded in HTML', () => {
|
||||
{ label: 'widows: ;', documentation: `widows: ;` }
|
||||
]);
|
||||
});
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/117020
|
||||
test('#117020, ! at end of abbreviation should have completion', async () => {
|
||||
await testCssCompletionProvider(`.foo { bdbn!| }`, [
|
||||
{ label: 'border-bottom: none !important;', documentation: `border-bottom: none !important;` }
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
interface TestCompletionItem {
|
||||
|
3
lib/vscode/extensions/emmet/src/test/test-fixtures/.vscode/settings.json
vendored
Normal file
3
lib/vscode/extensions/emmet/src/test/test-fixtures/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"editor.minimap.enabled": false // see https://github.com/microsoft/vscode/issues/115747
|
||||
}
|
@ -7,7 +7,7 @@ import 'mocha';
|
||||
import * as assert from 'assert';
|
||||
import { Selection, workspace, ConfigurationTarget } from 'vscode';
|
||||
import { withRandomFileEditor, closeAllEditors } from './testUtils';
|
||||
import { wrapWithAbbreviation, wrapIndividualLinesWithAbbreviation } from '../abbreviationActions';
|
||||
import { wrapWithAbbreviation } from '../abbreviationActions';
|
||||
|
||||
const htmlContentsForBlockWrapTests = `
|
||||
<ul class="nav main">
|
||||
@ -167,7 +167,7 @@ suite('Tests for Wrap with Abbreviations', () => {
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
return testWrapWithAbbreviation([new Selection(1, 1, 1, 1)], 'a[href="https://example.com"]>div', expectedContents, contents);
|
||||
return testWrapWithAbbreviation([new Selection(1, 2, 1, 2)], 'a[href="https://example.com"]>div', expectedContents, contents);
|
||||
});
|
||||
|
||||
test('Wrap with abbreviation entire node when cursor is on opening tag', () => {
|
||||
@ -183,7 +183,7 @@ suite('Tests for Wrap with Abbreviations', () => {
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
return testWrapWithAbbreviation([new Selection(1, 1, 1, 1)], 'div', expectedContents, contents);
|
||||
return testWrapWithAbbreviation([new Selection(1, 2, 1, 2)], 'div', expectedContents, contents);
|
||||
});
|
||||
|
||||
test('Wrap with abbreviation entire node when cursor is on closing tag', () => {
|
||||
@ -199,7 +199,7 @@ suite('Tests for Wrap with Abbreviations', () => {
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
return testWrapWithAbbreviation([new Selection(3, 1, 3, 1)], 'div', expectedContents, contents);
|
||||
return testWrapWithAbbreviation([new Selection(3, 2, 3, 2)], 'div', expectedContents, contents);
|
||||
});
|
||||
|
||||
test('Wrap with multiline abbreviation doesnt add extra spaces', () => {
|
||||
@ -302,7 +302,7 @@ suite('Tests for Wrap with Abbreviations', () => {
|
||||
});
|
||||
|
||||
test('Wrap with abbreviation and format set to false', () => {
|
||||
return workspace.getConfiguration('emmet').update('syntaxProfiles', { 'html' : { 'format': false } }, ConfigurationTarget.Global).then(() => {
|
||||
return workspace.getConfiguration('emmet').update('syntaxProfiles', { 'html': { 'format': false } }, ConfigurationTarget.Global).then(() => {
|
||||
return testWrapWithAbbreviation(multiCursors, 'h1', wrapInlineElementExpectedFormatFalse, htmlContentsForBlockWrapTests).then(() => {
|
||||
return workspace.getConfiguration('emmet').update('syntaxProfiles', oldValueForSyntaxProfiles ? oldValueForSyntaxProfiles.globalValue : undefined, ConfigurationTarget.Global);
|
||||
});
|
||||
@ -347,7 +347,7 @@ suite('Tests for Wrap with Abbreviations', () => {
|
||||
</ul>
|
||||
`;
|
||||
|
||||
return testWrapWithAbbreviation([new Selection(2,2,3,33)], '.hello', wrapMultiLineJsxExpected, htmlContentsForBlockWrapTests, 'jsx');
|
||||
return testWrapWithAbbreviation([new Selection(2, 2, 3, 33)], '.hello', wrapMultiLineJsxExpected, htmlContentsForBlockWrapTests, 'jsx');
|
||||
});
|
||||
|
||||
test('Wrap individual line with abbreviation uses className for jsx files', () => {
|
||||
@ -362,8 +362,34 @@ suite('Tests for Wrap with Abbreviations', () => {
|
||||
</ul>
|
||||
`;
|
||||
|
||||
return testWrapIndividualLinesWithAbbreviation([new Selection(2,2,3,33)], '.hello$*', wrapIndividualLinesJsxExpected, htmlContentsForBlockWrapTests, 'jsx');
|
||||
return testWrapIndividualLinesWithAbbreviation([new Selection(2, 2, 3, 33)], '.hello$*', wrapIndividualLinesJsxExpected, htmlContentsForBlockWrapTests, 'jsx');
|
||||
});
|
||||
|
||||
test('Wrap with abbreviation merge overlapping computed ranges', () => {
|
||||
const contents = `
|
||||
<div class="nav main">
|
||||
hello
|
||||
</div>
|
||||
`;
|
||||
const expectedContents = `
|
||||
<div>
|
||||
<div class="nav main">
|
||||
hello
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
return testWrapWithAbbreviation([new Selection(1, 2, 1, 2), new Selection(1, 10, 1, 10)], 'div', expectedContents, contents);
|
||||
});
|
||||
|
||||
test('Wrap with abbreviation ignore invalid abbreviation', () => {
|
||||
const contents = `
|
||||
<div class="nav main">
|
||||
hello
|
||||
</div>
|
||||
`;
|
||||
return testWrapWithAbbreviation([new Selection(1, 2, 1, 2)], 'div]', contents, contents);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -386,7 +412,7 @@ function testWrapWithAbbreviation(selections: Selection[], abbreviation: string,
|
||||
function testWrapIndividualLinesWithAbbreviation(selections: Selection[], abbreviation: string, expectedContents: string, input: string, fileExtension: string = 'html'): Thenable<any> {
|
||||
return withRandomFileEditor(input, fileExtension, (editor, _) => {
|
||||
editor.selections = selections;
|
||||
const promise = wrapIndividualLinesWithAbbreviation({ abbreviation });
|
||||
const promise = wrapWithAbbreviation({ abbreviation });
|
||||
if (!promise) {
|
||||
assert.equal(1, 2, 'Wrap individual lines with Abbreviation returned undefined.');
|
||||
return Promise.resolve();
|
||||
|
@ -28,7 +28,6 @@ export function getEmmetHelper() {
|
||||
if (!_emmetHelper) {
|
||||
_emmetHelper = require('vscode-emmet-helper');
|
||||
}
|
||||
updateEmmetExtensionsPath();
|
||||
return _emmetHelper;
|
||||
}
|
||||
|
||||
@ -36,9 +35,7 @@ export function getEmmetHelper() {
|
||||
* Update Emmet Helper to use user snippets from the extensionsPath setting
|
||||
*/
|
||||
export function updateEmmetExtensionsPath(forceRefresh: boolean = false) {
|
||||
if (!_emmetHelper) {
|
||||
return;
|
||||
}
|
||||
const helper = getEmmetHelper();
|
||||
let extensionsPath = vscode.workspace.getConfiguration('emmet')['extensionsPath'];
|
||||
if (forceRefresh || _currentExtensionsPath !== extensionsPath) {
|
||||
_currentExtensionsPath = extensionsPath;
|
||||
@ -47,7 +44,7 @@ export function updateEmmetExtensionsPath(forceRefresh: boolean = false) {
|
||||
} else {
|
||||
const rootPath = vscode.workspace.workspaceFolders[0].uri;
|
||||
const fileSystem = vscode.workspace.fs;
|
||||
_emmetHelper.updateExtensionsPath(extensionsPath, fileSystem, rootPath, _homeDir).then(null, (err: string) => vscode.window.showErrorMessage(err));
|
||||
helper.updateExtensionsPath(extensionsPath, fileSystem, rootPath, _homeDir).catch(err => vscode.window.showErrorMessage(err.message));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -62,18 +59,18 @@ export const LANGUAGE_MODES: { [id: string]: string[] } = {
|
||||
'haml': ['!', '.', '}', ':', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'xml': ['.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'xsl': ['!', '.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'css': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'scss': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'sass': [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'less': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'stylus': [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'css': [':', '!', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'scss': [':', '!', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'sass': [':', '!', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'less': [':', '!', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'stylus': [':', '!', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'javascriptreact': ['!', '.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'typescriptreact': ['!', '.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
|
||||
};
|
||||
|
||||
export function isStyleSheet(syntax: string): boolean {
|
||||
let stylesheetSyntaxes = ['css', 'scss', 'sass', 'less', 'stylus'];
|
||||
return (stylesheetSyntaxes.indexOf(syntax) > -1);
|
||||
return stylesheetSyntaxes.includes(syntax);
|
||||
}
|
||||
|
||||
export function validate(allowStylesheet: boolean = true): boolean {
|
||||
@ -374,6 +371,16 @@ export function getHtmlFlatNode(documentText: string, root: FlatNode | undefined
|
||||
return currentNode;
|
||||
}
|
||||
|
||||
export function isOffsetInsideOpenOrCloseTag(node: FlatNode, offset: number): boolean {
|
||||
const htmlNode = node as HtmlFlatNode;
|
||||
if ((htmlNode.open && offset > htmlNode.open.start && offset < htmlNode.open.end)
|
||||
|| (htmlNode.close && offset > htmlNode.close.start && offset < htmlNode.close.end)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function offsetRangeToSelection(document: vscode.TextDocument, start: number, end: number): vscode.Selection {
|
||||
const startPos = document.positionAt(start);
|
||||
const endPos = document.positionAt(end);
|
||||
|
@ -2,10 +2,10 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@emmetio/abbreviation@^2.2.0":
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@emmetio/abbreviation/-/abbreviation-2.2.0.tgz#9f8dedbdb00e3136d6d37c6415375c82c0bb477f"
|
||||
integrity sha512-NPGVUmnr7cLj4i6MKS4c8NjuoIIJROrruJl/8nXsp2MdbDRHvtfq25foySvv/NbfqTQm+P9JzVLDD9JxGIpvkQ==
|
||||
"@emmetio/abbreviation@^2.2.0", "@emmetio/abbreviation@^2.2.1":
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@emmetio/abbreviation/-/abbreviation-2.2.1.tgz#d9458fe1f09fe042f019c48aa681165ba613a48d"
|
||||
integrity sha512-uUNwNgbH0JPlrdXhy8VQbNPLLG7abMvOaLVMblx22i68Rl9r+2N235ALgIYFUty1yXC9DkVw6xMbz/D4QVARcQ==
|
||||
dependencies:
|
||||
"@emmetio/scanner" "^1.0.0"
|
||||
|
||||
@ -54,15 +54,16 @@
|
||||
integrity sha1-Rs/+oRmgoAMxKiHC2bVijLX81EI=
|
||||
|
||||
"@types/node@^12.19.9":
|
||||
version "12.19.12"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.12.tgz#04793c2afa4ce833a9972e4c476432e30f9df47b"
|
||||
integrity sha512-UwfL2uIU9arX/+/PRcIkT08/iBadGN2z6ExOROA2Dh5mAuWTBj6iJbQX4nekiV5H8cTrEG569LeX+HRco9Cbxw==
|
||||
version "12.20.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.1.tgz#63d36c10e162666f0107f247cdca76542c3c7472"
|
||||
integrity sha512-tCkE96/ZTO+cWbln2xfyvd6ngHLanvVlJ3e5BeirJ3BYI5GbAyubIrmV4JjjugDly5D9fHjOL5MNsqsCnqwW6g==
|
||||
|
||||
"emmet@https://github.com/rzhao271/emmet.git#1b2df677d8925ef5ea6da9df8845968403979a0a":
|
||||
version "2.3.0"
|
||||
resolved "https://github.com/rzhao271/emmet.git#1b2df677d8925ef5ea6da9df8845968403979a0a"
|
||||
emmet@^2.3.0:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/emmet/-/emmet-2.3.1.tgz#77614d949d1d01e5c248d08043a13a7f4d539e47"
|
||||
integrity sha512-u8h++9u3y9QWhn0imUXfQO+s80To5MGD97zd/00wGC39CfNGBPe//ZKepJz9I1LQ2FDRXHrn+e3JaN/53Y5z6A==
|
||||
dependencies:
|
||||
"@emmetio/abbreviation" "^2.2.0"
|
||||
"@emmetio/abbreviation" "^2.2.1"
|
||||
"@emmetio/css-abbreviation" "^2.1.2"
|
||||
|
||||
image-size@^0.5.2:
|
||||
@ -75,12 +76,12 @@ jsonc-parser@^2.3.0:
|
||||
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.3.1.tgz#59549150b133f2efacca48fe9ce1ec0659af2342"
|
||||
integrity sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==
|
||||
|
||||
vscode-emmet-helper@2.2.4:
|
||||
version "2.2.4"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-2.2.4.tgz#8ab86d2b7fe9e6270b4c77c9fd8d1eb8f3f4c401"
|
||||
integrity sha512-1N6bMzP1ZzkDGzamvsKxQ/lOmBc4+OQdj0dA2C9A5PSeYV9gh5xbJ061sm+VyFHOGZE+VyUQq5m/WFmFsLbKnA==
|
||||
vscode-emmet-helper@^2.3.0:
|
||||
version "2.3.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-2.3.2.tgz#7f73cd579eef187a4456dc71768fb2237f47fbd4"
|
||||
integrity sha512-uulOziI/5Ml+AyfHwgkZDXlGZsu9yNcfwZgOfRSPokc6lqYEoGK+/u902LH8Xaf68dhPLctJlhhGYwDJuqoGxg==
|
||||
dependencies:
|
||||
emmet "https://github.com/rzhao271/emmet.git#1b2df677d8925ef5ea6da9df8845968403979a0a"
|
||||
emmet "^2.3.0"
|
||||
jsonc-parser "^2.3.0"
|
||||
vscode-languageserver-textdocument "^1.0.1"
|
||||
vscode-languageserver-types "^3.15.1"
|
||||
|
Reference in New Issue
Block a user