diff --git a/CHANGELOG.md b/CHANGELOG.md index c1c381fd..06b89ee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +### 1.15.0 +- Fix: some small type issues [#918](https://github.com/redhat-developer/yaml-language-server/pull/918) +- Add: volar-service-yaml to clients [#920](https://github.com/redhat-developer/yaml-language-server/pull/920) +- Fix: Remove ide-yaml from known clients [#921](https://github.com/redhat-developer/yaml-language-server/pull/921) +- Fix: schema loading performance [#923](https://github.com/redhat-developer/yaml-language-server/pull/923) +- Fix: undefined error in mergingResult.problemArgs [#924](https://github.com/redhat-developer/yaml-language-server/pull/924) +- Add: unify string insert text for array and property [#934](https://github.com/redhat-developer/yaml-language-server/pull/934) +- Add: Improve some special cases for selection ranges [#939](https://github.com/redhat-developer/yaml-language-server/pull/939) +- Fix: show all enums on hover [#942](https://github.com/redhat-developer/yaml-language-server/pull/942) +- Fix: update README syntax highlighting [#945](https://github.com/redhat-developer/yaml-language-server/pull/945) +- Fix: render examples as yaml on hover [#947](https://github.com/redhat-developer/yaml-language-server/pull/947) +- Fix: snippets in additionalProperties [#951](https://github.com/redhat-developer/yaml-language-server/pull/951) +- Fix: crash when url is undefined [#954](https://github.com/redhat-developer/yaml-language-server/pull/954) +- Fix: Add null check for customTags [#955](https://github.com/redhat-developer/yaml-language-server/pull/955) + +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. + ### 1.14.0 - Fix: Request textDocument/hover failed with message: Invalid regular expression: /(?s).*/: Invalid group [#874](https://github.com/redhat-developer/yaml-language-server/issues/874) - Fix: nested anyof const [#888](https://github.com/redhat-developer/yaml-language-server/pull/888) diff --git a/package.json b/package.json index 62be0e23..a367cafd 100644 --- a/package.json +++ b/package.json @@ -29,15 +29,13 @@ "type": "git", "url": "https://github.com/redhat-developer/yaml-language-server.git" }, - "optionalDependencies": { - "prettier": "2.8.7" - }, "dependencies": { "ajv": "^8.11.0", "lodash": "4.17.21", + "prettier": "^3.0.0", "request-light": "^0.5.7", "vscode-json-languageservice": "4.1.8", - "vscode-languageserver": "^7.0.0", + "vscode-languageserver": "^9.0.0", "vscode-languageserver-textdocument": "^1.0.1", "vscode-languageserver-types": "^3.16.0", "vscode-nls": "^5.0.0", @@ -49,7 +47,6 @@ "@types/chai": "^4.2.12", "@types/mocha": "8.2.2", "@types/node": "16.x", - "@types/prettier": "2.7.2", "@types/sinon": "^9.0.5", "@types/sinon-chai": "^3.2.5", "@typescript-eslint/eslint-plugin": "^5.38.0", @@ -57,9 +54,9 @@ "chai": "^4.2.0", "coveralls": "3.1.1", "eslint": "^8.24.0", - "eslint-config-prettier": "^8.5.0", + "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.0.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "mocha": "9.2.2", diff --git a/src/languageserver/handlers/languageHandlers.ts b/src/languageserver/handlers/languageHandlers.ts index df7005b9..7f971167 100644 --- a/src/languageserver/handlers/languageHandlers.ts +++ b/src/languageserver/handlers/languageHandlers.ts @@ -114,7 +114,7 @@ export class LanguageHandlers { * Called when the formatter is invoked * Returns the formatted document content using prettier */ - formatterHandler(formatParams: DocumentFormattingParams): TextEdit[] { + formatterHandler(formatParams: DocumentFormattingParams): Promise { const document = this.yamlSettings.documents.get(formatParams.textDocument.uri); if (!document) { diff --git a/src/languageserver/handlers/requestHandlers.ts b/src/languageserver/handlers/requestHandlers.ts index 120dcb12..50d21f00 100644 --- a/src/languageserver/handlers/requestHandlers.ts +++ b/src/languageserver/handlers/requestHandlers.ts @@ -14,7 +14,10 @@ import { SchemaModificationNotification } from '../../requestTypes'; export class RequestHandlers { private languageService: LanguageService; - constructor(private readonly connection: Connection, languageService: LanguageService) { + constructor( + private readonly connection: Connection, + languageService: LanguageService + ) { this.languageService = languageService; } diff --git a/src/languageserver/handlers/settingsHandlers.ts b/src/languageserver/handlers/settingsHandlers.ts index cc9e482d..18327333 100644 --- a/src/languageserver/handlers/settingsHandlers.ts +++ b/src/languageserver/handlers/settingsHandlers.ts @@ -82,7 +82,7 @@ export class SettingsHandler { if (settings.yaml.schemaStore) { this.yamlSettings.schemaStoreEnabled = settings.yaml.schemaStore.enable; - if (settings.yaml.schemaStore.url.length !== 0) { + if (settings.yaml.schemaStore.url?.length !== 0) { this.yamlSettings.schemaStoreUrl = settings.yaml.schemaStore.url; } } @@ -181,7 +181,7 @@ export class SettingsHandler { private async setSchemaStoreSettingsIfNotSet(): Promise { const schemaStoreIsSet = this.yamlSettings.schemaStoreSettings.length !== 0; let schemaStoreUrl = ''; - if (this.yamlSettings.schemaStoreUrl.length !== 0) { + if (this.yamlSettings.schemaStoreUrl?.length !== 0) { schemaStoreUrl = this.yamlSettings.schemaStoreUrl; } else { schemaStoreUrl = JSON_SCHEMASTORE_URL; diff --git a/src/languageserver/handlers/validationHandlers.ts b/src/languageserver/handlers/validationHandlers.ts index b0dd75f5..e0db58d7 100644 --- a/src/languageserver/handlers/validationHandlers.ts +++ b/src/languageserver/handlers/validationHandlers.ts @@ -14,7 +14,11 @@ export class ValidationHandler { private languageService: LanguageService; private yamlSettings: SettingsState; - constructor(private readonly connection: Connection, languageService: LanguageService, yamlSettings: SettingsState) { + constructor( + private readonly connection: Connection, + languageService: LanguageService, + yamlSettings: SettingsState + ) { this.languageService = languageService; this.yamlSettings = yamlSettings; diff --git a/src/languageserver/handlers/workspaceHandlers.ts b/src/languageserver/handlers/workspaceHandlers.ts index 448933ff..05b808b4 100644 --- a/src/languageserver/handlers/workspaceHandlers.ts +++ b/src/languageserver/handlers/workspaceHandlers.ts @@ -7,7 +7,10 @@ import { ExecuteCommandParams, Connection } from 'vscode-languageserver'; import { CommandExecutor } from '../commandExecutor'; export class WorkspaceHandlers { - constructor(private readonly connection: Connection, private readonly commandExecutor: CommandExecutor) {} + constructor( + private readonly connection: Connection, + private readonly commandExecutor: CommandExecutor + ) {} registerHandlers(): void { this.connection.onExecuteCommand((params) => this.executeCommand(params)); diff --git a/src/languageservice/parser/jsonParser07.ts b/src/languageservice/parser/jsonParser07.ts index b4fdfe4b..537a9beb 100644 --- a/src/languageservice/parser/jsonParser07.ts +++ b/src/languageservice/parser/jsonParser07.ts @@ -286,7 +286,10 @@ export interface ISchemaCollector { class SchemaCollector implements ISchemaCollector { schemas: IApplicableSchema[] = []; - constructor(private focusOffset = -1, private exclude: ASTNode = null) {} + constructor( + private focusOffset = -1, + private exclude: ASTNode = null + ) {} add(schema: IApplicableSchema): void { this.schemas.push(schema); } @@ -888,6 +891,7 @@ function validate( ), source: getSchemaSource(schema, originalSchema), schemaUri: getSchemaUri(schema, originalSchema), + data: { values: schema.enum }, }); } } @@ -907,6 +911,7 @@ function validate( source: getSchemaSource(schema, originalSchema), schemaUri: getSchemaUri(schema, originalSchema), problemArgs: [JSON.stringify(schema.const)], + data: { values: [schema.const] }, }); validationResult.enumValueMatch = false; } else { @@ -1385,6 +1390,7 @@ function validate( length: propertyNode.keyNode.length, }, severity: DiagnosticSeverity.Warning, + code: ErrorCode.PropertyExpected, message: schema.errorMessage || localize('DisallowedExtraPropWarning', MSG_PROPERTY_NOT_ALLOWED, propertyName), source: getSchemaSource(schema, originalSchema), schemaUri: getSchemaUri(schema, originalSchema), diff --git a/src/languageservice/services/documentSymbols.ts b/src/languageservice/services/documentSymbols.ts index 42520736..e50c992c 100644 --- a/src/languageservice/services/documentSymbols.ts +++ b/src/languageservice/services/documentSymbols.ts @@ -17,7 +17,10 @@ import { convertErrorToTelemetryMsg } from '../utils/objects'; export class YAMLDocumentSymbols { private jsonDocumentSymbols; - constructor(schemaService: YAMLSchemaService, private readonly telemetry?: Telemetry) { + constructor( + schemaService: YAMLSchemaService, + private readonly telemetry?: Telemetry + ) { this.jsonDocumentSymbols = new JSONDocumentSymbols(schemaService); // override 'getKeyLabel' to handle complex mapping diff --git a/src/languageservice/services/yamlCodeActions.ts b/src/languageservice/services/yamlCodeActions.ts index c0ef20b5..da0c7eea 100644 --- a/src/languageservice/services/yamlCodeActions.ts +++ b/src/languageservice/services/yamlCodeActions.ts @@ -28,9 +28,12 @@ import { FlowStyleRewriter } from '../utils/flow-style-rewriter'; import { ASTNode } from '../jsonASTTypes'; import * as _ from 'lodash'; import { SourceToken } from 'yaml/dist/parse/cst'; +import { ErrorCode } from 'vscode-json-languageservice'; interface YamlDiagnosticData { schemaUri: string[]; + values?: string[]; + properties?: string[]; } export class YamlCodeActions { private indentation = ' '; @@ -54,6 +57,7 @@ export class YamlCodeActions { result.push(...this.getUnusedAnchorsDelete(params.context.diagnostics, document)); result.push(...this.getConvertToBlockStyleActions(params.context.diagnostics, document)); result.push(...this.getKeyOrderActions(params.context.diagnostics, document)); + result.push(...this.getQuickFixForPropertyOrValueMismatch(params.context.diagnostics, document)); return result; } @@ -221,7 +225,7 @@ export class YamlCodeActions { const results: CodeAction[] = []; for (const diagnostic of diagnostics) { if (diagnostic.code === 'flowMap' || diagnostic.code === 'flowSeq') { - const node = getNodeforDiagnostic(document, diagnostic); + const node = getNodeForDiagnostic(document, diagnostic); if (isMap(node.internalNode) || isSeq(node.internalNode)) { const blockTypeDescription = isMap(node.internalNode) ? 'map' : 'sequence'; const rewriter = new FlowStyleRewriter(this.indentation); @@ -242,7 +246,7 @@ export class YamlCodeActions { const results: CodeAction[] = []; for (const diagnostic of diagnostics) { if (diagnostic?.code === 'mapKeyOrder') { - let node = getNodeforDiagnostic(document, diagnostic); + let node = getNodeForDiagnostic(document, diagnostic); while (node && node.type !== 'object') { node = node.parent; } @@ -292,8 +296,8 @@ export class YamlCodeActions { item.value.end.splice(newLineIndex, 1); } } else if (item.value?.type === 'block-scalar') { - const nwline = item.value.props.find((p) => p.type === 'newline'); - if (!nwline) { + const newline = item.value.props.find((p) => p.type === 'newline'); + if (!newline) { item.value.props.push({ type: 'newline', indent: 0, offset: item.value.offset, source: '\n' } as SourceToken); } } @@ -312,9 +316,52 @@ export class YamlCodeActions { } return results; } + + /** + * Check if diagnostic contains info for quick fix + * Supports Enum/Const/Property mismatch + */ + private getPossibleQuickFixValues(diagnostic: Diagnostic): string[] | undefined { + if (typeof diagnostic.data !== 'object') { + return; + } + if ( + diagnostic.code === ErrorCode.EnumValueMismatch && + 'values' in diagnostic.data && + Array.isArray((diagnostic.data as YamlDiagnosticData).values) + ) { + return (diagnostic.data as YamlDiagnosticData).values; + } else if ( + diagnostic.code === ErrorCode.PropertyExpected && + 'properties' in diagnostic.data && + Array.isArray((diagnostic.data as YamlDiagnosticData).properties) + ) { + return (diagnostic.data as YamlDiagnosticData).properties; + } + } + + private getQuickFixForPropertyOrValueMismatch(diagnostics: Diagnostic[], document: TextDocument): CodeAction[] { + const results: CodeAction[] = []; + for (const diagnostic of diagnostics) { + const values = this.getPossibleQuickFixValues(diagnostic); + if (!values?.length) { + continue; + } + for (const value of values) { + results.push( + CodeAction.create( + value, + createWorkspaceEdit(document.uri, [TextEdit.replace(diagnostic.range, value)]), + CodeActionKind.QuickFix + ) + ); + } + } + return results; + } } -function getNodeforDiagnostic(document: TextDocument, diagnostic: Diagnostic): ASTNode { +function getNodeForDiagnostic(document: TextDocument, diagnostic: Diagnostic): ASTNode { const yamlDocuments = yamlDocumentsCache.getYamlDocument(document); const startOffset = document.offsetAt(diagnostic.range.start); const yamlDoc = matchOffsetToDocument(startOffset, yamlDocuments); diff --git a/src/languageservice/services/yamlCodeLens.ts b/src/languageservice/services/yamlCodeLens.ts index b1ae69d3..fdfde4fa 100644 --- a/src/languageservice/services/yamlCodeLens.ts +++ b/src/languageservice/services/yamlCodeLens.ts @@ -15,7 +15,10 @@ import { convertErrorToTelemetryMsg } from '../utils/objects'; import { getSchemaTitle } from '../utils/schemaUtils'; export class YamlCodeLens { - constructor(private schemaService: YAMLSchemaService, private readonly telemetry?: Telemetry) {} + constructor( + private schemaService: YAMLSchemaService, + private readonly telemetry?: Telemetry + ) {} async getCodeLens(document: TextDocument): Promise { const result = []; diff --git a/src/languageservice/services/yamlCompletion.ts b/src/languageservice/services/yamlCompletion.ts index be21a8bb..513a23d6 100644 --- a/src/languageservice/services/yamlCompletion.ts +++ b/src/languageservice/services/yamlCompletion.ts @@ -293,7 +293,7 @@ export class YamlCompletion { proposed, }; - if (this.customTags.length > 0) { + if (this.customTags && this.customTags.length > 0) { this.getCustomTagValueCompletions(collector); } diff --git a/src/languageservice/services/yamlFormatter.ts b/src/languageservice/services/yamlFormatter.ts index fff67444..2d9bcaf6 100644 --- a/src/languageservice/services/yamlFormatter.ts +++ b/src/languageservice/services/yamlFormatter.ts @@ -6,9 +6,8 @@ import { Range, Position, TextEdit, FormattingOptions } from 'vscode-languageserver-types'; import { CustomFormatterOptions, LanguageSettings } from '../yamlLanguageService'; -import * as prettier from 'prettier'; -import { Options } from 'prettier'; -import * as parser from 'prettier/parser-yaml'; +import { format, Options } from 'prettier'; +import * as parser from 'prettier/plugins/yaml'; import { TextDocument } from 'vscode-languageserver-textdocument'; export class YAMLFormatter { @@ -20,7 +19,10 @@ export class YAMLFormatter { } } - public format(document: TextDocument, options: Partial & CustomFormatterOptions = {}): TextEdit[] { + public async format( + document: TextDocument, + options: Partial & CustomFormatterOptions = {} + ): Promise { if (!this.formatterEnabled) { return []; } @@ -43,7 +45,7 @@ export class YAMLFormatter { printWidth: options.printWidth, }; - const formatted = prettier.format(text, prettierOptions); + const formatted = await format(text, prettierOptions); return [TextEdit.replace(Range.create(Position.create(0, 0), document.positionAt(text.length)), formatted)]; } catch (error) { diff --git a/src/languageservice/services/yamlHover.ts b/src/languageservice/services/yamlHover.ts index a0e72ce3..f02c29d1 100644 --- a/src/languageservice/services/yamlHover.ts +++ b/src/languageservice/services/yamlHover.ts @@ -26,7 +26,10 @@ export class YAMLHover { private indentation: string; private schemaService: YAMLSchemaService; - constructor(schemaService: YAMLSchemaService, private readonly telemetry?: Telemetry) { + constructor( + schemaService: YAMLSchemaService, + private readonly telemetry?: Telemetry + ) { this.shouldHover = true; this.schemaService = schemaService; } diff --git a/src/languageservice/services/yamlValidation.ts b/src/languageservice/services/yamlValidation.ts index fd26af2e..04c58edf 100644 --- a/src/languageservice/services/yamlValidation.ts +++ b/src/languageservice/services/yamlValidation.ts @@ -48,7 +48,10 @@ export class YAMLValidation { private MATCHES_MULTIPLE = 'Matches multiple schemas when only one must validate.'; - constructor(schemaService: YAMLSchemaService, private readonly telemetry?: Telemetry) { + constructor( + schemaService: YAMLSchemaService, + private readonly telemetry?: Telemetry + ) { this.validationEnabled = true; this.jsonValidation = new JSONValidation(schemaService, Promise); } diff --git a/src/languageservice/utils/schemaUtils.ts b/src/languageservice/utils/schemaUtils.ts index d36166ed..bc763fb4 100644 --- a/src/languageservice/utils/schemaUtils.ts +++ b/src/languageservice/utils/schemaUtils.ts @@ -16,8 +16,8 @@ export function getSchemaTypeName(schema: JSONSchema): string { return Array.isArray(schema.type) ? schema.type.join(' | ') : closestTitleWithType - ? schema.type.concat('(', schema.closestTitle, ')') - : schema.type || schema.closestTitle; //object + ? schema.type.concat('(', schema.closestTitle, ')') + : schema.type || schema.closestTitle; //object } /** diff --git a/src/languageservice/yamlLanguageService.ts b/src/languageservice/yamlLanguageService.ts index 11cf9317..2c03d835 100644 --- a/src/languageservice/yamlLanguageService.ts +++ b/src/languageservice/yamlLanguageService.ts @@ -166,7 +166,7 @@ export interface LanguageService { findDocumentSymbols2: (document: TextDocument, context?: DocumentSymbolsContext) => DocumentSymbol[]; findLinks: (document: TextDocument) => Promise; resetSchema: (uri: string) => boolean; - doFormat: (document: TextDocument, options?: CustomFormatterOptions) => TextEdit[]; + doFormat: (document: TextDocument, options?: CustomFormatterOptions) => Promise; doDefinition: (document: TextDocument, params: DefinitionParams) => DefinitionLink[] | undefined; doDocumentOnTypeFormatting: (document: TextDocument, params: DocumentOnTypeFormattingParams) => TextEdit[] | undefined; addSchema: (schemaID: string, schema: JSONSchema) => void; diff --git a/test/autoCompletion.test.ts b/test/autoCompletion.test.ts index dd5abe0c..eba8fa6d 100644 --- a/test/autoCompletion.test.ts +++ b/test/autoCompletion.test.ts @@ -3126,5 +3126,10 @@ describe('Auto Completion Tests', () => { expect(result.items.map((i) => i.label)).to.have.members(['fruit', 'vegetable']); }); }); + it('Should function when settings are undefined', async () => { + languageService.configure({ completion: true }); + const content = ''; + await parseSetup(content, 0); + }); }); }); diff --git a/test/formatter.test.ts b/test/formatter.test.ts index ed970a00..5ab02ae4 100644 --- a/test/formatter.test.ts +++ b/test/formatter.test.ts @@ -24,7 +24,7 @@ describe('Formatter Tests', () => { describe('Formatter', function () { describe('Test that formatter works with custom tags', function () { // eslint-disable-next-line @typescript-eslint/no-explicit-any - function parseSetup(content: string, options: any = {}): TextEdit[] { + function parseSetup(content: string, options: any = {}): Promise { const testTextDocument = setupTextDocument(content); yamlSettings.documents = new TextDocumentTestManager(); (yamlSettings.documents as TextDocumentTestManager).set(testTextDocument); @@ -35,31 +35,32 @@ describe('Formatter Tests', () => { }); } - it('Formatting works without custom tags', () => { + it('Formatting works without custom tags', async () => { const content = 'cwd: test'; - const edits = parseSetup(content); + const edits = await parseSetup(content); + console.dir({ edits }); assert.notEqual(edits.length, 0); assert.equal(edits[0].newText, 'cwd: test\n'); }); - it('Formatting works with custom tags', () => { + it('Formatting works with custom tags', async () => { const content = 'cwd: !Test test'; - const edits = parseSetup(content); + const edits = await parseSetup(content); assert.notEqual(edits.length, 0); assert.equal(edits[0].newText, 'cwd: !Test test\n'); }); - it('Formatting wraps text', () => { + it('Formatting wraps text', async () => { const content = `comments: > test test test test test test test test test test test test`; - const edits = parseSetup(content, { + const edits = await parseSetup(content, { printWidth: 20, proseWrap: 'always', }); assert.equal(edits[0].newText, 'comments: >\n test test test\n test test test\n test test test\n test test test\n'); }); - it('Formatting uses tabSize', () => { + it('Formatting uses tabSize', async () => { const content = `map: k1: v1 k2: v2 @@ -68,7 +69,7 @@ list: - item2 `; - const edits = parseSetup(content, { + const edits = await parseSetup(content, { tabSize: 5, }); @@ -82,7 +83,7 @@ list: assert.equal(edits[0].newText, expected); }); - it('Formatting uses tabWidth', () => { + it('Formatting uses tabWidth', async () => { const content = `map: k1: v1 k2: v2 @@ -91,7 +92,7 @@ list: - item2 `; - const edits = parseSetup(content, { + const edits = await parseSetup(content, { tabWidth: 5, }); @@ -105,7 +106,7 @@ list: assert.equal(edits[0].newText, expected); }); - it('Formatting uses tabWidth over tabSize', () => { + it('Formatting uses tabWidth over tabSize', async () => { const content = `map: k1: v1 k2: v2 @@ -114,7 +115,7 @@ list: - item2 `; - const edits = parseSetup(content, { + const edits = await parseSetup(content, { tabSize: 3, tabWidth: 5, }); diff --git a/test/schemaValidation.test.ts b/test/schemaValidation.test.ts index 71268db7..829310c1 100644 --- a/test/schemaValidation.test.ts +++ b/test/schemaValidation.test.ts @@ -26,6 +26,7 @@ import { KUBERNETES_SCHEMA_URL } from '../src/languageservice/utils/schemaUrls'; import { IProblem } from '../src/languageservice/parser/jsonParser07'; import { JSONSchema } from '../src/languageservice/jsonSchema'; import { TestTelemetry } from './utils/testsTypes'; +import { ErrorCode } from 'vscode-json-languageservice'; describe('Validation Tests', () => { let languageSettingsSetup: ServiceSetup; @@ -396,7 +397,8 @@ describe('Validation Tests', () => { 4, DiagnosticSeverity.Error, `yaml-schema: file:///${SCHEMA_ID}`, - `file:///${SCHEMA_ID}` + `file:///${SCHEMA_ID}`, + ErrorCode.PropertyExpected ) ); }) @@ -1289,7 +1291,7 @@ obj: 4, 18, DiagnosticSeverity.Error, - 'yaml-schema: Package', + 'yaml-schema: Composer Package', 'https://raw.githubusercontent.com/composer/composer/master/res/composer-schema.json' ) ); @@ -1312,6 +1314,7 @@ obj: DiagnosticSeverity.Error, 'yaml-schema: Drone CI configuration file', 'https://json.schemastore.org/drone', + ErrorCode.PropertyExpected, { properties: [ 'type', diff --git a/test/utils/testsTypes.ts b/test/utils/testsTypes.ts index 6dbd78bd..96761a10 100644 --- a/test/utils/testsTypes.ts +++ b/test/utils/testsTypes.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event, NotificationHandler, RequestHandler } from 'vscode-jsonrpc'; +import { Disposable, Event, NotificationHandler, RequestHandler } from 'vscode-jsonrpc'; import { ApplyWorkspaceEditParams, WorkspaceEdit, @@ -14,6 +14,8 @@ import { CreateFilesParams, RenameFilesParams, DeleteFilesParams, + ClientCapabilities, + ServerCapabilities, } from 'vscode-languageserver-protocol'; import { Connection, RemoteWorkspace } from 'vscode-languageserver'; import { TelemetryImpl } from '../../src/languageserver/telemetry'; @@ -27,6 +29,9 @@ export class TestWorkspace implements RemoteWorkspace { applyEdit(paramOrEdit: ApplyWorkspaceEditParams | WorkspaceEdit): Promise { throw new Error('Method not implemented.'); } + fillServerCapabilities(capabilities: ServerCapabilities): void { + throw new Error('Method not implemented.'); + } getConfiguration(): Promise; getConfiguration(section: string): Promise; getConfiguration(item: ConfigurationItem): Promise; @@ -37,23 +42,26 @@ export class TestWorkspace implements RemoteWorkspace { getWorkspaceFolders(): Promise { throw new Error('Method not implemented.'); } + initialize(capabilities: ClientCapabilities): void { + throw new Error('Method not implemented.'); + } onDidChangeWorkspaceFolders: Event; - onDidCreateFiles(handler: NotificationHandler): void { + onDidCreateFiles(handler: NotificationHandler): Disposable { throw new Error('Method not implemented.'); } - onDidRenameFiles(handler: NotificationHandler): void { + onDidRenameFiles(handler: NotificationHandler): Disposable { throw new Error('Method not implemented.'); } - onDidDeleteFiles(handler: NotificationHandler): void { + onDidDeleteFiles(handler: NotificationHandler): Disposable { throw new Error('Method not implemented.'); } - onWillCreateFiles(handler: RequestHandler): void { + onWillCreateFiles(handler: RequestHandler): Disposable { throw new Error('Method not implemented.'); } - onWillRenameFiles(handler: RequestHandler): void { + onWillRenameFiles(handler: RequestHandler): Disposable { throw new Error('Method not implemented.'); } - onWillDeleteFiles(handler: RequestHandler): void { + onWillDeleteFiles(handler: RequestHandler): Disposable { throw new Error('Method not implemented.'); } } diff --git a/test/utils/verifyError.ts b/test/utils/verifyError.ts index ea7f17c5..d2769c74 100644 --- a/test/utils/verifyError.ts +++ b/test/utils/verifyError.ts @@ -39,9 +39,19 @@ export function createDiagnosticWithData( severity: DiagnosticSeverity = 1, source = 'YAML', schemaUri: string | string[], + code: string | number = ErrorCode.Undefined, data: Record = {} ): Diagnostic { - const diagnostic: Diagnostic = createExpectedError(message, startLine, startCharacter, endLine, endCharacter, severity, source); + const diagnostic: Diagnostic = createExpectedError( + message, + startLine, + startCharacter, + endLine, + endCharacter, + severity, + source, + code + ); diagnostic.data = { schemaUri: typeof schemaUri === 'string' ? [schemaUri] : schemaUri, ...data }; return diagnostic; } diff --git a/test/yamlCodeActions.test.ts b/test/yamlCodeActions.test.ts index aa2b72ce..447cfdcb 100644 --- a/test/yamlCodeActions.test.ts +++ b/test/yamlCodeActions.test.ts @@ -22,6 +22,7 @@ import { setupTextDocument, TEST_URI } from './utils/testHelper'; import { createDiagnosticWithData, createExpectedError, createUnusedAnchorDiagnostic } from './utils/verifyError'; import { YamlCommands } from '../src/commands'; import { LanguageSettings } from '../src'; +import { ErrorCode } from 'vscode-json-languageservice'; const expect = chai.expect; chai.use(sinonChai); @@ -377,4 +378,58 @@ animals: [dog , cat , mouse] `; ]); }); }); + + describe('Enum value or property mismatch quick fix', () => { + it('should generate proper action for enum mismatch', () => { + const doc = setupTextDocument('foo: value1'); + const diagnostic = createDiagnosticWithData( + 'message', + 0, + 5, + 0, + 11, + DiagnosticSeverity.Hint, + 'YAML', + 'schemaUri', + ErrorCode.EnumValueMismatch, + { values: ['valueX', 'valueY'] } + ); + const params: CodeActionParams = { + context: CodeActionContext.create([diagnostic]), + range: undefined, + textDocument: TextDocumentIdentifier.create(TEST_URI), + }; + const actions = new YamlCodeActions(clientCapabilities); + const result = actions.getCodeAction(doc, params); + expect(result.map((r) => r.title)).deep.equal(['valueX', 'valueY']); + expect(result[0].edit.changes[TEST_URI]).deep.equal([TextEdit.replace(Range.create(0, 5, 0, 11), 'valueX')]); + }); + + it('should generate proper action for wrong property', () => { + const doc = setupTextDocument('foo: value1'); + const diagnostic = createDiagnosticWithData( + 'message', + 0, + 0, + 0, + 3, + DiagnosticSeverity.Hint, + 'YAML', + 'schemaUri', + ErrorCode.PropertyExpected, + { + properties: ['fooX', 'fooY'], + } + ); + const params: CodeActionParams = { + context: CodeActionContext.create([diagnostic]), + range: undefined, + textDocument: TextDocumentIdentifier.create(TEST_URI), + }; + const actions = new YamlCodeActions(clientCapabilities); + const result = actions.getCodeAction(doc, params); + expect(result.map((r) => r.title)).deep.equal(['fooX', 'fooY']); + expect(result[0].edit.changes[TEST_URI]).deep.equal([TextEdit.replace(Range.create(0, 0, 0, 3), 'fooX')]); + }); + }); }); diff --git a/yarn.lock b/yarn.lock index fd794ffd..2bda7a67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,6 +17,14 @@ dependencies: "@babel/highlight" "^7.16.7" +"@babel/code-frame@^7.22.13": + version "7.22.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" + integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== + dependencies: + "@babel/highlight" "^7.22.13" + chalk "^2.4.2" + "@babel/compat-data@^7.17.10": version "7.17.10" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.10.tgz" @@ -52,6 +60,16 @@ "@jridgewell/gen-mapping" "^0.3.0" jsesc "^2.5.1" +"@babel/generator@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" + integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== + dependencies: + "@babel/types" "^7.23.0" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + "@babel/helper-compilation-targets@^7.17.10": version "7.17.10" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz" @@ -69,20 +87,25 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-function-name@^7.17.9": - version "7.17.9" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== + +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: - "@babel/types" "^7.16.7" + "@babel/types" "^7.22.5" "@babel/helper-module-imports@^7.16.7": version "7.16.7" @@ -119,11 +142,28 @@ dependencies: "@babel/types" "^7.16.7" +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + "@babel/helper-validator-identifier@^7.16.7": version "7.16.7" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz" integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + "@babel/helper-validator-option@^7.16.7": version "7.16.7" resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz" @@ -147,11 +187,25 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.22.13": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + "@babel/parser@^7.16.7", "@babel/parser@^7.17.12": version "7.17.12" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.17.12.tgz" integrity sha512-FLzHmN9V3AJIrWfOpvRlZCeVg/WLdicSnTMsLur6uDj9TT8ymUlG9XxURdW/XvuygK+2CW0poOJABdA4m/YKxA== +"@babel/parser@^7.22.15", "@babel/parser@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" + integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== + "@babel/template@^7.16.7": version "7.16.7" resolved "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz" @@ -161,19 +215,28 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.17.12", "@babel/traverse@^7.17.9": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.12.tgz" - integrity sha512-zULPs+TbCvOkIFd4FrG53xrpxvCBwLIgo6tO0tJorY7YV2IWFxUfS/lXDJbGgfyYt9ery/Gxj2niwttNnB0gIw== +"@babel/template@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.12" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.12" - "@babel/types" "^7.17.12" + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/traverse@^7.17.12", "@babel/traverse@^7.17.9": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8" + integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.0" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.0" + "@babel/types" "^7.23.0" debug "^4.1.0" globals "^11.1.0" @@ -185,6 +248,15 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" +"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" resolved "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz" @@ -293,21 +365,53 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/resolve-uri@^3.0.3": version "3.0.7" resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz" integrity sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + "@jridgewell/set-array@^1.0.0": version "1.1.1" resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz" integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.13" resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz" integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== +"@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.17": + version "0.3.19" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" + integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jridgewell/trace-mapping@^0.3.9": version "0.3.13" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz" @@ -347,6 +451,11 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@pkgr/core@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31" + integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA== + "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": version "1.8.3" resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz" @@ -425,11 +534,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.60.tgz#a1fbca80c18dd80c8783557304cdb7d55ac3aff5" integrity sha512-kYIYa1D1L+HDv5M5RXQeEu1o0FKA6yedZIoyugm/MBPROkLpX4L7HRxMrPVyo8bnvjpW/wDlqFNGzXNMb7AdRw== -"@types/prettier@2.7.2": - version "2.7.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" - integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== - "@types/sinon-chai@^3.2.5": version "3.2.5" resolved "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.5.tgz" @@ -824,7 +928,7 @@ chai@^4.2.0: pathval "^1.1.1" type-detect "^4.0.5" -chalk@^2.0.0: +chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1153,10 +1257,10 @@ escape-string-regexp@^1.0.5: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -eslint-config-prettier@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" - integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== +eslint-config-prettier@^9.0.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f" + integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== eslint-import-resolver-node@^0.3.6: version "0.3.6" @@ -1193,12 +1297,13 @@ eslint-plugin-import@^2.26.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" -eslint-plugin-prettier@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" - integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== +eslint-plugin-prettier@^5.0.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz#17cfade9e732cef32b5f5be53bd4e07afd8e67e1" + integrity sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw== dependencies: prettier-linter-helpers "^1.0.0" + synckit "^0.8.6" eslint-scope@^5.1.1: version "5.1.1" @@ -1551,9 +1656,9 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" @@ -2570,10 +2675,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.8.7: - version "2.8.7" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" - integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== +prettier@^3.0.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.1.tgz#e68935518dd90bb7ec4821ba970e68f8de16e1ac" + integrity sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg== process-on-spawn@^1.0.0: version "1.0.0" @@ -2783,7 +2888,7 @@ side-channel@^1.0.4: signal-exit@^3.0.2: version "3.0.7" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== sinon-chai@^3.5.0: @@ -2928,6 +3033,14 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +synckit@^0.8.6: + version "0.8.8" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.8.tgz#fe7fe446518e3d3d49f5e429f443cf08b6edfcd7" + integrity sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ== + dependencies: + "@pkgr/core" "^0.1.0" + tslib "^2.6.2" + test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" @@ -2996,6 +3109,11 @@ tslib@^1.8.1: resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -3101,45 +3219,45 @@ vscode-json-languageservice@4.1.8: vscode-nls "^5.0.0" vscode-uri "^3.0.2" -vscode-jsonrpc@6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz" - integrity sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg== +vscode-jsonrpc@8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz#f43dfa35fb51e763d17cd94dcca0c9458f35abf9" + integrity sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA== -vscode-languageserver-protocol@3.16.0: - version "3.16.0" - resolved "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz" - integrity sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A== +vscode-languageserver-protocol@3.17.5: + version "3.17.5" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz#864a8b8f390835572f4e13bd9f8313d0e3ac4bea" + integrity sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg== dependencies: - vscode-jsonrpc "6.0.0" - vscode-languageserver-types "3.16.0" + vscode-jsonrpc "8.2.0" + vscode-languageserver-types "3.17.5" vscode-languageserver-textdocument@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.1.tgz" - integrity sha512-UIcJDjX7IFkck7cSkNNyzIz5FyvpQfY7sdzVy+wkKN/BLaD4DQ0ppXQrKePomCxTS7RrolK1I0pey0bG9eh8dA== + version "1.0.11" + resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" + integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== -vscode-languageserver-types@3.16.0, vscode-languageserver-types@^3.16.0: - version "3.16.0" - resolved "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz" - integrity sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA== +vscode-languageserver-types@3.17.5, vscode-languageserver-types@^3.16.0: + version "3.17.5" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz#3273676f0cf2eab40b3f44d085acbb7f08a39d8a" + integrity sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg== -vscode-languageserver@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz" - integrity sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw== +vscode-languageserver@^9.0.0: + version "9.0.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz#500aef82097eb94df90d008678b0b6b5f474015b" + integrity sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g== dependencies: - vscode-languageserver-protocol "3.16.0" + vscode-languageserver-protocol "3.17.5" vscode-nls@^5.0.0: - version "5.0.1" - resolved "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.1.tgz" - integrity sha512-hHQV6iig+M21lTdItKPkJAaWrxALQb/nqpVffakO4knJOh3DrU2SXOMzUzNgo1eADPzu3qSsJY1weCzvR52q9A== + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== vscode-uri@^3.0.2: - version "3.0.3" - resolved "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz" - integrity sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA== + version "3.0.8" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" + integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== which-boxed-primitive@^1.0.2: version "1.0.2"