Skip to content

Commit 18456cd

Browse files
committed
Merge branch 'main' into readme-code-block-fix
2 parents affada7 + 1e3d5ce commit 18456cd

30 files changed

+725
-229
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### 1.15.0
2+
- Fix: some small type issues [#918](https://github.com/redhat-developer/yaml-language-server/pull/918)
3+
- Add: volar-service-yaml to clients [#920](https://github.com/redhat-developer/yaml-language-server/pull/920)
4+
- Fix: Remove ide-yaml from known clients [#921](https://github.com/redhat-developer/yaml-language-server/pull/921)
5+
- Fix: schema loading performance [#923](https://github.com/redhat-developer/yaml-language-server/pull/923)
6+
- Fix: undefined error in mergingResult.problemArgs [#924](https://github.com/redhat-developer/yaml-language-server/pull/924)
7+
- Add: unify string insert text for array and property [#934](https://github.com/redhat-developer/yaml-language-server/pull/934)
8+
- Add: Improve some special cases for selection ranges [#939](https://github.com/redhat-developer/yaml-language-server/pull/939)
9+
- Fix: show all enums on hover [#942](https://github.com/redhat-developer/yaml-language-server/pull/942)
10+
- Fix: update README syntax highlighting [#945](https://github.com/redhat-developer/yaml-language-server/pull/945)
11+
- Fix: render examples as yaml on hover [#947](https://github.com/redhat-developer/yaml-language-server/pull/947)
12+
- Fix: snippets in additionalProperties [#951](https://github.com/redhat-developer/yaml-language-server/pull/951)
13+
- Fix: crash when url is undefined [#954](https://github.com/redhat-developer/yaml-language-server/pull/954)
14+
- Fix: Add null check for customTags [#955](https://github.com/redhat-developer/yaml-language-server/pull/955)
15+
16+
Thanks to [Remco Haszing](https://github.com/remcohaszing), [Petr Spacek](https://github.com/p-spacek), [Tony](https://github.com/Legend-Master), [Gustav Eikaas](https://github.com/GustavEikaas), [Skip Baney](https://github.com/twelvelabs) and [Pierre Prinetti](https://github.com/pierreprinetti) for your contributions.
17+
118
### 1.14.0
219
- Fix: Request textDocument/hover failed with message: Invalid regular expression: /(?s).*/: Invalid group [#874](https://github.com/redhat-developer/yaml-language-server/issues/874)
320
- Fix: nested anyof const [#888](https://github.com/redhat-developer/yaml-language-server/pull/888)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ On Mac/Linux with full path:
159159

160160
Since `0.11.0` YAML Schemas can be used for validation:
161161

162-
```json
163-
"/home/user/custom_schema.yaml": "someFilePattern.yaml"
162+
```yaml
163+
"/home/user/custom_schema.yaml": "someFilePattern.yaml"
164164
```
165165
166166
A schema can be associated with multiple globs using a json array, e.g.
@@ -205,7 +205,7 @@ You can also use relative paths when working with multi root workspaces.
205205

206206
Suppose you have a multi root workspace that is laid out like:
207207

208-
```
208+
```yaml
209209
My_first_project:
210210
test.yaml
211211
my_schema.json
@@ -275,7 +275,7 @@ The image is located at `quay.io/redhat-developer/yaml-language-server`
275275

276276
To run the image you can use:
277277

278-
```
278+
```sh
279279
docker run -it quay.io/redhat-developer/yaml-language-server:latest
280280
```
281281

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@
2929
"type": "git",
3030
"url": "https://github.com/redhat-developer/yaml-language-server.git"
3131
},
32-
"optionalDependencies": {
33-
"prettier": "2.8.7"
34-
},
3532
"dependencies": {
3633
"ajv": "^8.11.0",
3734
"lodash": "4.17.21",
35+
"prettier": "^3.0.0",
3836
"request-light": "^0.5.7",
3937
"vscode-json-languageservice": "4.1.8",
40-
"vscode-languageserver": "^7.0.0",
38+
"vscode-languageserver": "^9.0.0",
4139
"vscode-languageserver-textdocument": "^1.0.1",
4240
"vscode-languageserver-types": "^3.16.0",
4341
"vscode-nls": "^5.0.0",
@@ -49,17 +47,16 @@
4947
"@types/chai": "^4.2.12",
5048
"@types/mocha": "8.2.2",
5149
"@types/node": "16.x",
52-
"@types/prettier": "2.7.2",
5350
"@types/sinon": "^9.0.5",
5451
"@types/sinon-chai": "^3.2.5",
5552
"@typescript-eslint/eslint-plugin": "^5.38.0",
5653
"@typescript-eslint/parser": "^5.38.0",
5754
"chai": "^4.2.0",
5855
"coveralls": "3.1.1",
5956
"eslint": "^8.24.0",
60-
"eslint-config-prettier": "^8.5.0",
57+
"eslint-config-prettier": "^9.0.0",
6158
"eslint-plugin-import": "^2.26.0",
62-
"eslint-plugin-prettier": "^4.2.1",
59+
"eslint-plugin-prettier": "^5.0.0",
6360
"http-proxy-agent": "^5.0.0",
6461
"https-proxy-agent": "^5.0.0",
6562
"mocha": "9.2.2",

src/languageserver/handlers/languageHandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class LanguageHandlers {
114114
* Called when the formatter is invoked
115115
* Returns the formatted document content using prettier
116116
*/
117-
formatterHandler(formatParams: DocumentFormattingParams): TextEdit[] {
117+
formatterHandler(formatParams: DocumentFormattingParams): Promise<TextEdit[]> {
118118
const document = this.yamlSettings.documents.get(formatParams.textDocument.uri);
119119

120120
if (!document) {

src/languageserver/handlers/requestHandlers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import { SchemaModificationNotification } from '../../requestTypes';
1414

1515
export class RequestHandlers {
1616
private languageService: LanguageService;
17-
constructor(private readonly connection: Connection, languageService: LanguageService) {
17+
constructor(
18+
private readonly connection: Connection,
19+
languageService: LanguageService
20+
) {
1821
this.languageService = languageService;
1922
}
2023

src/languageserver/handlers/settingsHandlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class SettingsHandler {
8181

8282
if (settings.yaml.schemaStore) {
8383
this.yamlSettings.schemaStoreEnabled = settings.yaml.schemaStore.enable;
84-
if (settings.yaml.schemaStore.url.length !== 0) {
84+
if (settings.yaml.schemaStore.url?.length !== 0) {
8585
this.yamlSettings.schemaStoreUrl = settings.yaml.schemaStore.url;
8686
}
8787
}
@@ -180,7 +180,7 @@ export class SettingsHandler {
180180
private async setSchemaStoreSettingsIfNotSet(): Promise<void> {
181181
const schemaStoreIsSet = this.yamlSettings.schemaStoreSettings.length !== 0;
182182
let schemaStoreUrl = '';
183-
if (this.yamlSettings.schemaStoreUrl.length !== 0) {
183+
if (this.yamlSettings.schemaStoreUrl?.length !== 0) {
184184
schemaStoreUrl = this.yamlSettings.schemaStoreUrl;
185185
} else {
186186
schemaStoreUrl = JSON_SCHEMASTORE_URL;

src/languageserver/handlers/validationHandlers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ export class ValidationHandler {
1414
private languageService: LanguageService;
1515
private yamlSettings: SettingsState;
1616

17-
constructor(private readonly connection: Connection, languageService: LanguageService, yamlSettings: SettingsState) {
17+
constructor(
18+
private readonly connection: Connection,
19+
languageService: LanguageService,
20+
yamlSettings: SettingsState
21+
) {
1822
this.languageService = languageService;
1923
this.yamlSettings = yamlSettings;
2024

src/languageserver/handlers/workspaceHandlers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import { ExecuteCommandParams, Connection } from 'vscode-languageserver';
77
import { CommandExecutor } from '../commandExecutor';
88

99
export class WorkspaceHandlers {
10-
constructor(private readonly connection: Connection, private readonly commandExecutor: CommandExecutor) {}
10+
constructor(
11+
private readonly connection: Connection,
12+
private readonly commandExecutor: CommandExecutor
13+
) {}
1114

1215
registerHandlers(): void {
1316
this.connection.onExecuteCommand((params) => this.executeCommand(params));

src/languageservice/parser/jsonParser07.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ export interface ISchemaCollector {
286286

287287
class SchemaCollector implements ISchemaCollector {
288288
schemas: IApplicableSchema[] = [];
289-
constructor(private focusOffset = -1, private exclude: ASTNode = null) {}
289+
constructor(
290+
private focusOffset = -1,
291+
private exclude: ASTNode = null
292+
) {}
290293
add(schema: IApplicableSchema): void {
291294
this.schemas.push(schema);
292295
}
@@ -888,6 +891,7 @@ function validate(
888891
),
889892
source: getSchemaSource(schema, originalSchema),
890893
schemaUri: getSchemaUri(schema, originalSchema),
894+
data: { values: schema.enum },
891895
});
892896
}
893897
}
@@ -907,6 +911,7 @@ function validate(
907911
source: getSchemaSource(schema, originalSchema),
908912
schemaUri: getSchemaUri(schema, originalSchema),
909913
problemArgs: [JSON.stringify(schema.const)],
914+
data: { values: [schema.const] },
910915
});
911916
validationResult.enumValueMatch = false;
912917
} else {
@@ -1385,6 +1390,7 @@ function validate(
13851390
length: propertyNode.keyNode.length,
13861391
},
13871392
severity: DiagnosticSeverity.Warning,
1393+
code: ErrorCode.PropertyExpected,
13881394
message: schema.errorMessage || localize('DisallowedExtraPropWarning', MSG_PROPERTY_NOT_ALLOWED, propertyName),
13891395
source: getSchemaSource(schema, originalSchema),
13901396
schemaUri: getSchemaUri(schema, originalSchema),

src/languageservice/services/documentSymbols.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ import { convertErrorToTelemetryMsg } from '../utils/objects';
1717
export class YAMLDocumentSymbols {
1818
private jsonDocumentSymbols;
1919

20-
constructor(schemaService: YAMLSchemaService, private readonly telemetry?: Telemetry) {
20+
constructor(
21+
schemaService: YAMLSchemaService,
22+
private readonly telemetry?: Telemetry
23+
) {
2124
this.jsonDocumentSymbols = new JSONDocumentSymbols(schemaService);
2225

2326
// override 'getKeyLabel' to handle complex mapping

0 commit comments

Comments
 (0)