From c0f021bb6756e9bb16ba0a8a5956d4fdbee3b50a Mon Sep 17 00:00:00 2001 From: Simon Stranks Date: Mon, 30 Oct 2023 18:27:30 +0000 Subject: [PATCH 1/4] feat(css aliases): added css.alias.paths feat(css aliases): added scss.alias.paths Provides definitions and constraints to the settings --- extensions/css-language-features/package.json | 30 +++ .../css-language-features/package.nls.json | 220 +++++++++--------- 2 files changed, 141 insertions(+), 109 deletions(-) diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index 4c46a1391c9fb..ecd4e6fecb6cd 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -66,6 +66,21 @@ "default": true, "description": "%css.validate.desc%" }, + "css.alias.paths": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "[^/]$": { + "type": "string", + "pattern": "((\\.css)|/\\*)$", + "patternErrorMessage": "Path must end with stylesheet filetype or folder glob '/*'" + }, + "patternErrorMessage": "Alias must not end with forward slash" + }, + "scope": "resource", + "default": null, + "description": "%css.alias.paths%" + }, "css.hover.documentation": { "type": "boolean", "scope": "resource", @@ -382,6 +397,21 @@ "default": true, "description": "%scss.validate.desc%" }, + "scss.alias.paths": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "[^/]$": { + "type": "string", + "pattern": "((\\.s?css)|/\\*)$", + "patternErrorMessage": "Path must end with stylesheet filetype or folder glob '/*'" + }, + "patternErrorMessage": "Alias must not end with forward slash" + }, + "scope": "resource", + "default": null, + "description": "%scss.alias.paths%" + }, "scss.hover.documentation": { "type": "boolean", "scope": "resource", diff --git a/extensions/css-language-features/package.nls.json b/extensions/css-language-features/package.nls.json index 057ec214bc2f8..891eb5dfa04d7 100644 --- a/extensions/css-language-features/package.nls.json +++ b/extensions/css-language-features/package.nls.json @@ -1,111 +1,113 @@ { - "displayName": "CSS Language Features", - "description": "Provides rich language support for CSS, LESS and SCSS files.", - "css.title": "CSS", - "css.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for CSS custom properties (variables), at-rules, pseudo-classes, and pseudo-elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.", - "css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", - "css.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", - "css.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", - "css.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", - "css.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", - "css.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", - "css.lint.emptyRules.desc": "Do not use empty rulesets.", - "css.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", - "css.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "css.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", - "css.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", - "css.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", - "css.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", - "css.lint.importStatement.desc": "Import statements do not load in parallel.", - "css.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", - "css.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", - "css.lint.unknownAtRules.desc": "Unknown at-rule.", - "css.lint.unknownProperties.desc": "Unknown property.", - "css.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", - "css.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", - "css.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", - "css.lint.zeroUnits.desc": "No unit for zero needed.", - "css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.", - "css.validate.title": "Controls CSS validation and problem severities.", - "css.validate.desc": "Enables or disables all validations.", - "css.hover.documentation": "Show property and value documentation in CSS hovers.", - "css.hover.references": "Show references to MDN in CSS hovers.", - "css.format.enable.desc": "Enable/disable default CSS formatter.", - "css.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", - "css.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", - "css.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", - "css.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "css.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", - "css.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#css.format.preserveNewLines#` is enabled.", - "less.title": "LESS", - "less.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", - "less.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", - "less.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", - "less.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", - "less.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", - "less.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", - "less.lint.emptyRules.desc": "Do not use empty rulesets.", - "less.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", - "less.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "less.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", - "less.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", - "less.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", - "less.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", - "less.lint.importStatement.desc": "Import statements do not load in parallel.", - "less.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", - "less.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", - "less.lint.unknownAtRules.desc": "Unknown at-rule.", - "less.lint.unknownProperties.desc": "Unknown property.", - "less.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", - "less.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", - "less.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", - "less.lint.zeroUnits.desc": "No unit for zero needed.", - "less.validate.title": "Controls LESS validation and problem severities.", - "less.validate.desc": "Enables or disables all validations.", - "less.hover.documentation": "Show property and value documentation in LESS hovers.", - "less.hover.references": "Show references to MDN in LESS hovers.", - "less.format.enable.desc": "Enable/disable default LESS formatter.", - "less.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", - "less.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", - "less.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", - "less.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "less.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", - "less.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#less.format.preserveNewLines#` is enabled.", - "scss.title": "SCSS (Sass)", - "scss.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", - "scss.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", - "scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", - "scss.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", - "scss.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", - "scss.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", - "scss.lint.emptyRules.desc": "Do not use empty rulesets.", - "scss.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", - "scss.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "scss.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", - "scss.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", - "scss.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", - "scss.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", - "scss.lint.importStatement.desc": "Import statements do not load in parallel.", - "scss.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", - "scss.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", - "scss.lint.unknownAtRules.desc": "Unknown at-rule.", - "scss.lint.unknownProperties.desc": "Unknown property.", - "scss.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", - "scss.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", - "scss.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", - "scss.lint.zeroUnits.desc": "No unit for zero needed.", - "scss.validate.title": "Controls SCSS validation and problem severities.", - "scss.validate.desc": "Enables or disables all validations.", - "scss.hover.documentation": "Show property and value documentation in SCSS hovers.", - "scss.hover.references": "Show references to MDN in SCSS hovers.", - "scss.format.enable.desc": "Enable/disable default SCSS formatter.", - "scss.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", - "scss.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", - "scss.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", - "scss.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "scss.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", - "scss.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#scss.format.preserveNewLines#` is enabled.", - "css.colorDecorators.enable.deprecationMessage": "The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", - "scss.colorDecorators.enable.deprecationMessage": "The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", - "less.colorDecorators.enable.deprecationMessage": "The setting `less.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`." + "displayName": "CSS Language Features", + "description": "Provides rich language support for CSS, LESS and SCSS files.", + "css.title": "CSS", + "css.alias.paths": "A series of entries which map imports to lookup locations within CSS files. \n Single file reference: \"Stylesheet\": \"src/css/styles.css\". \n Reference folder: \"StylesDir/*\": \"src/css/*\". \n @import 'Stylesheet' \n @import 'StylesDir/styles.css", + "css.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for the custom CSS properties, at directives, pseudo classes and pseudo elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.", + "css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", + "css.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", + "css.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", + "css.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", + "css.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", + "css.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", + "css.lint.emptyRules.desc": "Do not use empty rulesets.", + "css.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", + "css.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", + "css.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", + "css.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", + "css.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", + "css.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", + "css.lint.importStatement.desc": "Import statements do not load in parallel.", + "css.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", + "css.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", + "css.lint.unknownAtRules.desc": "Unknown at-rule.", + "css.lint.unknownProperties.desc": "Unknown property.", + "css.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", + "css.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", + "css.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", + "css.lint.zeroUnits.desc": "No unit for zero needed.", + "css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.", + "css.validate.title": "Controls CSS validation and problem severities.", + "css.validate.desc": "Enables or disables all validations.", + "css.hover.documentation": "Show property and value documentation in CSS hovers.", + "css.hover.references": "Show references to MDN in CSS hovers.", + "css.format.enable.desc": "Enable/disable default CSS formatter.", + "css.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", + "css.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", + "css.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", + "css.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", + "css.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", + "css.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#css.format.preserveNewLines#` is enabled.", + "less.title": "LESS", + "less.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", + "less.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", + "less.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", + "less.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", + "less.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", + "less.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", + "less.lint.emptyRules.desc": "Do not use empty rulesets.", + "less.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", + "less.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", + "less.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", + "less.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", + "less.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", + "less.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", + "less.lint.importStatement.desc": "Import statements do not load in parallel.", + "less.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", + "less.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", + "less.lint.unknownAtRules.desc": "Unknown at-rule.", + "less.lint.unknownProperties.desc": "Unknown property.", + "less.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", + "less.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", + "less.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", + "less.lint.zeroUnits.desc": "No unit for zero needed.", + "less.validate.title": "Controls LESS validation and problem severities.", + "less.validate.desc": "Enables or disables all validations.", + "less.hover.documentation": "Show property and value documentation in LESS hovers.", + "less.hover.references": "Show references to MDN in LESS hovers.", + "less.format.enable.desc": "Enable/disable default LESS formatter.", + "less.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", + "less.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", + "less.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", + "less.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", + "less.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", + "less.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#less.format.preserveNewLines#` is enabled.", + "scss.title": "SCSS (Sass)", + "scss.alias.paths": "A series of entries which map imports to lookup locations within SCSS files. \n Single file reference: \"Stylesheet\": \"src/scss/styles.scss\". \n Reference folder: \"StylesDir/*\": \"src/scss/*\". \n @import 'Stylesheet' \n @import 'StylesDir/styles.scss", + "scss.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", + "scss.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", + "scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", + "scss.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", + "scss.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", + "scss.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", + "scss.lint.emptyRules.desc": "Do not use empty rulesets.", + "scss.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", + "scss.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", + "scss.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", + "scss.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", + "scss.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", + "scss.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", + "scss.lint.importStatement.desc": "Import statements do not load in parallel.", + "scss.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", + "scss.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", + "scss.lint.unknownAtRules.desc": "Unknown at-rule.", + "scss.lint.unknownProperties.desc": "Unknown property.", + "scss.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", + "scss.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", + "scss.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", + "scss.lint.zeroUnits.desc": "No unit for zero needed.", + "scss.validate.title": "Controls SCSS validation and problem severities.", + "scss.validate.desc": "Enables or disables all validations.", + "scss.hover.documentation": "Show property and value documentation in SCSS hovers.", + "scss.hover.references": "Show references to MDN in SCSS hovers.", + "scss.format.enable.desc": "Enable/disable default SCSS formatter.", + "scss.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", + "scss.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", + "scss.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", + "scss.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", + "scss.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", + "scss.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#scss.format.preserveNewLines#` is enabled.", + "css.colorDecorators.enable.deprecationMessage": "The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", + "scss.colorDecorators.enable.deprecationMessage": "The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", + "less.colorDecorators.enable.deprecationMessage": "The setting `less.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`." } From c676c692f5d98861408f0c2568c89943fc53b1f6 Mon Sep 17 00:00:00 2001 From: Simon Stranks Date: Wed, 1 Nov 2023 20:59:53 +0000 Subject: [PATCH 2/4] fix(package.json): pattern properties for css/scss fix(package.nls.json): amended key and description --- extensions/css-language-features/package.json | 26 +++++++++---------- .../css-language-features/package.nls.json | 22 ++++++++-------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index ecd4e6fecb6cd..1021c7b2f98c8 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -66,20 +66,19 @@ "default": true, "description": "%css.validate.desc%" }, - "css.alias.paths": { + "css.importAliases": { "type": "object", "additionalProperties": false, "patternProperties": { - "[^/]$": { + "^[^/]+(/)?$": { "type": "string", - "pattern": "((\\.css)|/\\*)$", - "patternErrorMessage": "Path must end with stylesheet filetype or folder glob '/*'" - }, - "patternErrorMessage": "Alias must not end with forward slash" + "pattern": "((\\.css)|/)$", + "patternErrorMessage": "Path must end with stylesheet filetype or forward slash" + } }, "scope": "resource", "default": null, - "description": "%css.alias.paths%" + "description": "%css.importAliases%" }, "css.hover.documentation": { "type": "boolean", @@ -397,20 +396,19 @@ "default": true, "description": "%scss.validate.desc%" }, - "scss.alias.paths": { + "scss.importAliases": { "type": "object", "additionalProperties": false, "patternProperties": { - "[^/]$": { + "^[^/]+(/)?$": { "type": "string", - "pattern": "((\\.s?css)|/\\*)$", - "patternErrorMessage": "Path must end with stylesheet filetype or folder glob '/*'" - }, - "patternErrorMessage": "Alias must not end with forward slash" + "pattern": "((\\.s?css)|/)$", + "patternErrorMessage": "Path must end with stylesheet filetype or forward slash" + } }, "scope": "resource", "default": null, - "description": "%scss.alias.paths%" + "description": "%scss.importAliases%" }, "scss.hover.documentation": { "type": "boolean", diff --git a/extensions/css-language-features/package.nls.json b/extensions/css-language-features/package.nls.json index 891eb5dfa04d7..adcad4543bc03 100644 --- a/extensions/css-language-features/package.nls.json +++ b/extensions/css-language-features/package.nls.json @@ -2,7 +2,7 @@ "displayName": "CSS Language Features", "description": "Provides rich language support for CSS, LESS and SCSS files.", "css.title": "CSS", - "css.alias.paths": "A series of entries which map imports to lookup locations within CSS files. \n Single file reference: \"Stylesheet\": \"src/css/styles.css\". \n Reference folder: \"StylesDir/*\": \"src/css/*\". \n @import 'Stylesheet' \n @import 'StylesDir/styles.css", + "css.importAliases": "Key-value pairs which can be used to map @import file references to predefined locations. Each key represents an alias and each value a specific file or a folder path; paths are relative to the current project root folder.", "css.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for the custom CSS properties, at directives, pseudo classes and pseudo elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.", "css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", "css.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", @@ -13,7 +13,7 @@ "css.lint.emptyRules.desc": "Do not use empty rulesets.", "css.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", "css.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "css.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", + "css.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", "css.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", "css.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", "css.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", @@ -29,14 +29,14 @@ "css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.", "css.validate.title": "Controls CSS validation and problem severities.", "css.validate.desc": "Enables or disables all validations.", - "css.hover.documentation": "Show property and value documentation in CSS hovers.", + "css.hover.documentation": "Show tag and attribute documentation in CSS hovers.", "css.hover.references": "Show references to MDN in CSS hovers.", "css.format.enable.desc": "Enable/disable default CSS formatter.", "css.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", "css.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", "css.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", "css.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "css.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", + "css.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", "css.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#css.format.preserveNewLines#` is enabled.", "less.title": "LESS", "less.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", @@ -48,7 +48,7 @@ "less.lint.emptyRules.desc": "Do not use empty rulesets.", "less.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", "less.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "less.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", + "less.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", "less.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", "less.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", "less.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", @@ -63,17 +63,17 @@ "less.lint.zeroUnits.desc": "No unit for zero needed.", "less.validate.title": "Controls LESS validation and problem severities.", "less.validate.desc": "Enables or disables all validations.", - "less.hover.documentation": "Show property and value documentation in LESS hovers.", + "less.hover.documentation": "Show tag and attribute documentation in LESS hovers.", "less.hover.references": "Show references to MDN in LESS hovers.", "less.format.enable.desc": "Enable/disable default LESS formatter.", "less.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", "less.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", "less.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", "less.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "less.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", + "less.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", "less.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#less.format.preserveNewLines#` is enabled.", "scss.title": "SCSS (Sass)", - "scss.alias.paths": "A series of entries which map imports to lookup locations within SCSS files. \n Single file reference: \"Stylesheet\": \"src/scss/styles.scss\". \n Reference folder: \"StylesDir/*\": \"src/scss/*\". \n @import 'Stylesheet' \n @import 'StylesDir/styles.scss", + "scss.importAliases": "Key-value pairs which can be used to map @import file references to predefined locations. Each key represents an alias and each value a specific file or a folder path; paths are relative to the current project root folder.", "scss.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", "scss.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", "scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", @@ -83,7 +83,7 @@ "scss.lint.emptyRules.desc": "Do not use empty rulesets.", "scss.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", "scss.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "scss.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", + "scss.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", "scss.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", "scss.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", "scss.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", @@ -98,14 +98,14 @@ "scss.lint.zeroUnits.desc": "No unit for zero needed.", "scss.validate.title": "Controls SCSS validation and problem severities.", "scss.validate.desc": "Enables or disables all validations.", - "scss.hover.documentation": "Show property and value documentation in SCSS hovers.", + "scss.hover.documentation": "Show tag and attribute documentation in SCSS hovers.", "scss.hover.references": "Show references to MDN in SCSS hovers.", "scss.format.enable.desc": "Enable/disable default SCSS formatter.", "scss.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", "scss.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", "scss.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", "scss.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "scss.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", + "scss.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", "scss.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#scss.format.preserveNewLines#` is enabled.", "css.colorDecorators.enable.deprecationMessage": "The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", "scss.colorDecorators.enable.deprecationMessage": "The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", From b241259f52e1a08fd71c19b574efd1bff23c3b30 Mon Sep 17 00:00:00 2001 From: Simon Stranks Date: Tue, 14 Oct 2025 14:45:40 +0100 Subject: [PATCH 3/4] fix(package.nls.json): updated descriptions fix(#460-css-languageservice): added settings per document; added cacheclear --- .../css-language-features/package.nls.json | 222 +++++++++--------- .../server/src/cssServer.ts | 28 ++- 2 files changed, 135 insertions(+), 115 deletions(-) diff --git a/extensions/css-language-features/package.nls.json b/extensions/css-language-features/package.nls.json index adcad4543bc03..a23e716cc65e7 100644 --- a/extensions/css-language-features/package.nls.json +++ b/extensions/css-language-features/package.nls.json @@ -1,113 +1,113 @@ { - "displayName": "CSS Language Features", - "description": "Provides rich language support for CSS, LESS and SCSS files.", - "css.title": "CSS", - "css.importAliases": "Key-value pairs which can be used to map @import file references to predefined locations. Each key represents an alias and each value a specific file or a folder path; paths are relative to the current project root folder.", - "css.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for the custom CSS properties, at directives, pseudo classes and pseudo elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.", - "css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", - "css.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", - "css.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", - "css.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", - "css.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", - "css.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", - "css.lint.emptyRules.desc": "Do not use empty rulesets.", - "css.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", - "css.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "css.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", - "css.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", - "css.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", - "css.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", - "css.lint.importStatement.desc": "Import statements do not load in parallel.", - "css.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", - "css.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", - "css.lint.unknownAtRules.desc": "Unknown at-rule.", - "css.lint.unknownProperties.desc": "Unknown property.", - "css.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", - "css.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", - "css.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", - "css.lint.zeroUnits.desc": "No unit for zero needed.", - "css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.", - "css.validate.title": "Controls CSS validation and problem severities.", - "css.validate.desc": "Enables or disables all validations.", - "css.hover.documentation": "Show tag and attribute documentation in CSS hovers.", - "css.hover.references": "Show references to MDN in CSS hovers.", - "css.format.enable.desc": "Enable/disable default CSS formatter.", - "css.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", - "css.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", - "css.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", - "css.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "css.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", - "css.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#css.format.preserveNewLines#` is enabled.", - "less.title": "LESS", - "less.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", - "less.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", - "less.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", - "less.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", - "less.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", - "less.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", - "less.lint.emptyRules.desc": "Do not use empty rulesets.", - "less.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", - "less.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "less.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", - "less.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", - "less.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", - "less.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", - "less.lint.importStatement.desc": "Import statements do not load in parallel.", - "less.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", - "less.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", - "less.lint.unknownAtRules.desc": "Unknown at-rule.", - "less.lint.unknownProperties.desc": "Unknown property.", - "less.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", - "less.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", - "less.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", - "less.lint.zeroUnits.desc": "No unit for zero needed.", - "less.validate.title": "Controls LESS validation and problem severities.", - "less.validate.desc": "Enables or disables all validations.", - "less.hover.documentation": "Show tag and attribute documentation in LESS hovers.", - "less.hover.references": "Show references to MDN in LESS hovers.", - "less.format.enable.desc": "Enable/disable default LESS formatter.", - "less.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", - "less.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", - "less.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", - "less.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "less.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", - "less.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#less.format.preserveNewLines#` is enabled.", - "scss.title": "SCSS (Sass)", - "scss.importAliases": "Key-value pairs which can be used to map @import file references to predefined locations. Each key represents an alias and each value a specific file or a folder path; paths are relative to the current project root folder.", - "scss.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", - "scss.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", - "scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", - "scss.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", - "scss.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", - "scss.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", - "scss.lint.emptyRules.desc": "Do not use empty rulesets.", - "scss.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", - "scss.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "scss.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", - "scss.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", - "scss.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", - "scss.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", - "scss.lint.importStatement.desc": "Import statements do not load in parallel.", - "scss.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", - "scss.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", - "scss.lint.unknownAtRules.desc": "Unknown at-rule.", - "scss.lint.unknownProperties.desc": "Unknown property.", - "scss.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", - "scss.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", - "scss.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", - "scss.lint.zeroUnits.desc": "No unit for zero needed.", - "scss.validate.title": "Controls SCSS validation and problem severities.", - "scss.validate.desc": "Enables or disables all validations.", - "scss.hover.documentation": "Show tag and attribute documentation in SCSS hovers.", - "scss.hover.references": "Show references to MDN in SCSS hovers.", - "scss.format.enable.desc": "Enable/disable default SCSS formatter.", - "scss.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", - "scss.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", - "scss.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", - "scss.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "scss.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", - "scss.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#scss.format.preserveNewLines#` is enabled.", - "css.colorDecorators.enable.deprecationMessage": "The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", - "scss.colorDecorators.enable.deprecationMessage": "The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", - "less.colorDecorators.enable.deprecationMessage": "The setting `less.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`." + "displayName": "CSS Language Features", + "description": "Provides rich language support for CSS, LESS and SCSS files.", + "css.title": "CSS", + "css.importAliases": "Defines path aliases for @import statements. Each key represents an alias and each value a file or folder path. Paths are resolved relative to the .vscode folder containing the settings file. In multi-root or monorepo workspaces, each folder can define its own aliases independently; an alias in workspace settings take priority over the same alias in nested settings.", + "css.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for the custom CSS properties, at directives, pseudo classes and pseudo elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.", + "css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", + "css.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", + "css.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", + "css.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", + "css.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", + "css.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", + "css.lint.emptyRules.desc": "Do not use empty rulesets.", + "css.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", + "css.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", + "css.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", + "css.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", + "css.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", + "css.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", + "css.lint.importStatement.desc": "Import statements do not load in parallel.", + "css.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", + "css.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", + "css.lint.unknownAtRules.desc": "Unknown at-rule.", + "css.lint.unknownProperties.desc": "Unknown property.", + "css.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", + "css.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", + "css.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", + "css.lint.zeroUnits.desc": "No unit for zero needed.", + "css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.", + "css.validate.title": "Controls CSS validation and problem severities.", + "css.validate.desc": "Enables or disables all validations.", + "css.hover.documentation": "Show tag and attribute documentation in CSS hovers.", + "css.hover.references": "Show references to MDN in CSS hovers.", + "css.format.enable.desc": "Enable/disable default CSS formatter.", + "css.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", + "css.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", + "css.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", + "css.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", + "css.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", + "css.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#css.format.preserveNewLines#` is enabled.", + "less.title": "LESS", + "less.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", + "less.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", + "less.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", + "less.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", + "less.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", + "less.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", + "less.lint.emptyRules.desc": "Do not use empty rulesets.", + "less.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", + "less.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", + "less.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", + "less.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", + "less.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", + "less.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", + "less.lint.importStatement.desc": "Import statements do not load in parallel.", + "less.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", + "less.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", + "less.lint.unknownAtRules.desc": "Unknown at-rule.", + "less.lint.unknownProperties.desc": "Unknown property.", + "less.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", + "less.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", + "less.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", + "less.lint.zeroUnits.desc": "No unit for zero needed.", + "less.validate.title": "Controls LESS validation and problem severities.", + "less.validate.desc": "Enables or disables all validations.", + "less.hover.documentation": "Show tag and attribute documentation in LESS hovers.", + "less.hover.references": "Show references to MDN in LESS hovers.", + "less.format.enable.desc": "Enable/disable default LESS formatter.", + "less.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", + "less.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", + "less.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", + "less.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", + "less.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", + "less.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#less.format.preserveNewLines#` is enabled.", + "scss.title": "SCSS (Sass)", + "scss.importAliases": "Defines path aliases for @import/@use statements. Each key represents an alias and each value a file or folder path. Paths are resolved relative to the .vscode folder containing the settings file. In multi-root or monorepo workspaces, each folder can define its own aliases independently; an alias in workspace settings take priority over the same alias in nested settings.", + "scss.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", + "scss.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", + "scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", + "scss.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", + "scss.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.", + "scss.lint.duplicateProperties.desc": "Do not use duplicate style definitions.", + "scss.lint.emptyRules.desc": "Do not use empty rulesets.", + "scss.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", + "scss.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", + "scss.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", + "scss.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", + "scss.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", + "scss.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", + "scss.lint.importStatement.desc": "Import statements do not load in parallel.", + "scss.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.", + "scss.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.", + "scss.lint.unknownAtRules.desc": "Unknown at-rule.", + "scss.lint.unknownProperties.desc": "Unknown property.", + "scss.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.", + "scss.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.", + "scss.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.", + "scss.lint.zeroUnits.desc": "No unit for zero needed.", + "scss.validate.title": "Controls SCSS validation and problem severities.", + "scss.validate.desc": "Enables or disables all validations.", + "scss.hover.documentation": "Show tag and attribute documentation in SCSS hovers.", + "scss.hover.references": "Show references to MDN in SCSS hovers.", + "scss.format.enable.desc": "Enable/disable default SCSS formatter.", + "scss.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", + "scss.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", + "scss.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", + "scss.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", + "scss.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", + "scss.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#scss.format.preserveNewLines#` is enabled.", + "css.colorDecorators.enable.deprecationMessage": "The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", + "scss.colorDecorators.enable.deprecationMessage": "The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", + "less.colorDecorators.enable.deprecationMessage": "The setting `less.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`." } diff --git a/extensions/css-language-features/server/src/cssServer.ts b/extensions/css-language-features/server/src/cssServer.ts index c3ab75519c3e0..21a6a000bfa64 100644 --- a/extensions/css-language-features/server/src/cssServer.ts +++ b/extensions/css-language-features/server/src/cssServer.ts @@ -175,6 +175,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment) function updateConfiguration(settings: any) { for (const languageId in languageServices) { languageServices[languageId].configure(settings[languageId]); + languageServices[languageId].clearCache(); } // reset all document settings documentSettings = {}; @@ -238,9 +239,19 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment) return runSafeAsync(runtime, async () => { const document = documents.get(documentDefinitionParams.textDocument.uri); if (document) { - await dataProvidersReady; + const [settings] = await Promise.all([ + getDocumentSettings(document), + dataProvidersReady + ]); + const languageService = getLanguageService(document); + + // Apply per-document configuration + if (settings) { + languageService.configure(settings); + } + const stylesheet = stylesheets.get(document); - return getLanguageService(document).findDefinition(document, documentDefinitionParams.position, stylesheet); + return languageService.findDefinition(document, documentDefinitionParams.position, stylesheet); } return null; }, null, `Error while computing definitions for ${documentDefinitionParams.textDocument.uri}`, token); @@ -263,10 +274,19 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment) return runSafeAsync(runtime, async () => { const document = documents.get(documentLinkParams.textDocument.uri); if (document) { - await dataProvidersReady; + const settingsPromise = getDocumentSettings(document); + const [settings] = await Promise.all([settingsPromise, dataProvidersReady]); + + const languageService = getLanguageService(document); + + // Apply per-document configuration + if (settings) { + languageService.configure(settings); + } + const documentContext = getDocumentContext(document.uri, workspaceFolders); const stylesheet = stylesheets.get(document); - return getLanguageService(document).findDocumentLinks2(document, stylesheet, documentContext); + return languageService.findDocumentLinks2(document, stylesheet, documentContext); } return []; }, [], `Error while computing document links for ${documentLinkParams.textDocument.uri}`, token); From 16703ceb473c348564037a6c5f0872caf6e3b1ee Mon Sep 17 00:00:00 2001 From: Simon Stranks Date: Tue, 14 Oct 2025 15:39:24 +0100 Subject: [PATCH 4/4] Merge branch 'main' into #163967-css-aliases --- .../css-language-features/package.nls.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/extensions/css-language-features/package.nls.json b/extensions/css-language-features/package.nls.json index a23e716cc65e7..ff794d02bd5a6 100644 --- a/extensions/css-language-features/package.nls.json +++ b/extensions/css-language-features/package.nls.json @@ -3,7 +3,7 @@ "description": "Provides rich language support for CSS, LESS and SCSS files.", "css.title": "CSS", "css.importAliases": "Defines path aliases for @import statements. Each key represents an alias and each value a file or folder path. Paths are resolved relative to the .vscode folder containing the settings file. In multi-root or monorepo workspaces, each folder can define its own aliases independently; an alias in workspace settings take priority over the same alias in nested settings.", - "css.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for the custom CSS properties, at directives, pseudo classes and pseudo elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.", + "css.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for CSS custom properties (variables), at-rules, pseudo-classes, and pseudo-elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.", "css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", "css.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.", "css.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", @@ -13,7 +13,7 @@ "css.lint.emptyRules.desc": "Do not use empty rulesets.", "css.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", "css.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "css.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", + "css.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", "css.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", "css.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", "css.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", @@ -29,14 +29,14 @@ "css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.", "css.validate.title": "Controls CSS validation and problem severities.", "css.validate.desc": "Enables or disables all validations.", - "css.hover.documentation": "Show tag and attribute documentation in CSS hovers.", + "css.hover.documentation": "Show property and value documentation in CSS hovers.", "css.hover.references": "Show references to MDN in CSS hovers.", "css.format.enable.desc": "Enable/disable default CSS formatter.", "css.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", "css.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", "css.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", "css.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "css.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", + "css.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", "css.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#css.format.preserveNewLines#` is enabled.", "less.title": "LESS", "less.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", @@ -48,7 +48,7 @@ "less.lint.emptyRules.desc": "Do not use empty rulesets.", "less.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", "less.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "less.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", + "less.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", "less.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", "less.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", "less.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", @@ -63,14 +63,14 @@ "less.lint.zeroUnits.desc": "No unit for zero needed.", "less.validate.title": "Controls LESS validation and problem severities.", "less.validate.desc": "Enables or disables all validations.", - "less.hover.documentation": "Show tag and attribute documentation in LESS hovers.", + "less.hover.documentation": "Show property and value documentation in LESS hovers.", "less.hover.references": "Show references to MDN in LESS hovers.", "less.format.enable.desc": "Enable/disable default LESS formatter.", "less.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", "less.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", "less.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", "less.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "less.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", + "less.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", "less.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#less.format.preserveNewLines#` is enabled.", "scss.title": "SCSS (Sass)", "scss.importAliases": "Defines path aliases for @import/@use statements. Each key represents an alias and each value a file or folder path. Paths are resolved relative to the .vscode folder containing the settings file. In multi-root or monorepo workspaces, each folder can define its own aliases independently; an alias in workspace settings take priority over the same alias in nested settings.", @@ -83,7 +83,7 @@ "scss.lint.emptyRules.desc": "Do not use empty rulesets.", "scss.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.", "scss.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.", - "scss.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.", + "scss.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.", "scss.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.", "scss.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.", "scss.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.", @@ -98,14 +98,14 @@ "scss.lint.zeroUnits.desc": "No unit for zero needed.", "scss.validate.title": "Controls SCSS validation and problem severities.", "scss.validate.desc": "Enables or disables all validations.", - "scss.hover.documentation": "Show tag and attribute documentation in SCSS hovers.", + "scss.hover.documentation": "Show property and value documentation in SCSS hovers.", "scss.hover.references": "Show references to MDN in SCSS hovers.", "scss.format.enable.desc": "Enable/disable default SCSS formatter.", "scss.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.", "scss.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.", "scss.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators '>', '+', '~' (e.g. `a > b`).", "scss.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).", - "scss.format.preserveNewLines.desc": "Whether existing line breaks before elements should be preserved.", + "scss.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.", "scss.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#scss.format.preserveNewLines#` is enabled.", "css.colorDecorators.enable.deprecationMessage": "The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.", "scss.colorDecorators.enable.deprecationMessage": "The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",