Skip to content

Commit 0fab736

Browse files
authored
Merge pull request #153 from mrjones2014/mrj/push-zoouttkzsumz
feat(schema): Download and use `*.nls.json` files for i18n
2 parents 81c7fb3 + e0d6673 commit 0fab736

25 files changed

Lines changed: 4132 additions & 1154 deletions

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ return {
6060
lua_ls_integration = true,
6161
--- How to merge lists; 'append' (default), 'prepend' or 'replace'
6262
merge_lists = 'append',
63+
--- Controls placeholder string substitution in LSP schema descriptions.
64+
--- - true (default): use bundled English NLS files
65+
--- - false: disable substitution (raw placeholders visible)
66+
--- - string: path to a directory of per-LSP NLS JSON files (e.g. "/path/to/dir" containing jsonls.nls.json, lua_ls.nls.json, etc.)
67+
--- - table: flat `{ ["key"] = "value" }` NLS table applied to all LSPs
68+
--- - function(lsp_name) -> table: per-LSP resolver
69+
--- Note that only certain schemas support this, see the bundled *.nls.json files at
70+
--- ./after/codesettings-nls/*.nls.json
71+
nls = true,
6372
--- Provide your own root dir; can be a string or function returning a string.
6473
--- It should be/return the full absolute path to the root directory.
6574
--- If not set, defaults to `require('codesettings.util').get_root()`
@@ -197,8 +206,9 @@ return {
197206
}
198207
```
199208

200-
To get autocomplete in Lua files, either set `config.lua_ls_integration = true`, or (for `lua_ls` only, not `emmylua_ls`) use `---@module 'codesettings'` which will tell `lua_ls` as though `codesettings`
201-
has been `require`d, then you will have access to `---@type lsp.server_name` generated type annotations.
209+
To get autocomplete in Lua files, either set `config.lua_ls_integration = true`, or (for `lua_ls` only, not `emmylua_ls`) use
210+
`---@module 'codesettings'` which will tell `lua_ls` to act as though `codesettings` has been `require`d, then you will
211+
have access to `---@type lsp.server_name` generated type annotations.
202212

203213
```lua
204214
-- for example, for lua_ls
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"css.colorDecorators.enable.deprecationMessage": "The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",
3+
"css.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.",
4+
"css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.",
5+
"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.",
6+
"css.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).",
7+
"css.format.enable.desc": "Enable/disable default CSS formatter.",
8+
"css.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#css.format.preserveNewLines#` is enabled.",
9+
"css.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.",
10+
"css.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.",
11+
"css.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.",
12+
"css.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators `>`, `+`, `~` (e.g. `a > b`).",
13+
"css.hover.documentation": "Show property and value documentation in CSS hovers.",
14+
"css.hover.references": "Show references to MDN in CSS hovers.",
15+
"css.lint.argumentsInColorFunction.desc": "Invalid number of parameters.",
16+
"css.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.",
17+
"css.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.",
18+
"css.lint.duplicateProperties.desc": "Do not use duplicate style definitions.",
19+
"css.lint.emptyRules.desc": "Do not use empty rulesets.",
20+
"css.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.",
21+
"css.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.",
22+
"css.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.",
23+
"css.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.",
24+
"css.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.",
25+
"css.lint.importStatement.desc": "Import statements do not load in parallel.",
26+
"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.",
27+
"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.",
28+
"css.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.",
29+
"css.lint.unknownAtRules.desc": "Unknown at-rule.",
30+
"css.lint.unknownProperties.desc": "Unknown property.",
31+
"css.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.",
32+
"css.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.",
33+
"css.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.",
34+
"css.lint.zeroUnits.desc": "No unit for zero needed.",
35+
"css.title": "CSS",
36+
"css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.",
37+
"css.validate.desc": "Enables or disables all validations.",
38+
"css.validate.title": "Controls CSS validation and problem severities.",
39+
"description": "Provides rich language support for CSS, LESS and SCSS files.",
40+
"displayName": "CSS Language Features",
41+
"less.colorDecorators.enable.deprecationMessage": "The setting `less.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",
42+
"less.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.",
43+
"less.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.",
44+
"less.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).",
45+
"less.format.enable.desc": "Enable/disable default LESS formatter.",
46+
"less.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#less.format.preserveNewLines#` is enabled.",
47+
"less.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.",
48+
"less.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.",
49+
"less.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.",
50+
"less.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators `>`, `+`, `~` (e.g. `a > b`).",
51+
"less.hover.documentation": "Show property and value documentation in LESS hovers.",
52+
"less.hover.references": "Show references to MDN in LESS hovers.",
53+
"less.lint.argumentsInColorFunction.desc": "Invalid number of parameters.",
54+
"less.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.",
55+
"less.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.",
56+
"less.lint.duplicateProperties.desc": "Do not use duplicate style definitions.",
57+
"less.lint.emptyRules.desc": "Do not use empty rulesets.",
58+
"less.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.",
59+
"less.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.",
60+
"less.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.",
61+
"less.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.",
62+
"less.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.",
63+
"less.lint.importStatement.desc": "Import statements do not load in parallel.",
64+
"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.",
65+
"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.",
66+
"less.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.",
67+
"less.lint.unknownAtRules.desc": "Unknown at-rule.",
68+
"less.lint.unknownProperties.desc": "Unknown property.",
69+
"less.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.",
70+
"less.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.",
71+
"less.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.",
72+
"less.lint.zeroUnits.desc": "No unit for zero needed.",
73+
"less.title": "LESS",
74+
"less.validate.desc": "Enables or disables all validations.",
75+
"less.validate.title": "Controls LESS validation and problem severities.",
76+
"scss.colorDecorators.enable.deprecationMessage": "The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",
77+
"scss.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties.",
78+
"scss.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.",
79+
"scss.format.braceStyle.desc": "Put braces on the same line as rules (`collapse`) or put braces on own line (`expand`).",
80+
"scss.format.enable.desc": "Enable/disable default SCSS formatter.",
81+
"scss.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk, when `#scss.format.preserveNewLines#` is enabled.",
82+
"scss.format.newlineBetweenRules.desc": "Separate rulesets by a blank line.",
83+
"scss.format.newlineBetweenSelectors.desc": "Separate selectors with a new line.",
84+
"scss.format.preserveNewLines.desc": "Whether existing line breaks before rules and declarations should be preserved.",
85+
"scss.format.spaceAroundSelectorSeparator.desc": "Ensure a space character around selector separators `>`, `+`, `~` (e.g. `a > b`).",
86+
"scss.hover.documentation": "Show property and value documentation in SCSS hovers.",
87+
"scss.hover.references": "Show references to MDN in SCSS hovers.",
88+
"scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters.",
89+
"scss.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.",
90+
"scss.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.",
91+
"scss.lint.duplicateProperties.desc": "Do not use duplicate style definitions.",
92+
"scss.lint.emptyRules.desc": "Do not use empty rulesets.",
93+
"scss.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.",
94+
"scss.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.",
95+
"scss.lint.hexColorLength.desc": "Hex colors must consist of 3, 4, 6 or 8 hex numbers.",
96+
"scss.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.",
97+
"scss.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.",
98+
"scss.lint.importStatement.desc": "Import statements do not load in parallel.",
99+
"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.",
100+
"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.",
101+
"scss.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.",
102+
"scss.lint.unknownAtRules.desc": "Unknown at-rule.",
103+
"scss.lint.unknownProperties.desc": "Unknown property.",
104+
"scss.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.",
105+
"scss.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.",
106+
"scss.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.",
107+
"scss.lint.zeroUnits.desc": "No unit for zero needed.",
108+
"scss.title": "SCSS (Sass)",
109+
"scss.validate.desc": "Enables or disables all validations.",
110+
"scss.validate.title": "Controls SCSS validation and problem severities."
111+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"description": "Provides rich language support for HTML and Handlebar files",
3+
"displayName": "HTML Language Features",
4+
"html.autoClosingTags": "Enable/disable autoclosing of HTML tags.",
5+
"html.autoCreateQuotes": "Enable/disable auto creation of quotes for HTML attribute assignment. The type of quotes can be configured by `#html.completion.attributeDefaultValue#`.",
6+
"html.completion.attributeDefaultValue": "Controls the default value for attributes when completion is accepted.",
7+
"html.completion.attributeDefaultValue.doublequotes": "Attribute value is set to \"\".",
8+
"html.completion.attributeDefaultValue.empty": "Attribute value is not set.",
9+
"html.completion.attributeDefaultValue.singlequotes": "Attribute value is set to ''.",
10+
"html.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-html-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its HTML support for the custom HTML tags, attributes and attribute values you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.",
11+
"html.format.contentUnformatted.desc": "List of tags, comma separated, where the content shouldn't be reformatted. `null` defaults to the `pre` tag.",
12+
"html.format.enable.desc": "Enable/disable default HTML formatter.",
13+
"html.format.extraLiners.desc": "List of tags, comma separated, that should have an extra newline before them. `null` defaults to `\"head, body, /html\"`.",
14+
"html.format.indentHandlebars.desc": "Format and indent `{{#foo}}` and `{{/foo}}`.",
15+
"html.format.indentInnerHtml.desc": "Indent `<head>` and `<body>` sections.",
16+
"html.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk. Use `null` for unlimited.",
17+
"html.format.preserveNewLines.desc": "Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.",
18+
"html.format.templating.desc": "Honor django, erb, handlebars and php templating language tags.",
19+
"html.format.unformatted.desc": "List of tags, comma separated, that shouldn't be reformatted. `null` defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.",
20+
"html.format.unformattedContentDelimiter.desc": "Keep text content together between this string.",
21+
"html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.",
22+
"html.format.wrapAttributes.auto": "Wrap attributes only when line length is exceeded.",
23+
"html.format.wrapAttributes.desc": "Wrap attributes.",
24+
"html.format.wrapAttributes.force": "Wrap each attribute except first.",
25+
"html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.",
26+
"html.format.wrapAttributes.forcemultiline": "Wrap each attribute.",
27+
"html.format.wrapAttributes.preserve": "Preserve wrapping of attributes.",
28+
"html.format.wrapAttributes.preservealigned": "Preserve wrapping of attributes but align.",
29+
"html.format.wrapAttributesIndentSize.desc": "Indent wrapped attributes to after N characters. Use `null` to use the default indent size. Ignored if `#html.format.wrapAttributes#` is set to `aligned`.",
30+
"html.format.wrapLineLength.desc": "Maximum amount of characters per line (0 = disable).",
31+
"html.hover.documentation": "Show tag and attribute documentation in hover.",
32+
"html.hover.references": "Show references to MDN in hover.",
33+
"html.mirrorCursorOnMatchingTag": "Enable/disable mirroring cursor on matching HTML tag.",
34+
"html.mirrorCursorOnMatchingTagDeprecationMessage": "Deprecated in favor of `editor.linkedEditing`",
35+
"html.suggest.hideEndTagSuggestions.desc": "Controls whether the built-in HTML language support suggests closing tags. When disabled, end tag completions like `</div>` will not be shown.",
36+
"html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.",
37+
"html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.",
38+
"html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.",
39+
"html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles."
40+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"description": "Provides rich language support for JSON files.",
3+
"displayName": "JSON Language Features",
4+
"json.clickToRetry": "Click to retry.",
5+
"json.colorDecorators.enable.deprecationMessage": "The setting `json.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",
6+
"json.colorDecorators.enable.desc": "Enables or disables color decorators",
7+
"json.command.clearCache": "Clear Schema Cache",
8+
"json.command.sort": "Sort Document",
9+
"json.enableSchemaDownload.desc": "When enabled, JSON schemas can be fetched from http and https locations.",
10+
"json.format.enable.desc": "Enable/disable default JSON formatter",
11+
"json.format.keepLines.desc": "Keep all existing new lines when formatting.",
12+
"json.maxItemsComputed.desc": "The maximum number of outline symbols and folding regions computed (limited for performance reasons).",
13+
"json.maxItemsExceededInformation.desc": "Show notification when exceeding the maximum number of outline symbols and folding regions.",
14+
"json.schemaDownload.trustedDomains.desc": "List of trusted domains for downloading JSON schemas over http(s). Use `*` to trust all domains. `*` can also be used as a wildcard in domain names.",
15+
"json.schemaResolutionErrorMessage": "Unable to resolve schema.",
16+
"json.schemas.desc": "Associate schemas to JSON files in the current project.",
17+
"json.schemas.fileMatch.desc": "An array of file patterns to match against when resolving JSON files to schemas. `*` and `**` can be used as a wildcard. Exclusion patterns can also be defined and start with `!`. A file matches when there is at least one matching pattern and the last matching pattern is not an exclusion pattern.",
18+
"json.schemas.fileMatch.item.desc": "A file pattern that can contain `*` and `**` to match against when resolving JSON files to schemas. When beginning with `!`, it defines an exclusion pattern.",
19+
"json.schemas.schema.desc": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.",
20+
"json.schemas.url.desc": "A URL or absolute file path to a schema. Can be a relative path (starting with `./`) in workspace and workspace folder settings.",
21+
"json.tracing.desc": "Traces the communication between VS Code and the JSON language server.",
22+
"json.validate.enable.desc": "Enable/disable JSON validation.",
23+
"json.workspaceTrust": "The extension requires workspace trust to load schemas from http and https."
24+
}

0 commit comments

Comments
 (0)