Skip to content

Commit 3746782

Browse files
authored
Merge branch 'main' into codex/fix-big-integer-key-duplication-test
2 parents cdf6b00 + 37a7b17 commit 3746782

81 files changed

Lines changed: 14648 additions & 2645 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# Global Owners
2-
* @evidolob
3-
* @msivasubramaniaan
2+
* @datho7561

.github/workflows/CI.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
uses: coverallsapp/github-action@c7885c00cb7ec0b8f9f5ff3f53cddb980f7a4412 # v2.2.0
7575
with:
7676
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
continue-on-error: true
7778

7879
- name: Publish
7980
if: ${{ success() && runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}

.mocharc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"timeout": "5000",
2+
"timeout": "10000",
33
"ui": "bdd",
44
"extension": ["ts"],
55
"package": "./package.json",

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"label": "watch typescript",
88
"type": "shell",
9-
"command": "yarn run watch",
9+
"command": "npm run watch",
1010
"presentation": {
1111
"reveal": "never"
1212
},

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,50 @@
1+
### 1.21.0
2+
- Feat: Enable suppressing diagnostics per-line by adding a `# yaml-language-server-disable` comment [vscode-yaml#666](https://github.com/redhat-developer/vscode-yaml/issues/666)
3+
- Feat: Allow `yaml.validate` and `yaml.format.enable` to be overriden in language-specific settings [#1188](https://github.com/redhat-developer/yaml-language-server/pull/1188)
4+
- Fix: Do not register the extension for templated YAML languages (such as Helm, Jinja, etc.) [vscode-yaml#1204](https://github.com/redhat-developer/vscode-yaml/issues/1204)
5+
- Fix: Handle default booleans and integers properly in required properties completion [vscode-yaml#1205](https://github.com/redhat-developer/vscode-yaml/issues/1205)
6+
- Fix: Prevent infinite `$ref` resolution loops [#1195](https://github.com/redhat-developer/yaml-language-server/issues/1195)
7+
- Fix: Preserve document end marker (`...`) when formatting (by updating prettier to 3.8.1) [vscode-yaml#1211](https://github.com/redhat-developer/vscode-yaml/issues/1211)
8+
- Fix: Don't escape '-' in hover text, since it was breaking links [#1151](https://github.com/redhat-developer/yaml-language-server/issues/1151)
9+
- Fix: Attempt to resolve a schema referenced through a relative `$ref` locally before peforming a remote `$id` lookup [#1186](https://github.com/redhat-developer/yaml-language-server/issues/1184)
10+
- Fix: Improve documentation of `yaml.schemas` setting [vscode-yaml#1207](https://github.com/redhat-developer/vscode-yaml/issues/1207)
11+
12+
Thanks to [Simon Heather](https://github.com/X-Guardian) for your contributions
13+
14+
### 1.20.0
15+
- Feat: Support JSON Schema 2019-09 and 2020-12 [#478](https://github.com/redhat-developer/yaml-language-server/issues/478), [vscode-yaml#1122](https://github.com/redhat-developer/vscode-yaml/issues/1122), [#823](https://github.com/redhat-developer/yaml-language-server/issues/823)
16+
- Feat: Support drafts 2019-09 and 2020-12 when validating a referenced JSON schema using AJV [#1164](https://github.com/redhat-developer/yaml-language-server/pull/1164)
17+
- Feat: Autodetect schema when working with a Kubernetes custom resource [#605](https://github.com/redhat-developer/yaml-language-server/issues/605)
18+
- Feat: Add CLI flag to report version and report version in initialization result [#1142](https://github.com/redhat-developer/yaml-language-server/issues/1142)
19+
- Feat: Add rename support for anchors and aliases [#1149](https://github.com/redhat-developer/yaml-language-server/pull/1149)
20+
- Feat: Add anchor preview in hover [#1150](https://github.com/redhat-developer/yaml-language-server/pull/1150)
21+
- Feat: Refactoring to change strings into block strings [#1119](https://github.com/redhat-developer/yaml-language-server/issues/1119)
22+
- Feat: Report the error message from the schema (if available) when a property is missing [#1138](https://github.com/redhat-developer/yaml-language-server/pull/1138)
23+
- Fix: Properly register formatter for all YAML files [#1147](https://github.com/redhat-developer/yaml-language-server/issues/1147)
24+
- Fix: Address 'no scope' warning in logs [vscode-yaml#972](https://github.com/redhat-developer/vscode-yaml/issues/972)
25+
- Fix: Improve auto-completion for required enum properties and fix default value labeling [vscode-yaml#1125](https://github.com/redhat-developer/vscode-yaml/issues/1125), [vscode-yaml#1160](https://github.com/redhat-developer/vscode-yaml/issues/1160)
26+
- Fix: Prevent error when hovering YAML 1.1 boolean values [#1152](https://github.com/redhat-developer/yaml-language-server/issues/1152)
27+
- Fix: Properly escape quotes when completing `const` values, `enum` values, or property names [vscode-yaml#1181](https://github.com/redhat-developer/vscode-yaml/issues/1181)
28+
- Fix: Prevent links in plain text hover documentation from being broken by aggressive escaping [#1151](https://github.com/redhat-developer/yaml-language-server/issues/1151)
29+
- Fix: Property name completion properly suggests the `enum` and `const` values instead of the schema title, and takes into account `anyOf` and `allOf` [#1141](https://github.com/redhat-developer/yaml-language-server/issues/1141)
30+
- Fix: Fix loading translations on web [vscode-yaml#1191](https://github.com/redhat-developer/vscode-yaml/issues/1191)
31+
- Fix: Fix 'go to schema' CodeLens on web [vscode-yaml#1195](https://github.com/redhat-developer/vscode-yaml/issues/1195)
32+
- Fix: Drop lodash from dependencies [#1170](https://github.com/redhat-developer/yaml-language-server/pull/1170)
33+
- Fix: Don't syntax highlight 1.4.0 as a float [#901](https://github.com/redhat-developer/vscode-yaml/issues/901)
34+
- Fix: Register ansible and ansible-jinja languages for formatter [vscode-yaml#812](https://github.com/redhat-developer/vscode-yaml/issues/812)
35+
- Fix: Fix loading schemas from workspace when working in a web environment [vscode-yaml#1194](https://github.com/redhat-developer/vscode-yaml/issues/1194)
36+
- Fix: Improve range of 'key ordering' error [#1177](https://github.com/redhat-developer/yaml-language-server/issues/1177)
37+
- Fix: Prevent the key ordering quickfix from breaking the YAML [#1171](https://github.com/redhat-developer/yaml-language-server/issues/1171)
38+
- Fix: Prevent dereferencing `undefined` in `pickSchemaDialect` [#1176](https://github.com/redhat-developer/yaml-language-server/pull/1176)
39+
- Bump: js-yaml version [#1143](https://github.com/redhat-developer/yaml-language-server/pull/1143)
40+
41+
Thanks to [Petr Spacek](https://github.com/p-spacek), [Lawrence Troup](https://github.com/lawrencetroup), [elohmeier](https://github.com/elohmeier),
42+
[Ronald Wahl](https://github.com/rowahl), [Marius Svechla](https://github.com/msvechla), [qvalentin](https://github.com/qvalentin),
43+
[Hugo Hache](https://github.com/Hugo-Hache), [Nikita Karamov](https://github.com/kytta), [Guillermo Rodríguez](https://github.com/guille)
44+
and [Lanqing Huang](https://github.com/lqhuang) for your contributions
45+
46+
A special shoutout to [Morgan Chang](https://github.com/shin19991207) for her tireless work on the validator.
47+
148
### 1.19.2
249
- Fix: QuickFix to replace value with integer/number appears blank and doesn't work [#1116](https://github.com/redhat-developer/yaml-language-server/issues/1116)
350
- Fix: Support `yaml-textmate` and `yaml-tmlanguage` languages [#1132](https://github.com/redhat-developer/yaml-language-server/pull/1132)

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# YAML Language Server
44

5-
Supports JSON Schema 7 and below.
5+
Supports JSON Schema drafts 04, 07, 2019-09, and 2020-12.
66
Starting from `1.0.0` the language server uses [eemeli/yaml](https://github.com/eemeli/yaml) as the new YAML parser, which strictly enforces the specified YAML spec version. Default YAML spec version is `1.2`, it can be changed with `yaml.yamlVersion` setting.
77

88
## Features
@@ -41,6 +41,8 @@ The following settings are supported:
4141
- `yaml.schemas`: Helps you associate schemas with files in a glob pattern
4242
- `yaml.schemaStore.enable`: When set to true the YAML language server will pull in all available schemas from [JSON Schema Store](https://www.schemastore.org)
4343
- `yaml.schemaStore.url`: URL of a schema store catalog to use when downloading schemas.
44+
- `yaml.kubernetesCRDStore.enable`: When set to true the YAML language server will parse Kubernetes CRDs automatically and download them from the [CRD store](https://github.com/datreeio/CRDs-catalog).
45+
- `yaml.kubernetesCRDStore.url`: URL of a crd store catalog to use when downloading schemas. Defaults to `https://raw.githubusercontent.com/datreeio/CRDs-catalog/main`.
4446
- `yaml.customTags`: Array of custom tags that the parser will validate against. It has two ways to be used. Either an item in the array is a custom tag such as "!Ref" and it will automatically map !Ref to scalar or you can specify the type of the object !Ref should be e.g. "!Ref sequence". The type of object can be either scalar (for strings and booleans), sequence (for arrays), map (for objects).
4547
- `yaml.maxItemsComputed`: The maximum number of outline symbols and folding regions computed (limited for performance reasons).
4648
- `[yaml].editor.tabSize`: the number of spaces to use when autocompleting. Takes priority over editor.tabSize.
@@ -54,6 +56,33 @@ The following settings are supported:
5456
- `yaml.style.flowSequence` : Forbids flow style sequences if set to `forbid`
5557
- `yaml.keyOrdering` : Enforces alphabetical ordering of keys in mappings when set to `true`. Default is `false`
5658

59+
## Suppressing diagnostics
60+
61+
You can suppress specific validation warnings on a per-line basis by adding a `# yaml-language-server-disable` comment on the line immediately before the one producing the diagnostic.
62+
63+
### Suppress all diagnostics on a line
64+
65+
```yaml
66+
# yaml-language-server-disable
67+
version: 123
68+
```
69+
70+
### Suppress only specific diagnostics
71+
72+
Provide one or more message substrings (comma-separated, case-insensitive). Only diagnostics whose message contains a matching substring will be suppressed; the rest are kept.
73+
74+
```yaml
75+
# yaml-language-server-disable Incorrect type
76+
version: 123
77+
```
78+
79+
```yaml
80+
# yaml-language-server-disable Incorrect type, not accepted
81+
version: 123
82+
```
83+
84+
The substrings are matched against the diagnostic message text reported by the language server.
85+
5786
##### Adding custom tags
5887
5988
In order to use the custom tags in your YAML file you need to first specify the custom tags in the setting of your code editor. For example, we can have the following custom tags:
@@ -258,6 +287,12 @@ or absolute path:
258287
# yaml-language-server: $schema=/absolute/path/to/schema
259288
```
260289

290+
or IntelliJ compatible format:
291+
292+
```yaml
293+
# $schema: <urlOrPathToTheSchema>
294+
```
295+
261296
### Schema priority
262297

263298
The following is the priority of schema association in highest to lowest priority:

bin/yaml-language-server

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
#!/usr/bin/env node
22

3+
const version = require('../package.json').version;
4+
const args = process.argv.slice(2);
5+
6+
if (args.includes('--version') || args.includes('-version')) {
7+
console.log(version);
8+
process.exit(0);
9+
}
10+
11+
if (args.includes('--help') || args.includes('-help') || args.includes('-h')) {
12+
console.log(`Usage: yaml-language-server [transport]
13+
14+
LSP transport options:
15+
--stdio communicate using standard input/output (stdin/stdout)
16+
--node-ipc communicate using Node IPC
17+
--socket=<number> listen on a TCP socket on the given port number
18+
19+
Other:
20+
--version | -version print product version to the output stream and exit
21+
--help | -help | -h print this help message to the output stream and exit
22+
`);
23+
process.exit(0);
24+
}
25+
26+
process.env.YAML_LANGUAGE_SERVER_VERSION = version;
327
require('../out/server/src/server.js');

0 commit comments

Comments
 (0)