diff --git a/src/index.ts b/src/index.ts index d4c8a04dc..3541b3786 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export * from './languageservice/yamlLanguageService'; +export * from './languageservice/yamlLanguageService.ts'; export { getLanguageService as getJSONLanguageService } from 'vscode-json-languageservice'; export * from 'vscode-languageserver-types'; diff --git a/src/languageserver/handlers/languageHandlers.ts b/src/languageserver/handlers/languageHandlers.ts index 3a32dfa5c..65ea7ec6c 100644 --- a/src/languageserver/handlers/languageHandlers.ts +++ b/src/languageserver/handlers/languageHandlers.ts @@ -34,11 +34,11 @@ import { TextEdit, WorkspaceEdit, } from 'vscode-languageserver-types'; -import { isKubernetesAssociatedDocument } from '../../languageservice/parser/isKubernetes'; -import { LanguageService } from '../../languageservice/yamlLanguageService'; -import { SettingsState } from '../../yamlSettings'; -import { ValidationHandler } from './validationHandlers'; -import { ResultLimitReachedNotification } from '../../requestTypes'; +import { isKubernetesAssociatedDocument } from '../../languageservice/parser/isKubernetes.ts'; +import { LanguageService } from '../../languageservice/yamlLanguageService.ts'; +import { SettingsState } from '../../yamlSettings.ts'; +import { ValidationHandler } from './validationHandlers.ts'; +import { ResultLimitReachedNotification } from '../../requestTypes.ts'; import * as path from 'path'; import { TextDocument } from 'vscode-languageserver-textdocument'; diff --git a/src/languageserver/handlers/notificationHandlers.ts b/src/languageserver/handlers/notificationHandlers.ts index a273bdd01..f73f21bd1 100644 --- a/src/languageserver/handlers/notificationHandlers.ts +++ b/src/languageserver/handlers/notificationHandlers.ts @@ -3,17 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Connection } from 'vscode-languageserver'; -import { CustomSchemaProvider } from '../../languageservice/services/yamlSchemaService'; -import { LanguageService, SchemaConfiguration } from '../../languageservice/yamlLanguageService'; +import { CustomSchemaProvider } from '../../languageservice/services/yamlSchemaService.ts'; +import { LanguageService, SchemaConfiguration } from '../../languageservice/yamlLanguageService.ts'; import { CustomSchemaRequest, DynamicCustomSchemaRequestRegistration, SchemaAssociationNotification, SchemaSelectionRequests, VSCodeContentRequestRegistration, -} from '../../requestTypes'; -import { SettingsState } from '../../yamlSettings'; -import { SettingsHandler } from './settingsHandlers'; +} from '../../requestTypes.ts'; +import { SettingsState } from '../../yamlSettings.ts'; +import { SettingsHandler } from './settingsHandlers.ts'; export class NotificationHandlers { private languageService: LanguageService; diff --git a/src/languageserver/handlers/requestHandlers.ts b/src/languageserver/handlers/requestHandlers.ts index 50d21f007..cb9ea909d 100644 --- a/src/languageserver/handlers/requestHandlers.ts +++ b/src/languageserver/handlers/requestHandlers.ts @@ -8,9 +8,9 @@ import { SchemaAdditions, SchemaDeletions, SchemaDeletionsAll, -} from '../../languageservice/services/yamlSchemaService'; -import { LanguageService } from '../../languageservice/yamlLanguageService'; -import { SchemaModificationNotification } from '../../requestTypes'; +} from '../../languageservice/services/yamlSchemaService.ts'; +import { LanguageService } from '../../languageservice/yamlLanguageService.ts'; +import { SchemaModificationNotification } from '../../requestTypes.ts'; export class RequestHandlers { private languageService: LanguageService; diff --git a/src/languageserver/handlers/schemaSelectionHandlers.ts b/src/languageserver/handlers/schemaSelectionHandlers.ts index 6123ef9c6..4326de255 100644 --- a/src/languageserver/handlers/schemaSelectionHandlers.ts +++ b/src/languageserver/handlers/schemaSelectionHandlers.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { Connection } from 'vscode-languageserver/node'; -import { JSONSchema } from '../../languageservice/jsonSchema'; -import { yamlDocumentsCache } from '../../languageservice/parser/yaml-documents'; -import { YAMLSchemaService } from '../../languageservice/services/yamlSchemaService'; -import { SettingsState } from '../../yamlSettings'; -import { JSONSchemaDescription, JSONSchemaDescriptionExt, SchemaSelectionRequests } from '../../requestTypes'; +import { JSONSchema } from '../../languageservice/jsonSchema.ts'; +import { yamlDocumentsCache } from '../../languageservice/parser/yaml-documents.ts'; +import { YAMLSchemaService } from '../../languageservice/services/yamlSchemaService.ts'; +import { SettingsState } from '../../yamlSettings.ts'; +import { JSONSchemaDescription, JSONSchemaDescriptionExt, SchemaSelectionRequests } from '../../requestTypes.ts'; export class JSONSchemaSelection { constructor( diff --git a/src/languageserver/handlers/settingsHandlers.ts b/src/languageserver/handlers/settingsHandlers.ts index 37110e282..7f7da74d7 100644 --- a/src/languageserver/handlers/settingsHandlers.ts +++ b/src/languageserver/handlers/settingsHandlers.ts @@ -5,14 +5,14 @@ import { configure as configureHttpRequests, xhr } from 'request-light'; import { Connection, DidChangeConfigurationNotification, DocumentFormattingRequest } from 'vscode-languageserver'; import { CodeLensRefreshRequest } from 'vscode-languageserver-protocol'; -import { isRelativePath, relativeToAbsolutePath } from '../../languageservice/utils/paths'; -import { checkSchemaURI, EMPTY_SCHEMA_URL, isKubernetes, JSON_SCHEMASTORE_URL } from '../../languageservice/utils/schemaUrls'; -import { equals } from '../../languageservice/utils/objects'; -import { LanguageService, LanguageSettings, SchemaPriority, SchemasSettings } from '../../languageservice/yamlLanguageService'; -import { SchemaSelectionRequests } from '../../requestTypes'; -import { Settings, SettingsState } from '../../yamlSettings'; -import { Telemetry } from '../../languageservice/telemetry'; -import { ValidationHandler } from './validationHandlers'; +import { isRelativePath, relativeToAbsolutePath } from '../../languageservice/utils/paths.ts'; +import { checkSchemaURI, EMPTY_SCHEMA_URL, isKubernetes, JSON_SCHEMASTORE_URL } from '../../languageservice/utils/schemaUrls.ts'; +import { equals } from '../../languageservice/utils/objects.ts'; +import { LanguageService, LanguageSettings, SchemaPriority, SchemasSettings } from '../../languageservice/yamlLanguageService.ts'; +import { SchemaSelectionRequests } from '../../requestTypes.ts'; +import { Settings, SettingsState } from '../../yamlSettings.ts'; +import { Telemetry } from '../../languageservice/telemetry.ts'; +import { ValidationHandler } from './validationHandlers.ts'; export class SettingsHandler { private schemaSettings: SchemasSettings[] | undefined; diff --git a/src/languageserver/handlers/validationHandlers.ts b/src/languageserver/handlers/validationHandlers.ts index d9c1ef285..9b015d3dc 100644 --- a/src/languageserver/handlers/validationHandlers.ts +++ b/src/languageserver/handlers/validationHandlers.ts @@ -5,10 +5,10 @@ import { Connection } from 'vscode-languageserver'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic } from 'vscode-languageserver-types'; -import { isKubernetesAssociatedDocument } from '../../languageservice/parser/isKubernetes'; -import { removeDuplicatesObj } from '../../languageservice/utils/arrUtils'; -import { LanguageService } from '../../languageservice/yamlLanguageService'; -import { SettingsState } from '../../yamlSettings'; +import { isKubernetesAssociatedDocument } from '../../languageservice/parser/isKubernetes.ts'; +import { removeDuplicatesObj } from '../../languageservice/utils/arrUtils.ts'; +import { LanguageService } from '../../languageservice/yamlLanguageService.ts'; +import { SettingsState } from '../../yamlSettings.ts'; export class ValidationHandler { private languageService: LanguageService; diff --git a/src/languageserver/handlers/workspaceHandlers.ts b/src/languageserver/handlers/workspaceHandlers.ts index 05b808b41..1ff1fee31 100644 --- a/src/languageserver/handlers/workspaceHandlers.ts +++ b/src/languageserver/handlers/workspaceHandlers.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { ExecuteCommandParams, Connection } from 'vscode-languageserver'; -import { CommandExecutor } from '../commandExecutor'; +import { CommandExecutor } from '../commandExecutor.ts'; export class WorkspaceHandlers { constructor( diff --git a/src/languageserver/telemetry.ts b/src/languageserver/telemetry.ts index a1db7f2aa..e758aad64 100644 --- a/src/languageserver/telemetry.ts +++ b/src/languageserver/telemetry.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { Connection } from 'vscode-languageserver'; -import { TelemetryEvent, Telemetry } from '../languageservice/telemetry'; -import { convertErrorToTelemetryMsg } from '../languageservice/utils/objects'; +import { TelemetryEvent, Telemetry } from '../languageservice/telemetry.ts'; +import { convertErrorToTelemetryMsg } from '../languageservice/utils/objects.ts'; export class TelemetryImpl implements Telemetry { constructor(private readonly connection: Connection) {} diff --git a/src/languageservice/jsonASTTypes.ts b/src/languageservice/jsonASTTypes.ts index ce1059ce4..a2a7882f0 100644 --- a/src/languageservice/jsonASTTypes.ts +++ b/src/languageservice/jsonASTTypes.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Node, Pair } from 'yaml'; -import type { CustomTagReturnType } from './utils/customTags'; +import type { CustomTagReturnType } from './utils/customTags.ts'; export type YamlNode = Node | Pair; diff --git a/src/languageservice/jsonSchema.ts b/src/languageservice/jsonSchema.ts index ecbe42a4b..ab62f83a1 100644 --- a/src/languageservice/jsonSchema.ts +++ b/src/languageservice/jsonSchema.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { CompletionItemKind } from 'vscode-json-languageservice'; -import { SchemaVersions } from './yamlTypes'; +import { SchemaVersions } from './yamlTypes.ts'; export type JSONSchemaRef = JSONSchema | boolean; export enum SchemaDialect { diff --git a/src/languageservice/parser/ast-converter.ts b/src/languageservice/parser/ast-converter.ts index e3d89f286..32e79b57e 100644 --- a/src/languageservice/parser/ast-converter.ts +++ b/src/languageservice/parser/ast-converter.ts @@ -19,8 +19,8 @@ import { Document, LineCounter, } from 'yaml'; -import { ASTNode, YamlNode } from '../jsonASTTypes'; -import { getCustomTagReturnType } from '../utils/customTags'; +import { ASTNode, YamlNode } from '../jsonASTTypes.ts'; +import { getCustomTagReturnType } from '../utils/customTags.ts'; import { NullASTNodeImpl, PropertyASTNodeImpl, @@ -29,7 +29,7 @@ import { NumberASTNodeImpl, ArrayASTNodeImpl, BooleanASTNodeImpl, -} from './jsonDocument'; +} from './jsonDocument.ts'; type NodeRange = [number, number, number]; diff --git a/src/languageservice/parser/astNodeUtils.ts b/src/languageservice/parser/astNodeUtils.ts index b98f7f484..f0674571c 100644 --- a/src/languageservice/parser/astNodeUtils.ts +++ b/src/languageservice/parser/astNodeUtils.ts @@ -1,4 +1,4 @@ -import type { ASTNode } from '../jsonASTTypes'; +import type { ASTNode } from '../jsonASTTypes.ts'; // eslint-disable-next-line @typescript-eslint/no-explicit-any export function getNodeValue(node: ASTNode): any { diff --git a/src/languageservice/parser/custom-tag-provider.ts b/src/languageservice/parser/custom-tag-provider.ts index 31df7533c..9fa01f5e3 100644 --- a/src/languageservice/parser/custom-tag-provider.ts +++ b/src/languageservice/parser/custom-tag-provider.ts @@ -1,5 +1,5 @@ import { Tags, isSeq, isMap, YAMLMap, YAMLSeq, Scalar } from 'yaml'; -import { CustomTagInputType, CustomTagReturnType, parseCustomTag, setCustomTagReturnType } from '../utils/customTags'; +import { CustomTagInputType, CustomTagReturnType, parseCustomTag, setCustomTagReturnType } from '../utils/customTags.ts'; class CommonTagImpl { tag: string; diff --git a/src/languageservice/parser/isKubernetes.ts b/src/languageservice/parser/isKubernetes.ts index acd8d8dfa..805527d39 100644 --- a/src/languageservice/parser/isKubernetes.ts +++ b/src/languageservice/parser/isKubernetes.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { TextDocument } from 'vscode-languageserver-textdocument'; -import { FilePatternAssociation } from '../utils/filePatternAssociation'; -import * as Parser from './jsonDocument'; +import { FilePatternAssociation } from '../utils/filePatternAssociation.ts'; +import * as Parser from './jsonDocument.ts'; export function setKubernetesParserOption(jsonDocuments: Parser.JSONDocument[], option: boolean): void { for (const jsonDoc of jsonDocuments) { diff --git a/src/languageservice/parser/jsonDocument.ts b/src/languageservice/parser/jsonDocument.ts index 1cef45e62..057f55bc4 100644 --- a/src/languageservice/parser/jsonDocument.ts +++ b/src/languageservice/parser/jsonDocument.ts @@ -3,7 +3,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { JSONSchema } from '../jsonSchema'; +import { JSONSchema } from '../jsonSchema.ts'; import { ASTNode, ObjectASTNode, @@ -14,14 +14,14 @@ import { NullASTNode, PropertyASTNode, YamlNode, -} from '../jsonASTTypes'; -import type { CustomTagReturnType } from '../utils/customTags'; +} from '../jsonASTTypes.ts'; +import type { CustomTagReturnType } from '../utils/customTags.ts'; import { Diagnostic, Range } from 'vscode-languageserver-types'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { Node, Pair } from 'yaml'; -import { type IApplicableSchema } from './schemaValidation/baseValidator'; -import { findNodeAtOffset } from './astNodeUtils'; -import { getValidator } from './schemaValidation/validatorFactory'; +import { type IApplicableSchema } from './schemaValidation/baseValidator.ts'; +import { findNodeAtOffset } from './astNodeUtils.ts'; +import { getValidator } from './schemaValidation/validatorFactory.ts'; abstract class ASTNodeImpl { public abstract readonly type: 'object' | 'property' | 'array' | 'number' | 'boolean' | 'null' | 'string'; diff --git a/src/languageservice/parser/schemaValidation/baseValidator.ts b/src/languageservice/parser/schemaValidation/baseValidator.ts index df8b8b451..ffdbbaaf7 100644 --- a/src/languageservice/parser/schemaValidation/baseValidator.ts +++ b/src/languageservice/parser/schemaValidation/baseValidator.ts @@ -4,21 +4,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import type { JSONSchema, JSONSchemaRef, SchemaDialect } from '../../jsonSchema'; -import type { ASTNode, ArrayASTNode, NumberASTNode, ObjectASTNode, PropertyASTNode, StringASTNode } from '../../jsonASTTypes'; -import { equals, isBoolean, isDefined, isIterable, isNumber, isString } from '../../utils/objects'; -import { getSchemaTypeName } from '../../utils/schemaUtils'; -import { isArrayEqual } from '../../utils/arrUtils'; -import { safeCreateUnicodeRegExp } from '../../utils/strings'; -import { FilePatternAssociation } from '../../utils/filePatternAssociation'; -import { floatSafeRemainder } from '../../utils/math'; +import type { JSONSchema, JSONSchemaRef, SchemaDialect } from '../../jsonSchema.ts'; +import type { ASTNode, ArrayASTNode, NumberASTNode, ObjectASTNode, PropertyASTNode, StringASTNode } from '../../jsonASTTypes.ts'; +import { equals, isBoolean, isDefined, isIterable, isNumber, isString } from '../../utils/objects.ts'; +import { getSchemaTypeName } from '../../utils/schemaUtils.ts'; +import { isArrayEqual } from '../../utils/arrUtils.ts'; +import { safeCreateUnicodeRegExp } from '../../utils/strings.ts'; +import { FilePatternAssociation } from '../../utils/filePatternAssociation.ts'; +import { floatSafeRemainder } from '../../utils/math.ts'; import { ErrorCode } from 'vscode-json-languageservice'; import * as l10n from '@vscode/l10n'; import { URI } from 'vscode-uri'; import { Diagnostic, DiagnosticSeverity, Range } from 'vscode-languageserver-types'; import type { TextDocument } from 'vscode-languageserver-textdocument'; -import { contains, getNodeValue } from '../astNodeUtils'; -import { getValidator } from './validatorFactory'; +import { contains, getNodeValue } from '../astNodeUtils.ts'; +import { getValidator } from './validatorFactory.ts'; export const YAML_SOURCE = 'YAML'; const YAML_SCHEMA_PREFIX = 'yaml-schema: '; diff --git a/src/languageservice/parser/schemaValidation/draft04Validator.ts b/src/languageservice/parser/schemaValidation/draft04Validator.ts index afcd526b8..2f0c85083 100644 --- a/src/languageservice/parser/schemaValidation/draft04Validator.ts +++ b/src/languageservice/parser/schemaValidation/draft04Validator.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import type { JSONSchema } from '../../jsonSchema'; -import { SchemaDialect } from '../../jsonSchema'; -import { isBoolean, isNumber } from '../../utils/objects'; -import { BaseValidator } from './baseValidator'; +import type { JSONSchema } from '../../jsonSchema.ts'; +import { SchemaDialect } from '../../jsonSchema.ts'; +import { isBoolean, isNumber } from '../../utils/objects.ts'; +import { BaseValidator } from './baseValidator.ts'; export class Draft04Validator extends BaseValidator { protected override getCurrentDialect(): SchemaDialect { diff --git a/src/languageservice/parser/schemaValidation/draft07Validator.ts b/src/languageservice/parser/schemaValidation/draft07Validator.ts index a15a7c60b..b4a3d4bd9 100644 --- a/src/languageservice/parser/schemaValidation/draft07Validator.ts +++ b/src/languageservice/parser/schemaValidation/draft07Validator.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import type { JSONSchema } from '../../jsonSchema'; -import { SchemaDialect } from '../../jsonSchema'; -import { isNumber } from '../../utils/objects'; -import { BaseValidator } from './baseValidator'; +import type { JSONSchema } from '../../jsonSchema.ts'; +import { SchemaDialect } from '../../jsonSchema.ts'; +import { isNumber } from '../../utils/objects.ts'; +import { BaseValidator } from './baseValidator.ts'; export class Draft07Validator extends BaseValidator { protected override getCurrentDialect(): SchemaDialect { diff --git a/src/languageservice/parser/schemaValidation/draft2019Validator.ts b/src/languageservice/parser/schemaValidation/draft2019Validator.ts index b59e131cf..e152c1bd5 100644 --- a/src/languageservice/parser/schemaValidation/draft2019Validator.ts +++ b/src/languageservice/parser/schemaValidation/draft2019Validator.ts @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import type { JSONSchema, JSONSchemaRef } from '../../jsonSchema'; -import { SchemaDialect } from '../../jsonSchema'; -import type { ASTNode, ArrayASTNode, ObjectASTNode } from '../../jsonASTTypes'; -import { isNumber } from '../../utils/objects'; +import type { JSONSchema, JSONSchemaRef } from '../../jsonSchema.ts'; +import { SchemaDialect } from '../../jsonSchema.ts'; +import type { ASTNode, ArrayASTNode, ObjectASTNode } from '../../jsonASTTypes.ts'; +import { isNumber } from '../../utils/objects.ts'; import * as l10n from '@vscode/l10n'; import { DiagnosticSeverity } from 'vscode-languageserver-types'; import { ErrorCode } from 'vscode-json-languageservice'; -import { Draft07Validator } from './draft07Validator'; -import { ValidationResult, asSchema } from './baseValidator'; -import type { ISchemaCollector, Options } from './baseValidator'; +import { Draft07Validator } from './draft07Validator.ts'; +import { ValidationResult, asSchema } from './baseValidator.ts'; +import type { ISchemaCollector, Options } from './baseValidator.ts'; export class Draft2019Validator extends Draft07Validator { protected override getCurrentDialect(): SchemaDialect { diff --git a/src/languageservice/parser/schemaValidation/draft2020Validator.ts b/src/languageservice/parser/schemaValidation/draft2020Validator.ts index 067346c65..c867c7ff2 100644 --- a/src/languageservice/parser/schemaValidation/draft2020Validator.ts +++ b/src/languageservice/parser/schemaValidation/draft2020Validator.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import type { JSONSchema, JSONSchemaRef } from '../../jsonSchema'; -import { SchemaDialect } from '../../jsonSchema'; -import type { ASTNode, ArrayASTNode } from '../../jsonASTTypes'; -import { isNumber } from '../../utils/objects'; +import type { JSONSchema, JSONSchemaRef } from '../../jsonSchema.ts'; +import { SchemaDialect } from '../../jsonSchema.ts'; +import type { ASTNode, ArrayASTNode } from '../../jsonASTTypes.ts'; +import { isNumber } from '../../utils/objects.ts'; import * as l10n from '@vscode/l10n'; import { DiagnosticSeverity } from 'vscode-languageserver-types'; -import { Draft2019Validator } from './draft2019Validator'; -import type { ISchemaCollector, Options } from './baseValidator'; -import { ValidationResult, asSchema } from './baseValidator'; +import { Draft2019Validator } from './draft2019Validator.ts'; +import type { ISchemaCollector, Options } from './baseValidator.ts'; +import { ValidationResult, asSchema } from './baseValidator.ts'; export class Draft2020Validator extends Draft2019Validator { protected override getCurrentDialect(): SchemaDialect { diff --git a/src/languageservice/parser/schemaValidation/validatorFactory.ts b/src/languageservice/parser/schemaValidation/validatorFactory.ts index ba8777983..34554aa87 100644 --- a/src/languageservice/parser/schemaValidation/validatorFactory.ts +++ b/src/languageservice/parser/schemaValidation/validatorFactory.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SchemaDialect } from '../../jsonSchema'; -import { BaseValidator } from './baseValidator'; -import { Draft04Validator } from './draft04Validator'; -import { Draft07Validator } from './draft07Validator'; -import { Draft2019Validator } from './draft2019Validator'; -import { Draft2020Validator } from './draft2020Validator'; +import { SchemaDialect } from '../../jsonSchema.ts'; +import { BaseValidator } from './baseValidator.ts'; +import { Draft04Validator } from './draft04Validator.ts'; +import { Draft07Validator } from './draft07Validator.ts'; +import { Draft2019Validator } from './draft2019Validator.ts'; +import { Draft2020Validator } from './draft2020Validator.ts'; export function getValidator(dialect: SchemaDialect): BaseValidator { switch (dialect) { diff --git a/src/languageservice/parser/yaml-documents.ts b/src/languageservice/parser/yaml-documents.ts index ef1f0b8de..dc831ff89 100644 --- a/src/languageservice/parser/yaml-documents.ts +++ b/src/languageservice/parser/yaml-documents.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import { TextDocument } from 'vscode-languageserver-textdocument'; -import { JSONDocument } from './jsonDocument'; +import { JSONDocument } from './jsonDocument.ts'; import { CST, Document, isNode, isPair, isScalar, LineCounter, Node, visit, YAMLError } from 'yaml'; -import { ASTNode, YamlNode } from '../jsonASTTypes'; -import { defaultOptions, parse as parseYAML, ParserOptions } from './yamlParser07'; +import { ASTNode, YamlNode } from '../jsonASTTypes.ts'; +import { defaultOptions, parse as parseYAML, ParserOptions } from './yamlParser07.ts'; import { ErrorCode } from 'vscode-json-languageservice'; -import { convertAST } from './ast-converter'; -import { YAMLDocDiagnostic } from '../utils/parseUtils'; -import { isArrayEqual } from '../utils/arrUtils'; -import { getParent } from '../utils/yamlAstUtils'; -import { TextBuffer } from '../utils/textBuffer'; -import { getIndentation } from '../utils/strings'; +import { convertAST } from './ast-converter.ts'; +import { YAMLDocDiagnostic } from '../utils/parseUtils.ts'; +import { isArrayEqual } from '../utils/arrUtils.ts'; +import { getParent } from '../utils/yamlAstUtils.ts'; +import { TextBuffer } from '../utils/textBuffer.ts'; +import { getIndentation } from '../utils/strings.ts'; /** * These documents are collected into a final YAMLDocument diff --git a/src/languageservice/parser/yamlParser07.ts b/src/languageservice/parser/yamlParser07.ts index 1f39a8220..7ebac6a41 100644 --- a/src/languageservice/parser/yamlParser07.ts +++ b/src/languageservice/parser/yamlParser07.ts @@ -5,10 +5,10 @@ *--------------------------------------------------------------------------------------------*/ import { Parser, Composer, Document, LineCounter, ParseOptions, DocumentOptions, SchemaOptions } from 'yaml'; -import { YAMLDocument, SingleYAMLDocument } from './yaml-documents'; -import { getCustomTags } from './custom-tag-provider'; +import { YAMLDocument, SingleYAMLDocument } from './yaml-documents.ts'; +import { getCustomTags } from './custom-tag-provider.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; -import { TextBuffer } from '../utils/textBuffer'; +import { TextBuffer } from '../utils/textBuffer.ts'; export { YAMLDocument, SingleYAMLDocument }; diff --git a/src/languageservice/services/documentSymbols.ts b/src/languageservice/services/documentSymbols.ts index ebf0f9cf6..1a2611304 100644 --- a/src/languageservice/services/documentSymbols.ts +++ b/src/languageservice/services/documentSymbols.ts @@ -5,12 +5,12 @@ *--------------------------------------------------------------------------------------------*/ import { SymbolInformation, DocumentSymbol } from 'vscode-languageserver-types'; -import { YAMLSchemaService } from './yamlSchemaService'; +import { YAMLSchemaService } from './yamlSchemaService.ts'; import { JSONDocumentSymbols } from 'vscode-json-languageservice/lib/umd/services/jsonDocumentSymbols'; import { DocumentSymbolsContext } from 'vscode-json-languageservice/lib/umd/jsonLanguageTypes'; import { TextDocument } from 'vscode-languageserver-textdocument'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; -import { Telemetry } from '../telemetry'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; +import { Telemetry } from '../telemetry.ts'; import { isMap, isSeq, Node } from 'yaml'; export class YAMLDocumentSymbols { diff --git a/src/languageservice/services/k8sSchemaUtil.ts b/src/languageservice/services/k8sSchemaUtil.ts index 828c05c4c..6b7af7924 100644 --- a/src/languageservice/services/k8sSchemaUtil.ts +++ b/src/languageservice/services/k8sSchemaUtil.ts @@ -1,8 +1,8 @@ -import { JSONDocument } from '../parser/jsonDocument'; -import { SingleYAMLDocument } from '../parser/yamlParser07'; +import { JSONDocument } from '../parser/jsonDocument.ts'; +import { SingleYAMLDocument } from '../parser/yamlParser07.ts'; import { ResolvedSchema } from 'vscode-json-languageservice/lib/umd/services/jsonSchemaService'; -import { JSONSchema } from '../jsonSchema'; +import { JSONSchema } from '../jsonSchema.ts'; /** * Attempt to retrieve the schema for a given YAML document based on the Kubernetes GroupVersionKind (GVK). diff --git a/src/languageservice/services/modelineUtil.ts b/src/languageservice/services/modelineUtil.ts index ad867a2dd..1484caeda 100644 --- a/src/languageservice/services/modelineUtil.ts +++ b/src/languageservice/services/modelineUtil.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SingleYAMLDocument } from '../parser/yamlParser07'; -import { JSONDocument } from '../parser/jsonDocument'; +import { SingleYAMLDocument } from '../parser/yamlParser07.ts'; +import { JSONDocument } from '../parser/jsonDocument.ts'; /** * Retrieve schema if declared as modeline. diff --git a/src/languageservice/services/schemaRequestHandler.ts b/src/languageservice/services/schemaRequestHandler.ts index 44d822109..4dca96b13 100644 --- a/src/languageservice/services/schemaRequestHandler.ts +++ b/src/languageservice/services/schemaRequestHandler.ts @@ -3,9 +3,9 @@ import { getErrorStatusDescription, xhr, XHRResponse } from 'request-light'; import * as URL from 'url'; import { Connection, RequestType, WorkspaceFolder } from 'vscode-languageserver'; import { URI } from 'vscode-uri'; -import { CustomSchemaContentRequest, VSCodeContentRequest } from '../../requestTypes'; -import { isRelativePath, relativeToAbsolutePath } from '../utils/paths'; -import { WorkspaceContextService } from '../yamlLanguageService'; +import { CustomSchemaContentRequest, VSCodeContentRequest } from '../../requestTypes.ts'; +import { isRelativePath, relativeToAbsolutePath } from '../utils/paths.ts'; +import { WorkspaceContextService } from '../yamlLanguageService.ts'; export interface FileSystem { readFile(fsPath: string, encoding?: string): Promise; diff --git a/src/languageservice/services/validation/map-key-order.ts b/src/languageservice/services/validation/map-key-order.ts index be39089b0..f87685247 100644 --- a/src/languageservice/services/validation/map-key-order.ts +++ b/src/languageservice/services/validation/map-key-order.ts @@ -6,8 +6,8 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic, DiagnosticSeverity, Range } from 'vscode-languageserver-types'; import { CST, isMap, Node, Pair, visit } from 'yaml'; -import { SingleYAMLDocument } from '../../parser/yaml-documents'; -import { AdditionalValidator } from './types'; +import { SingleYAMLDocument } from '../../parser/yaml-documents.ts'; +import { AdditionalValidator } from './types.ts'; export class MapKeyOrderValidator implements AdditionalValidator { validate(document: TextDocument, yamlDoc: SingleYAMLDocument): Diagnostic[] { diff --git a/src/languageservice/services/validation/types.ts b/src/languageservice/services/validation/types.ts index c31bcfaad..18cfaa5be 100644 --- a/src/languageservice/services/validation/types.ts +++ b/src/languageservice/services/validation/types.ts @@ -5,7 +5,7 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic } from 'vscode-languageserver-types'; -import { SingleYAMLDocument } from '../../parser/yaml-documents'; +import { SingleYAMLDocument } from '../../parser/yaml-documents.ts'; export interface AdditionalValidator { validate(document: TextDocument, yamlDoc: SingleYAMLDocument): Diagnostic[]; diff --git a/src/languageservice/services/validation/unused-anchors.ts b/src/languageservice/services/validation/unused-anchors.ts index 34eb8edad..c35871cfe 100644 --- a/src/languageservice/services/validation/unused-anchors.ts +++ b/src/languageservice/services/validation/unused-anchors.ts @@ -6,10 +6,10 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic, DiagnosticSeverity, DiagnosticTag, Range } from 'vscode-languageserver-types'; import { isAlias, isCollection, isNode, isScalar, Node, Scalar, visit, YAMLMap, YAMLSeq, CST, Pair } from 'yaml'; -import { YamlNode } from '../../jsonASTTypes'; -import { SingleYAMLDocument } from '../../parser/yaml-documents'; -import { AdditionalValidator } from './types'; -import { isCollectionItem } from '../../utils/yamlAstUtils'; +import { YamlNode } from '../../jsonASTTypes.ts'; +import { SingleYAMLDocument } from '../../parser/yaml-documents.ts'; +import { AdditionalValidator } from './types.ts'; +import { isCollectionItem } from '../../utils/yamlAstUtils.ts'; import * as l10n from '@vscode/l10n'; export class UnusedAnchorsValidator implements AdditionalValidator { diff --git a/src/languageservice/services/validation/yaml-style.ts b/src/languageservice/services/validation/yaml-style.ts index ccd3b93d9..7c6a1e639 100644 --- a/src/languageservice/services/validation/yaml-style.ts +++ b/src/languageservice/services/validation/yaml-style.ts @@ -1,9 +1,9 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Diagnostic, DiagnosticSeverity, Range } from 'vscode-languageserver-types'; import { CST, isMap, isSeq, visit } from 'yaml'; -import { SingleYAMLDocument } from '../../parser/yaml-documents'; -import { LanguageSettings } from '../../yamlLanguageService'; -import { AdditionalValidator } from './types'; +import { SingleYAMLDocument } from '../../parser/yaml-documents.ts'; +import { LanguageSettings } from '../../yamlLanguageService.ts'; +import { AdditionalValidator } from './types.ts'; import * as l10n from '@vscode/l10n'; export class YAMLStyleValidator implements AdditionalValidator { diff --git a/src/languageservice/services/yamlCodeActions.ts b/src/languageservice/services/yamlCodeActions.ts index 5d89bad1f..f1c67c7ff 100644 --- a/src/languageservice/services/yamlCodeActions.ts +++ b/src/languageservice/services/yamlCodeActions.ts @@ -21,19 +21,19 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { CST, isMap, isSeq, isScalar, Scalar, visit, YAMLMap } from 'yaml'; -import { YamlCommands } from '../../commands'; -import { TextBuffer } from '../utils/textBuffer'; -import { toYamlStringScalar } from '../utils/yamlScalar'; -import { LanguageSettings } from '../yamlLanguageService'; -import { YAML_SOURCE } from '../parser/schemaValidation/baseValidator'; -import { getFirstNonWhitespaceCharacterAfterOffset } from '../utils/strings'; -import { matchOffsetToDocument } from '../utils/arrUtils'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; - -import { BlockStringRewriter } from '../utils/block-string-rewriter'; -import { FlowStyleRewriter } from '../utils/flow-style-rewriter'; - -import { ASTNode } from '../jsonASTTypes'; +import { YamlCommands } from '../../commands.ts'; +import { TextBuffer } from '../utils/textBuffer.ts'; +import { toYamlStringScalar } from '../utils/yamlScalar.ts'; +import { LanguageSettings } from '../yamlLanguageService.ts'; +import { YAML_SOURCE } from '../parser/schemaValidation/baseValidator.ts'; +import { getFirstNonWhitespaceCharacterAfterOffset } from '../utils/strings.ts'; +import { matchOffsetToDocument } from '../utils/arrUtils.ts'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; + +import { BlockStringRewriter } from '../utils/block-string-rewriter.ts'; +import { FlowStyleRewriter } from '../utils/flow-style-rewriter.ts'; + +import { ASTNode } from '../jsonASTTypes.ts'; interface YamlDiagnosticData { schemaUri: string[]; diff --git a/src/languageservice/services/yamlCodeLens.ts b/src/languageservice/services/yamlCodeLens.ts index a1a43c3fd..4a248f61d 100644 --- a/src/languageservice/services/yamlCodeLens.ts +++ b/src/languageservice/services/yamlCodeLens.ts @@ -5,13 +5,13 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { CodeLens, Range } from 'vscode-languageserver-types'; -import { YamlCommands } from '../../commands'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; -import { YAMLSchemaService } from './yamlSchemaService'; -import { JSONSchema } from '../jsonSchema'; -import { Telemetry } from '../telemetry'; -import { getSchemaUrls } from '../utils/schemaUrls'; -import { getSchemaTitle } from '../utils/schemaUtils'; +import { YamlCommands } from '../../commands.ts'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; +import { YAMLSchemaService } from './yamlSchemaService.ts'; +import { JSONSchema } from '../jsonSchema.ts'; +import { Telemetry } from '../telemetry.ts'; +import { getSchemaUrls } from '../utils/schemaUrls.ts'; +import { getSchemaTitle } from '../utils/schemaUtils.ts'; export class YamlCodeLens { constructor( diff --git a/src/languageservice/services/yamlCommands.ts b/src/languageservice/services/yamlCommands.ts index d91df8606..a4f1a473a 100644 --- a/src/languageservice/services/yamlCommands.ts +++ b/src/languageservice/services/yamlCommands.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { Connection } from 'vscode-languageserver'; -import { YamlCommands } from '../../commands'; -import { CommandExecutor } from '../../languageserver/commandExecutor'; +import { YamlCommands } from '../../commands.ts'; +import { CommandExecutor } from '../../languageserver/commandExecutor.ts'; import { URI } from 'vscode-uri'; export function registerCommands(commandExecutor: CommandExecutor, connection: Connection): void { diff --git a/src/languageservice/services/yamlCompletion.ts b/src/languageservice/services/yamlCompletion.ts index 96f7ed9e3..ef58289ac 100644 --- a/src/languageservice/services/yamlCompletion.ts +++ b/src/languageservice/services/yamlCompletion.ts @@ -18,27 +18,27 @@ import { TextEdit, } from 'vscode-languageserver-types'; import { Node, isPair, isScalar, isMap, YAMLMap, isSeq, YAMLSeq, isNode, Pair } from 'yaml'; -import { parseCustomTag } from '../utils/customTags'; -import { Telemetry } from '../telemetry'; -import { SingleYAMLDocument, YamlDocuments } from '../parser/yaml-documents'; -import { YamlVersion } from '../parser/yamlParser07'; -import { matchOffsetToDocument } from '../utils/arrUtils'; -import { guessIndentation } from '../utils/indentationGuesser'; -import { TextBuffer } from '../utils/textBuffer'; -import { LanguageSettings } from '../yamlLanguageService'; -import { YAMLSchemaService } from './yamlSchemaService'; +import { parseCustomTag } from '../utils/customTags.ts'; +import { Telemetry } from '../telemetry.ts'; +import { SingleYAMLDocument, YamlDocuments } from '../parser/yaml-documents.ts'; +import { YamlVersion } from '../parser/yamlParser07.ts'; +import { matchOffsetToDocument } from '../utils/arrUtils.ts'; +import { guessIndentation } from '../utils/indentationGuesser.ts'; +import { TextBuffer } from '../utils/textBuffer.ts'; +import { LanguageSettings } from '../yamlLanguageService.ts'; +import { YAMLSchemaService } from './yamlSchemaService.ts'; import { ResolvedSchema } from 'vscode-json-languageservice/lib/umd/services/jsonSchemaService'; -import { JSONSchema, JSONSchemaRef } from '../jsonSchema'; -import { stringifyObject, StringifySettings } from '../utils/json'; -import { isDefined, isString } from '../utils/objects'; -import { setKubernetesParserOption } from '../parser/isKubernetes'; -import { asSchema } from '../parser/schemaValidation/baseValidator'; -import { indexOf, isInComment, isMapContainsEmptyPair } from '../utils/yamlAstUtils'; -import { isModeline } from './modelineUtil'; -import { getSchemaTypeName, isAnyOfAllOfOneOfType, isPrimitiveType } from '../utils/schemaUtils'; -import { YamlNode } from '../jsonASTTypes'; -import { SettingsState } from '../../yamlSettings'; -import { toYamlStringScalar } from '../utils/yamlScalar'; +import { JSONSchema, JSONSchemaRef } from '../jsonSchema.ts'; +import { stringifyObject, StringifySettings } from '../utils/json.ts'; +import { isDefined, isString } from '../utils/objects.ts'; +import { setKubernetesParserOption } from '../parser/isKubernetes.ts'; +import { asSchema } from '../parser/schemaValidation/baseValidator.ts'; +import { indexOf, isInComment, isMapContainsEmptyPair } from '../utils/yamlAstUtils.ts'; +import { isModeline } from './modelineUtil.ts'; +import { getSchemaTypeName, isAnyOfAllOfOneOfType, isPrimitiveType } from '../utils/schemaUtils.ts'; +import { YamlNode } from '../jsonASTTypes.ts'; +import { SettingsState } from '../../yamlSettings.ts'; +import { toYamlStringScalar } from '../utils/yamlScalar.ts'; import * as l10n from '@vscode/l10n'; const parentCompletionKind = CompletionItemKind.Class; diff --git a/src/languageservice/services/yamlDefinition.ts b/src/languageservice/services/yamlDefinition.ts index 8b9261344..24b59edc5 100644 --- a/src/languageservice/services/yamlDefinition.ts +++ b/src/languageservice/services/yamlDefinition.ts @@ -7,10 +7,10 @@ import { DefinitionParams } from 'vscode-languageserver-protocol'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { DefinitionLink, LocationLink, Range } from 'vscode-languageserver-types'; import { isAlias } from 'yaml'; -import { Telemetry } from '../telemetry'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; -import { matchOffsetToDocument } from '../utils/arrUtils'; -import { TextBuffer } from '../utils/textBuffer'; +import { Telemetry } from '../telemetry.ts'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; +import { matchOffsetToDocument } from '../utils/arrUtils.ts'; +import { TextBuffer } from '../utils/textBuffer.ts'; export class YamlDefinition { constructor(private readonly telemetry?: Telemetry) {} diff --git a/src/languageservice/services/yamlFolding.ts b/src/languageservice/services/yamlFolding.ts index bada72d52..d933273a4 100644 --- a/src/languageservice/services/yamlFolding.ts +++ b/src/languageservice/services/yamlFolding.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { FoldingRange, Range } from 'vscode-languageserver-types'; -import { FoldingRangesContext } from '../yamlTypes'; -import { ASTNode } from '../jsonASTTypes'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; +import { FoldingRangesContext } from '../yamlTypes.ts'; +import { ASTNode } from '../jsonASTTypes.ts'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; export function getFoldingRanges(document: TextDocument, context: FoldingRangesContext): FoldingRange[] | undefined { diff --git a/src/languageservice/services/yamlFormatter.ts b/src/languageservice/services/yamlFormatter.ts index 0ac7285f9..9270a4b49 100644 --- a/src/languageservice/services/yamlFormatter.ts +++ b/src/languageservice/services/yamlFormatter.ts @@ -5,7 +5,7 @@ *--------------------------------------------------------------------------------------------*/ import { Range, Position, TextEdit, FormattingOptions } from 'vscode-languageserver-types'; -import { CustomFormatterOptions, LanguageSettings } from '../yamlLanguageService'; +import { CustomFormatterOptions, LanguageSettings } from '../yamlLanguageService.ts'; import { Options } from 'prettier'; import * as yamlPlugin from 'prettier/plugins/yaml'; import * as estreePlugin from 'prettier/plugins/estree'; diff --git a/src/languageservice/services/yamlHover.ts b/src/languageservice/services/yamlHover.ts index fdaa1eac7..3bd68c22e 100644 --- a/src/languageservice/services/yamlHover.ts +++ b/src/languageservice/services/yamlHover.ts @@ -10,18 +10,18 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Hover, MarkupContent, MarkupKind, Position, Range } from 'vscode-languageserver-types'; import { URI } from 'vscode-uri'; import { isAlias, isMap, isSeq, Node, stringify as stringifyYAML } from 'yaml'; -import { ASTNode, ObjectASTNode, PropertyASTNode } from '../jsonASTTypes'; -import { JSONSchema } from '../jsonSchema'; -import { setKubernetesParserOption } from '../parser/isKubernetes'; -import { getNodeValue } from '../parser/astNodeUtils'; -import { IApplicableSchema } from '../parser/schemaValidation/baseValidator'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; -import { SingleYAMLDocument } from '../parser/yamlParser07'; -import { Telemetry } from '../telemetry'; -import { matchOffsetToDocument } from '../utils/arrUtils'; -import { toYamlStringScalar } from '../utils/yamlScalar'; -import { LanguageSettings } from '../yamlLanguageService'; -import { YAMLSchemaService } from './yamlSchemaService'; +import { ASTNode, ObjectASTNode, PropertyASTNode } from '../jsonASTTypes.ts'; +import { JSONSchema } from '../jsonSchema.ts'; +import { setKubernetesParserOption } from '../parser/isKubernetes.ts'; +import { getNodeValue } from '../parser/astNodeUtils.ts'; +import { IApplicableSchema } from '../parser/schemaValidation/baseValidator.ts'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; +import { SingleYAMLDocument } from '../parser/yamlParser07.ts'; +import { Telemetry } from '../telemetry.ts'; +import { matchOffsetToDocument } from '../utils/arrUtils.ts'; +import { toYamlStringScalar } from '../utils/yamlScalar.ts'; +import { LanguageSettings } from '../yamlLanguageService.ts'; +import { YAMLSchemaService } from './yamlSchemaService.ts'; export class YAMLHover { private shouldHover: boolean; diff --git a/src/languageservice/services/yamlLinks.ts b/src/languageservice/services/yamlLinks.ts index eac352e09..4725316e2 100644 --- a/src/languageservice/services/yamlLinks.ts +++ b/src/languageservice/services/yamlLinks.ts @@ -5,8 +5,8 @@ import { findLinks as JSONFindLinks } from 'vscode-json-languageservice/lib/umd/services/jsonLinks'; import { DocumentLink } from 'vscode-languageserver-types'; import { TextDocument } from 'vscode-languageserver-textdocument'; -import { Telemetry } from '../telemetry'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; +import { Telemetry } from '../telemetry.ts'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; export class YamlLinks { constructor(private readonly telemetry?: Telemetry) {} diff --git a/src/languageservice/services/yamlOnTypeFormatting.ts b/src/languageservice/services/yamlOnTypeFormatting.ts index c573b9e7a..42fa93f04 100644 --- a/src/languageservice/services/yamlOnTypeFormatting.ts +++ b/src/languageservice/services/yamlOnTypeFormatting.ts @@ -6,7 +6,7 @@ import { DocumentOnTypeFormattingParams } from 'vscode-languageserver'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { Position, Range, TextEdit } from 'vscode-languageserver-types'; -import { TextBuffer } from '../utils/textBuffer'; +import { TextBuffer } from '../utils/textBuffer.ts'; export function doDocumentOnTypeFormatting( document: TextDocument, diff --git a/src/languageservice/services/yamlRename.ts b/src/languageservice/services/yamlRename.ts index 0071948cd..cd4cd07bb 100644 --- a/src/languageservice/services/yamlRename.ts +++ b/src/languageservice/services/yamlRename.ts @@ -5,13 +5,13 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { Position, Range, WorkspaceEdit, TextEdit } from 'vscode-languageserver-types'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; -import { matchOffsetToDocument } from '../utils/arrUtils'; -import { TextBuffer } from '../utils/textBuffer'; -import { Telemetry } from '../telemetry'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; +import { matchOffsetToDocument } from '../utils/arrUtils.ts'; +import { TextBuffer } from '../utils/textBuffer.ts'; +import { Telemetry } from '../telemetry.ts'; import { CST, isAlias, isCollection, isScalar, visit, Node } from 'yaml'; -import { SingleYAMLDocument } from '../parser/yamlParser07'; -import { isCollectionItem } from '../utils/yamlAstUtils'; +import { SingleYAMLDocument } from '../parser/yamlParser07.ts'; +import { isCollectionItem } from '../utils/yamlAstUtils.ts'; import { PrepareRenameParams, RenameParams, ResponseError, ErrorCodes } from 'vscode-languageserver-protocol'; interface RenameTarget { diff --git a/src/languageservice/services/yamlSchemaService.ts b/src/languageservice/services/yamlSchemaService.ts index 0391faeb4..a3e622f08 100644 --- a/src/languageservice/services/yamlSchemaService.ts +++ b/src/languageservice/services/yamlSchemaService.ts @@ -12,18 +12,18 @@ import { SchemaHandle, UnresolvedSchema, } from 'vscode-json-languageservice/lib/umd/services/jsonSchemaService'; -import { SettingsState } from '../../yamlSettings'; -import { JSONSchema, JSONSchemaMap, JSONSchemaRef, SchemaDialect } from '../jsonSchema'; -import { SchemaPriority, SchemaRequestService, WorkspaceContextService } from '../yamlLanguageService'; +import { SettingsState } from '../../yamlSettings.ts'; +import { JSONSchema, JSONSchemaMap, JSONSchemaRef, SchemaDialect } from '../jsonSchema.ts'; +import { SchemaPriority, SchemaRequestService, WorkspaceContextService } from '../yamlLanguageService.ts'; import * as l10n from '@vscode/l10n'; import * as path from 'path'; import { URI } from 'vscode-uri'; -import { JSONSchemaDescription, JSONSchemaDescriptionExt } from '../../requestTypes'; -import { JSONDocument } from '../parser/jsonDocument'; -import { SingleYAMLDocument } from '../parser/yamlParser07'; -import { SchemaVersions } from '../yamlTypes'; -import { getSchemaFromModeline } from './modelineUtil'; +import { JSONSchemaDescription, JSONSchemaDescriptionExt } from '../../requestTypes.ts'; +import { JSONDocument } from '../parser/jsonDocument.ts'; +import { SingleYAMLDocument } from '../parser/yamlParser07.ts'; +import { SchemaVersions } from '../yamlTypes.ts'; +import { getSchemaFromModeline } from './modelineUtil.ts'; import Ajv, { DefinedError, type AnySchemaObject, type ErrorObject, type ValidateFunction } from 'ajv'; import Ajv4 from 'ajv-draft-04'; @@ -32,8 +32,8 @@ import Ajv2020 from 'ajv/dist/2020'; import type { Localize } from 'ajv-i18n/localize/types'; import * as Json from 'jsonc-parser'; import { parse } from 'yaml'; -import { CRD_CATALOG_URL, EMPTY_SCHEMA_URL, isKubernetes } from '../utils/schemaUrls'; -import { autoDetectKubernetesSchema } from './k8sSchemaUtil'; +import { CRD_CATALOG_URL, EMPTY_SCHEMA_URL, isKubernetes } from '../utils/schemaUrls.ts'; +import { autoDetectKubernetesSchema } from './k8sSchemaUtil.ts'; const ajv4 = new Ajv4({ allErrors: true }); const ajv7 = new Ajv({ allErrors: true }); diff --git a/src/languageservice/services/yamlSelectionRanges.ts b/src/languageservice/services/yamlSelectionRanges.ts index f60dcc91a..7276266bc 100644 --- a/src/languageservice/services/yamlSelectionRanges.ts +++ b/src/languageservice/services/yamlSelectionRanges.ts @@ -1,5 +1,5 @@ import { Position, Range, SelectionRange } from 'vscode-languageserver-types'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { ASTNode } from 'vscode-json-languageservice'; diff --git a/src/languageservice/services/yamlValidation.ts b/src/languageservice/services/yamlValidation.ts index ca2d5900c..ca1fff6e4 100644 --- a/src/languageservice/services/yamlValidation.ts +++ b/src/languageservice/services/yamlValidation.ts @@ -5,23 +5,23 @@ *--------------------------------------------------------------------------------------------*/ import { Diagnostic, Position } from 'vscode-languageserver-types'; -import { LanguageSettings } from '../yamlLanguageService'; -import { YAMLDocument, YamlVersion, SingleYAMLDocument } from '../parser/yamlParser07'; -import { YAMLSchemaService } from './yamlSchemaService'; -import { YAMLDocDiagnostic } from '../utils/parseUtils'; +import { LanguageSettings } from '../yamlLanguageService.ts'; +import { YAMLDocument, YamlVersion, SingleYAMLDocument } from '../parser/yamlParser07.ts'; +import { YAMLSchemaService } from './yamlSchemaService.ts'; +import { YAMLDocDiagnostic } from '../utils/parseUtils.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { JSONValidation } from 'vscode-json-languageservice/lib/umd/services/jsonValidation'; -import { YAML_SOURCE } from '../parser/schemaValidation/baseValidator'; -import { TextBuffer } from '../utils/textBuffer'; -import { filterSuppressedDiagnostics } from '../utils/diagnostic-filter'; -import { yamlDocumentsCache } from '../parser/yaml-documents'; -import { Telemetry } from '../telemetry'; -import { AdditionalValidator } from './validation/types'; -import { UnusedAnchorsValidator } from './validation/unused-anchors'; -import { YAMLStyleValidator } from './validation/yaml-style'; -import { MapKeyOrderValidator } from './validation/map-key-order'; -import { getSchemaFromModeline } from './modelineUtil'; -import { isKubernetes as isKubernetesSchemaURI } from '../utils/schemaUrls'; +import { YAML_SOURCE } from '../parser/schemaValidation/baseValidator.ts'; +import { TextBuffer } from '../utils/textBuffer.ts'; +import { filterSuppressedDiagnostics } from '../utils/diagnostic-filter.ts'; +import { yamlDocumentsCache } from '../parser/yaml-documents.ts'; +import { Telemetry } from '../telemetry.ts'; +import { AdditionalValidator } from './validation/types.ts'; +import { UnusedAnchorsValidator } from './validation/unused-anchors.ts'; +import { YAMLStyleValidator } from './validation/yaml-style.ts'; +import { MapKeyOrderValidator } from './validation/map-key-order.ts'; +import { getSchemaFromModeline } from './modelineUtil.ts'; +import { isKubernetes as isKubernetesSchemaURI } from '../utils/schemaUrls.ts'; /** * Convert a YAMLDocDiagnostic to a language server Diagnostic diff --git a/src/languageservice/utils/arrUtils.ts b/src/languageservice/utils/arrUtils.ts index 0d3f80f81..39f16023a 100644 --- a/src/languageservice/utils/arrUtils.ts +++ b/src/languageservice/utils/arrUtils.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { YAMLDocument, SingleYAMLDocument } from '../parser/yamlParser07'; +import { YAMLDocument, SingleYAMLDocument } from '../parser/yamlParser07.ts'; export function getLineOffsets(textDocString: string): number[] { const lineOffsets: number[] = []; diff --git a/src/languageservice/utils/filePatternAssociation.ts b/src/languageservice/utils/filePatternAssociation.ts index 7edba5d42..7e39cf8ce 100644 --- a/src/languageservice/utils/filePatternAssociation.ts +++ b/src/languageservice/utils/filePatternAssociation.ts @@ -1,4 +1,4 @@ -import { convertSimple2RegExpPattern } from './strings'; +import { convertSimple2RegExpPattern } from './strings.ts'; export class FilePatternAssociation { private schemas: string[]; diff --git a/src/languageservice/utils/flow-style-rewriter.ts b/src/languageservice/utils/flow-style-rewriter.ts index 49c7049d9..536b535ce 100644 --- a/src/languageservice/utils/flow-style-rewriter.ts +++ b/src/languageservice/utils/flow-style-rewriter.ts @@ -1,5 +1,5 @@ import { CST, visit } from 'yaml'; -import { ASTNode } from '../jsonASTTypes'; +import { ASTNode } from '../jsonASTTypes.ts'; export class FlowStyleRewriter { constructor(private readonly indentation: string) {} diff --git a/src/languageservice/utils/indentationGuesser.ts b/src/languageservice/utils/indentationGuesser.ts index 5b84a0266..272326707 100644 --- a/src/languageservice/utils/indentationGuesser.ts +++ b/src/languageservice/utils/indentationGuesser.ts @@ -5,8 +5,8 @@ //copied from https://github.com/Microsoft/vscode/blob/015c3afe96966df50c15a7d66be2ab0ef1dc5f49/src/vs/editor/common/model/indentationGuesser.ts -import { CharCode } from './charCode'; -import { TextBuffer } from './textBuffer'; +import { CharCode } from './charCode.ts'; +import { TextBuffer } from './textBuffer.ts'; class SpacesDiffResult { public spacesDiff = 0; diff --git a/src/languageservice/utils/objects.ts b/src/languageservice/utils/objects.ts index e6db971c2..42c6e8fec 100644 --- a/src/languageservice/utils/objects.ts +++ b/src/languageservice/utils/objects.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { parseYamlBoolean } from '../parser/scalar-type'; +import { parseYamlBoolean } from '../parser/scalar-type.ts'; // eslint-disable-next-line @typescript-eslint/no-explicit-any export function equals(one: any, other: any, type?: any): boolean { diff --git a/src/languageservice/utils/schemaUrls.ts b/src/languageservice/utils/schemaUrls.ts index bae5b431b..d0fd31f0f 100644 --- a/src/languageservice/utils/schemaUrls.ts +++ b/src/languageservice/utils/schemaUrls.ts @@ -1,10 +1,10 @@ import { WorkspaceFolder } from 'vscode-languageserver-protocol'; import { URI } from 'vscode-uri'; import * as path from 'path'; -import { Telemetry } from '../telemetry'; -import { JSONSchema, JSONSchemaRef } from '../jsonSchema'; -import { isBoolean } from './objects'; -import { isRelativePath, relativeToAbsolutePath } from './paths'; +import { Telemetry } from '../telemetry.ts'; +import { JSONSchema, JSONSchemaRef } from '../jsonSchema.ts'; +import { isBoolean } from './objects.ts'; +import { isRelativePath, relativeToAbsolutePath } from './paths.ts'; export const DEFAULT_KUBERNETES_SCHEMA_VERSION = 'v1.34.1'; export const JSON_SCHEMASTORE_URL = 'https://www.schemastore.org/api/json/catalog.json'; diff --git a/src/languageservice/utils/schemaUtils.ts b/src/languageservice/utils/schemaUtils.ts index bc763fb48..51c3bedbf 100644 --- a/src/languageservice/utils/schemaUtils.ts +++ b/src/languageservice/utils/schemaUtils.ts @@ -1,5 +1,5 @@ import { URI } from 'vscode-uri'; -import { JSONSchema } from '../jsonSchema'; +import { JSONSchema } from '../jsonSchema.ts'; import * as path from 'path'; export function getSchemaTypeName(schema: JSONSchema): string { diff --git a/src/languageservice/utils/strings.ts b/src/languageservice/utils/strings.ts index 9587f6874..c0da2c1d0 100644 --- a/src/languageservice/utils/strings.ts +++ b/src/languageservice/utils/strings.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CharCode } from './charCode'; +import { CharCode } from './charCode.ts'; export function startsWith(haystack: string, needle: string): boolean { if (haystack.length < needle.length) { diff --git a/src/languageservice/utils/yamlAstUtils.ts b/src/languageservice/utils/yamlAstUtils.ts index 103952073..3ea4d8c01 100644 --- a/src/languageservice/utils/yamlAstUtils.ts +++ b/src/languageservice/utils/yamlAstUtils.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { CST, Document, isDocument, isScalar, Node, visit, YAMLMap, YAMLSeq } from 'yaml'; -import { YamlNode } from '../jsonASTTypes'; +import { YamlNode } from '../jsonASTTypes.ts'; type Visitor = (item: CST.SourceToken, path: CST.VisitPath) => number | symbol | Visitor | void; diff --git a/src/languageservice/yamlLanguageService.ts b/src/languageservice/yamlLanguageService.ts index f26ea2118..e0d909d09 100644 --- a/src/languageservice/yamlLanguageService.ts +++ b/src/languageservice/yamlLanguageService.ts @@ -10,7 +10,7 @@ import { SchemaAdditions, SchemaDeletions, SchemaDeletionsAll, -} from './services/yamlSchemaService'; +} from './services/yamlSchemaService.ts'; import { Position, CodeAction, @@ -28,13 +28,13 @@ import { Range, WorkspaceEdit, } from 'vscode-languageserver-types'; -import { JSONSchema } from './jsonSchema'; -import { YAMLDocumentSymbols } from './services/documentSymbols'; -import { YAMLHover } from './services/yamlHover'; -import { YAMLValidation } from './services/yamlValidation'; -import { YAMLFormatter } from './services/yamlFormatter'; +import { JSONSchema } from './jsonSchema.ts'; +import { YAMLDocumentSymbols } from './services/documentSymbols.ts'; +import { YAMLHover } from './services/yamlHover.ts'; +import { YAMLValidation } from './services/yamlValidation.ts'; +import { YAMLFormatter } from './services/yamlFormatter.ts'; import { DocumentSymbolsContext } from 'vscode-json-languageservice'; -import { YamlLinks } from './services/yamlLinks'; +import { YamlLinks } from './services/yamlLinks.ts'; import { ClientCapabilities, CodeActionParams, @@ -45,20 +45,20 @@ import { RenameParams, } from 'vscode-languageserver'; import { TextDocument } from 'vscode-languageserver-textdocument'; -import { getFoldingRanges } from './services/yamlFolding'; -import { FoldingRangesContext, SchemaVersions } from './yamlTypes'; -import { YamlCodeActions } from './services/yamlCodeActions'; -import { doDocumentOnTypeFormatting } from './services/yamlOnTypeFormatting'; -import { YamlCodeLens } from './services/yamlCodeLens'; -import { Telemetry } from './telemetry'; -import { YamlVersion } from './parser/yamlParser07'; -import { YamlCompletion } from './services/yamlCompletion'; -import { yamlDocumentsCache } from './parser/yaml-documents'; -import { SettingsState } from '../yamlSettings'; -import { JSONSchemaSelection } from '../languageserver/handlers/schemaSelectionHandlers'; -import { YamlDefinition } from './services/yamlDefinition'; -import { getSelectionRanges } from './services/yamlSelectionRanges'; -import { YamlRename } from './services/yamlRename'; +import { getFoldingRanges } from './services/yamlFolding.ts'; +import { FoldingRangesContext, SchemaVersions } from './yamlTypes.ts'; +import { YamlCodeActions } from './services/yamlCodeActions.ts'; +import { doDocumentOnTypeFormatting } from './services/yamlOnTypeFormatting.ts'; +import { YamlCodeLens } from './services/yamlCodeLens.ts'; +import { Telemetry } from './telemetry.ts'; +import { YamlVersion } from './parser/yamlParser07.ts'; +import { YamlCompletion } from './services/yamlCompletion.ts'; +import { yamlDocumentsCache } from './parser/yaml-documents.ts'; +import { SettingsState } from '../yamlSettings.ts'; +import { JSONSchemaSelection } from '../languageserver/handlers/schemaSelectionHandlers.ts'; +import { YamlDefinition } from './services/yamlDefinition.ts'; +import { getSelectionRanges } from './services/yamlSelectionRanges.ts'; +import { YamlRename } from './services/yamlRename.ts'; export enum SchemaPriority { SchemaStore = 1, diff --git a/src/requestTypes.ts b/src/requestTypes.ts index 987e5c303..55b786be7 100644 --- a/src/requestTypes.ts +++ b/src/requestTypes.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/no-namespace */ import { NotificationType, RequestType } from 'vscode-languageserver'; -import { SchemaAdditions, SchemaDeletions } from './languageservice/services/yamlSchemaService'; -import { SchemaConfiguration } from './languageservice/yamlLanguageService'; -import { SchemaVersions } from './languageservice/yamlTypes'; +import { SchemaAdditions, SchemaDeletions } from './languageservice/services/yamlSchemaService.ts'; +import { SchemaConfiguration } from './languageservice/yamlLanguageService.ts'; +import { SchemaVersions } from './languageservice/yamlTypes.ts'; export type ISchemaAssociations = Record; diff --git a/src/server.ts b/src/server.ts index 76fbfbd8b..818f5b503 100644 --- a/src/server.ts +++ b/src/server.ts @@ -7,12 +7,12 @@ import { promises as fs } from 'fs'; import { Connection, createConnection, ProposedFeatures } from 'vscode-languageserver/node'; -import { TelemetryImpl } from './languageserver/telemetry'; -import { schemaRequestHandler, workspaceContext } from './languageservice/services/schemaRequestHandler'; -import { convertErrorToTelemetryMsg } from './languageservice/utils/objects'; -import { setupl10nBundle } from './nodeTranslationSetup'; -import { YAMLServerInit } from './yamlServerInit'; -import { SettingsState } from './yamlSettings'; +import { TelemetryImpl } from './languageserver/telemetry.ts'; +import { schemaRequestHandler, workspaceContext } from './languageservice/services/schemaRequestHandler.ts'; +import { convertErrorToTelemetryMsg } from './languageservice/utils/objects.ts'; +import { setupl10nBundle } from './nodeTranslationSetup.ts'; +import { YAMLServerInit } from './yamlServerInit.ts'; +import { SettingsState } from './yamlSettings.ts'; // Create a connection for the server. let connection: Connection = null; diff --git a/src/webworker/yamlServerMain.ts b/src/webworker/yamlServerMain.ts index 1ea7647c0..24bf2589c 100644 --- a/src/webworker/yamlServerMain.ts +++ b/src/webworker/yamlServerMain.ts @@ -6,10 +6,10 @@ import * as l10n from '@vscode/l10n'; import { Connection, RequestType } from 'vscode-languageserver'; import { BrowserMessageReader, BrowserMessageWriter, createConnection } from 'vscode-languageserver/browser'; -import { TelemetryImpl } from '../languageserver/telemetry'; -import { schemaRequestHandler, workspaceContext } from '../languageservice/services/schemaRequestHandler'; -import { YAMLServerInit } from '../yamlServerInit'; -import { SettingsState } from '../yamlSettings'; +import { TelemetryImpl } from '../languageserver/telemetry.ts'; +import { schemaRequestHandler, workspaceContext } from '../languageservice/services/schemaRequestHandler.ts'; +import { YAMLServerInit } from '../yamlServerInit.ts'; +import { SettingsState } from '../yamlSettings.ts'; // eslint-disable-next-line @typescript-eslint/no-namespace namespace FSReadFile { diff --git a/src/yamlServerInit.ts b/src/yamlServerInit.ts index 9c95140dd..c76904b8b 100644 --- a/src/yamlServerInit.ts +++ b/src/yamlServerInit.ts @@ -1,23 +1,23 @@ import { Connection, InitializeParams, InitializeResult, TextDocumentSyncKind } from 'vscode-languageserver'; import { URI } from 'vscode-uri'; -import { YamlCommands } from './commands'; -import { commandExecutor } from './languageserver/commandExecutor'; -import { LanguageHandlers } from './languageserver/handlers/languageHandlers'; -import { NotificationHandlers } from './languageserver/handlers/notificationHandlers'; -import { RequestHandlers } from './languageserver/handlers/requestHandlers'; -import { SettingsHandler } from './languageserver/handlers/settingsHandlers'; -import { ValidationHandler } from './languageserver/handlers/validationHandlers'; -import { WorkspaceHandlers } from './languageserver/handlers/workspaceHandlers'; -import { registerCommands } from './languageservice/services/yamlCommands'; -import { Telemetry } from './languageservice/telemetry'; -import { workspaceFoldersChanged } from './languageservice/utils/paths'; +import { YamlCommands } from './commands.ts'; +import { commandExecutor } from './languageserver/commandExecutor.ts'; +import { LanguageHandlers } from './languageserver/handlers/languageHandlers.ts'; +import { NotificationHandlers } from './languageserver/handlers/notificationHandlers.ts'; +import { RequestHandlers } from './languageserver/handlers/requestHandlers.ts'; +import { SettingsHandler } from './languageserver/handlers/settingsHandlers.ts'; +import { ValidationHandler } from './languageserver/handlers/validationHandlers.ts'; +import { WorkspaceHandlers } from './languageserver/handlers/workspaceHandlers.ts'; +import { registerCommands } from './languageservice/services/yamlCommands.ts'; +import { Telemetry } from './languageservice/telemetry.ts'; +import { workspaceFoldersChanged } from './languageservice/utils/paths.ts'; import { getLanguageService as getCustomLanguageService, LanguageService, SchemaRequestService, WorkspaceContextService, -} from './languageservice/yamlLanguageService'; -import { SettingsState } from './yamlSettings'; +} from './languageservice/yamlLanguageService.ts'; +import { SettingsState } from './yamlSettings.ts'; export class YAMLServerInit { languageService: LanguageService; diff --git a/src/yamlSettings.ts b/src/yamlSettings.ts index 527cf3183..0acc6621c 100644 --- a/src/yamlSettings.ts +++ b/src/yamlSettings.ts @@ -1,11 +1,11 @@ import { TextDocuments, Disposable, ClientCapabilities, WorkspaceFolder } from 'vscode-languageserver'; -import { CustomFormatterOptions, SchemaConfiguration } from './languageservice/yamlLanguageService'; -import { ISchemaAssociations } from './requestTypes'; +import { CustomFormatterOptions, SchemaConfiguration } from './languageservice/yamlLanguageService.ts'; +import { ISchemaAssociations } from './requestTypes.ts'; import { URI } from 'vscode-uri'; -import { JSONSchema } from './languageservice/jsonSchema'; +import { JSONSchema } from './languageservice/jsonSchema.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; -import { CRD_CATALOG_URL, JSON_SCHEMASTORE_URL } from './languageservice/utils/schemaUrls'; -import { YamlVersion } from './languageservice/parser/yamlParser07'; +import { CRD_CATALOG_URL, JSON_SCHEMASTORE_URL } from './languageservice/utils/schemaUrls.ts'; +import { YamlVersion } from './languageservice/parser/yamlParser07.ts'; // Client settings interface to grab settings relevant for the language server export interface Settings { diff --git a/test/arrUtils.test.ts b/test/arrUtils.test.ts index 9f926f966..dadd7ec46 100644 --- a/test/arrUtils.test.ts +++ b/test/arrUtils.test.ts @@ -2,7 +2,7 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getLineOffsets, removeDuplicatesObj } from '../src/languageservice/utils/arrUtils'; +import { getLineOffsets, removeDuplicatesObj } from '../src/languageservice/utils/arrUtils.ts'; import assert from 'assert'; describe('Array Utils Tests', () => { diff --git a/test/astUtils.test.ts b/test/astUtils.test.ts index e214485a0..2a4366650 100644 --- a/test/astUtils.test.ts +++ b/test/astUtils.test.ts @@ -5,10 +5,10 @@ import * as chai from 'chai'; import { isPair, isSeq, Pair, YAMLSeq } from 'yaml'; -import { YamlDocuments } from '../src/languageservice/parser/yaml-documents'; -import { getParent, isInComment } from '../src/languageservice/utils/yamlAstUtils'; -import { TextBuffer } from '../src/languageservice/utils/textBuffer'; -import { setupTextDocument } from './utils/testHelper'; +import { YamlDocuments } from '../src/languageservice/parser/yaml-documents.ts'; +import { getParent, isInComment } from '../src/languageservice/utils/yamlAstUtils.ts'; +import { TextBuffer } from '../src/languageservice/utils/textBuffer.ts'; +import { setupTextDocument } from './utils/testHelper.ts'; const expect = chai.expect; describe('AST Utils Tests', () => { diff --git a/test/autoCompletion.test.ts b/test/autoCompletion.test.ts index 69856908e..e0c6328e8 100644 --- a/test/autoCompletion.test.ts +++ b/test/autoCompletion.test.ts @@ -10,11 +10,11 @@ import { setupSchemaIDTextDocument, TestCustomSchemaProvider, toFsPath, -} from './utils/testHelper'; +} from './utils/testHelper.ts'; import assert from 'assert'; import * as path from 'path'; -import { createExpectedCompletion } from './utils/verifyError'; -import { ServiceSetup } from './utils/serviceSetup'; +import { createExpectedCompletion } from './utils/verifyError.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { CompletionItemKind, CompletionList, @@ -24,9 +24,9 @@ import { Position, } from 'vscode-languageserver-types'; import { expect } from 'chai'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { LanguageService } from '../src'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { LanguageService } from '../src/index.ts'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; describe('Auto Completion Tests', () => { let languageSettingsSetup: ServiceSetup; diff --git a/test/autoCompletionFix.test.ts b/test/autoCompletionFix.test.ts index 1926d9ece..d5629aec0 100644 --- a/test/autoCompletionFix.test.ts +++ b/test/autoCompletionFix.test.ts @@ -4,21 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import { CompletionItemKind, CompletionList, InsertTextFormat, Position, Range } from 'vscode-languageserver-types'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; -import { LanguageService } from '../src/languageservice/yamlLanguageService'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { ServiceSetup } from './utils/serviceSetup'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; +import { LanguageService } from '../src/languageservice/yamlLanguageService.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { caretPosition, SCHEMA_ID, setupLanguageService, setupSchemaIDTextDocument, TestCustomSchemaProvider, -} from './utils/testHelper'; +} from './utils/testHelper.ts'; import { expect } from 'chai'; -import { createExpectedCompletion } from './utils/verifyError'; +import { createExpectedCompletion } from './utils/verifyError.ts'; import * as path from 'path'; -import { JSONSchema } from './../src/languageservice/jsonSchema'; +import { JSONSchema } from './../src/languageservice/jsonSchema.ts'; describe('Auto Completion Fix Tests', () => { let languageSettingsSetup: ServiceSetup; diff --git a/test/bundlel10n.test.ts b/test/bundlel10n.test.ts index 7232624c0..dde067dd5 100644 --- a/test/bundlel10n.test.ts +++ b/test/bundlel10n.test.ts @@ -6,12 +6,12 @@ import * as l10n from '@vscode/l10n'; import assert from 'assert'; import * as path from 'path'; import { Connection, createConnection } from 'vscode-languageserver/node'; -import { schemaRequestHandler, workspaceContext } from '../src/languageservice/services/schemaRequestHandler'; -import { setupl10nBundle } from '../src/nodeTranslationSetup'; -import { YAMLServerInit } from '../src/yamlServerInit'; -import { SettingsState } from '../src/yamlSettings'; -import { TestCustomSchemaProvider, testFileSystem } from './utils/testHelper'; -import { TestTelemetry } from './utils/testsTypes'; +import { schemaRequestHandler, workspaceContext } from '../src/languageservice/services/schemaRequestHandler.ts'; +import { setupl10nBundle } from '../src/nodeTranslationSetup.ts'; +import { YAMLServerInit } from '../src/yamlServerInit.ts'; +import { SettingsState } from '../src/yamlSettings.ts'; +import { TestCustomSchemaProvider, testFileSystem } from './utils/testHelper.ts'; +import { TestTelemetry } from './utils/testsTypes.ts'; describe('Bundle l10n Test', () => { let serverInit: YAMLServerInit; diff --git a/test/code-action-schema.test.ts b/test/code-action-schema.test.ts index 91e787c00..6e5b72e3c 100644 --- a/test/code-action-schema.test.ts +++ b/test/code-action-schema.test.ts @@ -8,13 +8,13 @@ import { setupSchemaIDTextDocument, TEST_URI, TestCustomSchemaProvider, -} from './utils/testHelper'; -import { ServiceSetup } from './utils/serviceSetup'; +} from './utils/testHelper.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { TextDocumentIdentifier, CodeActionParams, CodeActionContext, TextEdit, Range } from 'vscode-languageserver'; import { expect } from 'chai'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { YamlCodeActions } from '../src/languageservice/services/yamlCodeActions'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { YamlCodeActions } from '../src/languageservice/services/yamlCodeActions.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; describe('Schema Errors Code Action Tests', () => { diff --git a/test/customTags.test.ts b/test/customTags.test.ts index c5c27cd40..9b09f3e7a 100644 --- a/test/customTags.test.ts +++ b/test/customTags.test.ts @@ -2,13 +2,13 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { setupLanguageService, setupTextDocument } from './utils/testHelper'; -import { ServiceSetup } from './utils/serviceSetup'; -import { createExpectedError } from './utils/verifyError'; +import { setupLanguageService, setupTextDocument } from './utils/testHelper.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; +import { createExpectedError } from './utils/verifyError.ts'; import assert from 'assert'; import { Diagnostic } from 'vscode-languageserver-types'; -import { LanguageService } from '../src/languageservice/yamlLanguageService'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; +import { LanguageService } from '../src/languageservice/yamlLanguageService.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; // Defines a Mocha test describe to group tests of similar kind together describe('Custom Tag tests Tests', () => { diff --git a/test/defaultSnippets.test.ts b/test/defaultSnippets.test.ts index 305a593ca..970468cf1 100644 --- a/test/defaultSnippets.test.ts +++ b/test/defaultSnippets.test.ts @@ -2,12 +2,12 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { toFsPath, setupSchemaIDTextDocument, setupLanguageService, caretPosition } from './utils/testHelper'; +import { toFsPath, setupSchemaIDTextDocument, setupLanguageService, caretPosition } from './utils/testHelper.ts'; import assert from 'assert'; import * as path from 'path'; -import { ServiceSetup } from './utils/serviceSetup'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; +import { ServiceSetup } from './utils/serviceSetup.ts'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; import { CompletionList, TextEdit } from 'vscode-languageserver-types'; import { expect } from 'chai'; diff --git a/test/diagnostic-filter.test.ts b/test/diagnostic-filter.test.ts index 4090d224b..592170ede 100644 --- a/test/diagnostic-filter.test.ts +++ b/test/diagnostic-filter.test.ts @@ -10,7 +10,7 @@ import { parseDisableSpecifiers, shouldSuppressDiagnostic, GetLineText, -} from '../src/languageservice/utils/diagnostic-filter'; +} from '../src/languageservice/utils/diagnostic-filter.ts'; function makeDiag(startLine: number, message: string): { startLine: number; message: string } { return { startLine, message }; diff --git a/test/documentPositionCalculator.test.ts b/test/documentPositionCalculator.test.ts index c4908aad7..bd533796e 100644 --- a/test/documentPositionCalculator.test.ts +++ b/test/documentPositionCalculator.test.ts @@ -2,7 +2,7 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { binarySearch, getLineStartPositions, getPosition } from '../src/languageservice/utils/documentPositionCalculator'; +import { binarySearch, getLineStartPositions, getPosition } from '../src/languageservice/utils/documentPositionCalculator.ts'; import assert from 'assert'; describe('DocumentPositionCalculator Tests', () => { diff --git a/test/documentSymbols.test.ts b/test/documentSymbols.test.ts index dd49f04ed..c952c92e8 100644 --- a/test/documentSymbols.test.ts +++ b/test/documentSymbols.test.ts @@ -2,17 +2,17 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { setupLanguageService, setupTextDocument, TEST_URI } from './utils/testHelper'; +import { setupLanguageService, setupTextDocument, TEST_URI } from './utils/testHelper.ts'; import { createExpectedSymbolInformation, createExpectedDocumentSymbol, createExpectedDocumentSymbolNoDetail, -} from './utils/verifyError'; +} from './utils/verifyError.ts'; import { DocumentSymbol, SymbolKind, SymbolInformation } from 'vscode-languageserver-types'; import assert from 'assert'; -import { ServiceSetup } from './utils/serviceSetup'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; +import { ServiceSetup } from './utils/serviceSetup.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; describe('Document Symbols Tests', () => { let languageHandler: LanguageHandlers; diff --git a/test/findLinks.test.ts b/test/findLinks.test.ts index 16b10865b..0f9f04b4d 100644 --- a/test/findLinks.test.ts +++ b/test/findLinks.test.ts @@ -2,12 +2,12 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { setupLanguageService, setupTextDocument } from './utils/testHelper'; +import { setupLanguageService, setupTextDocument } from './utils/testHelper.ts'; import assert from 'assert'; -import { ServiceSetup } from './utils/serviceSetup'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { DocumentLink } from 'vscode-languageserver-types'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; describe('Find Links Tests', () => { let languageHandler: LanguageHandlers; diff --git a/test/flow-style-rewriter.test.ts b/test/flow-style-rewriter.test.ts index 7cc773755..652f6f4b1 100644 --- a/test/flow-style-rewriter.test.ts +++ b/test/flow-style-rewriter.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { YamlDocuments } from '../src/languageservice/parser/yaml-documents'; -import { FlowStyleRewriter } from '../src/languageservice/utils/flow-style-rewriter'; -import { setupTextDocument } from './utils/testHelper'; +import { YamlDocuments } from '../src/languageservice/parser/yaml-documents.ts'; +import { FlowStyleRewriter } from '../src/languageservice/utils/flow-style-rewriter.ts'; +import { setupTextDocument } from './utils/testHelper.ts'; describe('Flow style rewriter', () => { let writer: FlowStyleRewriter; diff --git a/test/formatter.test.ts b/test/formatter.test.ts index b46291b7f..f93d5658f 100644 --- a/test/formatter.test.ts +++ b/test/formatter.test.ts @@ -5,11 +5,11 @@ import assert from 'assert'; import * as sinon from 'sinon'; import { FormattingOptions, TextEdit } from 'vscode-languageserver-types'; -import { CustomFormatterOptions } from '../src'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { ServiceSetup } from './utils/serviceSetup'; -import { setupLanguageService, setupTextDocument } from './utils/testHelper'; +import { CustomFormatterOptions } from '../src/index.ts'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; +import { setupLanguageService, setupTextDocument } from './utils/testHelper.ts'; type LanguageHandlerWithConnection = { connection: { diff --git a/test/hover.test.ts b/test/hover.test.ts index 673e9ebe2..5ad44e249 100644 --- a/test/hover.test.ts +++ b/test/hover.test.ts @@ -2,20 +2,20 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ServiceSetup } from './utils/serviceSetup'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { caretPosition, SCHEMA_ID, setupLanguageService, setupSchemaIDTextDocument, TestCustomSchemaProvider, -} from './utils/testHelper'; +} from './utils/testHelper.ts'; import assert from 'assert'; import { Hover, MarkupContent, Position } from 'vscode-languageserver-types'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; import { expect } from 'chai'; -import { TestTelemetry } from './utils/testsTypes'; +import { TestTelemetry } from './utils/testsTypes.ts'; describe('Hover Tests', () => { let languageSettingsSetup: ServiceSetup; diff --git a/test/integration.test.ts b/test/integration.test.ts index 1e92c6fea..2e961f25f 100644 --- a/test/integration.test.ts +++ b/test/integration.test.ts @@ -2,13 +2,13 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { setupLanguageService, setupTextDocument } from './utils/testHelper'; +import { setupLanguageService, setupTextDocument } from './utils/testHelper.ts'; import assert from 'assert'; import { Diagnostic, CompletionList, Hover, MarkupContent } from 'vscode-languageserver-types'; -import { ServiceSetup } from './utils/serviceSetup'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; +import { ServiceSetup } from './utils/serviceSetup.ts'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; // Defines a Mocha test describe to group tests of similar kind together describe('Kubernetes Integration Tests', () => { diff --git a/test/invalid-metaschema.test.ts b/test/invalid-metaschema.test.ts index f20b2b206..871d900cd 100644 --- a/test/invalid-metaschema.test.ts +++ b/test/invalid-metaschema.test.ts @@ -5,10 +5,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { Connection, RemoteClient } from 'vscode-languageserver/node'; -import { JSONSchemaSelection } from '../src/languageserver/handlers/schemaSelectionHandlers'; -import { YAMLSchemaService } from '../src/languageservice/services/yamlSchemaService'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { setupSchemaIDTextDocument } from './utils/testHelper'; +import { JSONSchemaSelection } from '../src/languageserver/handlers/schemaSelectionHandlers.ts'; +import { YAMLSchemaService } from '../src/languageservice/services/yamlSchemaService.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { setupSchemaIDTextDocument } from './utils/testHelper.ts'; describe('unexpected meta schema', () => { const sandbox = sinon.createSandbox(); diff --git a/test/jsonParser.test.ts b/test/jsonParser.test.ts index 8d492a707..d5461580d 100644 --- a/test/jsonParser.test.ts +++ b/test/jsonParser.test.ts @@ -5,10 +5,10 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; -import { JSONDocument } from '../src/languageservice/parser/jsonDocument'; -import { getNodeValue } from '../src/languageservice/parser/astNodeUtils'; -import * as JsonSchema from './../src/languageservice/jsonSchema'; -import { ASTNode, ObjectASTNode } from './../src/languageservice/jsonASTTypes'; +import { JSONDocument } from '../src/languageservice/parser/jsonDocument.ts'; +import { getNodeValue } from '../src/languageservice/parser/astNodeUtils.ts'; +import * as JsonSchema from './../src/languageservice/jsonSchema.ts'; +import { ASTNode, ObjectASTNode } from './../src/languageservice/jsonASTTypes.ts'; import { ErrorCode, getLanguageService } from 'vscode-json-languageservice'; import { Diagnostic, TextDocument, Range } from 'vscode-languageserver-types'; diff --git a/test/multipleDocuments.test.ts b/test/multipleDocuments.test.ts index d1c090174..e0fe433dc 100644 --- a/test/multipleDocuments.test.ts +++ b/test/multipleDocuments.test.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as path from 'path'; -import { setupLanguageService, setupTextDocument, toFsPath } from './utils/testHelper'; +import { setupLanguageService, setupTextDocument, toFsPath } from './utils/testHelper.ts'; import assert from 'assert'; -import { ServiceSetup } from './utils/serviceSetup'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { Diagnostic, Hover, MarkupContent } from 'vscode-languageserver-types'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { LanguageService } from '../src/languageservice/yamlLanguageService'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { LanguageService } from '../src/languageservice/yamlLanguageService.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; /** * Setup the schema we are going to use with the language settings diff --git a/test/objects.test.ts b/test/objects.test.ts index 121ebe87a..4d584e330 100644 --- a/test/objects.test.ts +++ b/test/objects.test.ts @@ -2,7 +2,7 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { equals, convertErrorToTelemetryMsg } from '../src/languageservice/utils/objects'; +import { equals, convertErrorToTelemetryMsg } from '../src/languageservice/utils/objects.ts'; import assert from 'assert'; describe('Object Equals Tests', () => { diff --git a/test/paths.test.ts b/test/paths.test.ts index c88154719..23c2ac69c 100644 --- a/test/paths.test.ts +++ b/test/paths.test.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { WorkspaceFolder } from 'vscode-languageserver-protocol'; import { join } from 'path'; -import { relativeToAbsolutePath, isRelativePath, workspaceFoldersChanged } from '../src/languageservice/utils/paths'; +import { relativeToAbsolutePath, isRelativePath, workspaceFoldersChanged } from '../src/languageservice/utils/paths.ts'; import { URI } from 'vscode-uri'; class TestWorkspace { diff --git a/test/schema.test.ts b/test/schema.test.ts index a7efcc6a4..3a4c609ed 100644 --- a/test/schema.test.ts +++ b/test/schema.test.ts @@ -1,14 +1,14 @@ import assert from 'assert'; -import * as parser from '../src/languageservice/parser/yamlParser07'; -import * as SchemaService from '../src/languageservice/services/yamlSchemaService'; -import * as JsonSchema from '../src/languageservice/jsonSchema'; +import * as parser from '../src/languageservice/parser/yamlParser07.ts'; +import * as SchemaService from '../src/languageservice/services/yamlSchemaService.ts'; +import * as JsonSchema from '../src/languageservice/jsonSchema.ts'; import * as url from 'url'; import * as path from 'path'; import { XHRResponse, xhr } from 'request-light'; -import { MODIFICATION_ACTIONS, SchemaDeletions } from '../src/languageservice/services/yamlSchemaService'; -import { EMPTY_SCHEMA_URL, DEFAULT_KUBERNETES_SCHEMA_VERSION } from '../src/languageservice/utils/schemaUrls'; +import { MODIFICATION_ACTIONS, SchemaDeletions } from '../src/languageservice/services/yamlSchemaService.ts'; +import { EMPTY_SCHEMA_URL, DEFAULT_KUBERNETES_SCHEMA_VERSION } from '../src/languageservice/utils/schemaUrls.ts'; import { expect } from 'chai'; -import { ServiceSetup } from './utils/serviceSetup'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { SCHEMA_ID, TestCustomSchemaProvider, @@ -16,14 +16,14 @@ import { setupSchemaIDTextDocument, setupTextDocument, TEST_URI, -} from './utils/testHelper'; -import { LanguageService, SchemaPriority } from '../src'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; +} from './utils/testHelper.ts'; +import { LanguageService, SchemaPriority } from '../src/index.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; import { Diagnostic, MarkupContent, Position } from 'vscode-languageserver-types'; import { LineCounter } from 'yaml'; -import { getSchemaFromModeline } from '../src/languageservice/services/modelineUtil'; -import { getGroupVersionKindFromDocument } from '../src/languageservice/services/k8sSchemaUtil'; +import { getSchemaFromModeline } from '../src/languageservice/services/modelineUtil.ts'; +import { getGroupVersionKindFromDocument } from '../src/languageservice/services/k8sSchemaUtil.ts'; const KUBERNETES_SCHEMA_URL = `https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/${DEFAULT_KUBERNETES_SCHEMA_VERSION}-standalone-strict/all.json`; diff --git a/test/schema2019Validation.test.ts b/test/schema2019Validation.test.ts index ec31d70d1..8ad9ad3c3 100644 --- a/test/schema2019Validation.test.ts +++ b/test/schema2019Validation.test.ts @@ -2,14 +2,14 @@ * Copyright (c) IBM Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SCHEMA_ID, TestCustomSchemaProvider, setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper'; -import { ServiceSetup } from './utils/serviceSetup'; +import { SCHEMA_ID, TestCustomSchemaProvider, setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { Diagnostic } from 'vscode-languageserver-types'; import { expect } from 'chai'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { DEFAULT_KUBERNETES_SCHEMA_VERSION } from '../src/languageservice/utils/schemaUrls'; -import { JSONSchema } from '../src/languageservice/jsonSchema'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { DEFAULT_KUBERNETES_SCHEMA_VERSION } from '../src/languageservice/utils/schemaUrls.ts'; +import { JSONSchema } from '../src/languageservice/jsonSchema.ts'; describe('Validation Tests', () => { let languageSettingsSetup: ServiceSetup; diff --git a/test/schema2020Validation.test.ts b/test/schema2020Validation.test.ts index b94f033ee..4325a5b0a 100644 --- a/test/schema2020Validation.test.ts +++ b/test/schema2020Validation.test.ts @@ -2,14 +2,14 @@ * Copyright (c) IBM Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SCHEMA_ID, TestCustomSchemaProvider, setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper'; -import { ServiceSetup } from './utils/serviceSetup'; +import { SCHEMA_ID, TestCustomSchemaProvider, setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { Diagnostic } from 'vscode-languageserver-types'; import { expect } from 'chai'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { DEFAULT_KUBERNETES_SCHEMA_VERSION } from '../src/languageservice/utils/schemaUrls'; -import { JSONSchema } from '../src/languageservice/jsonSchema'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { DEFAULT_KUBERNETES_SCHEMA_VERSION } from '../src/languageservice/utils/schemaUrls.ts'; +import { JSONSchema } from '../src/languageservice/jsonSchema.ts'; describe('Validation Tests', () => { let languageSettingsSetup: ServiceSetup; diff --git a/test/schemaRequestHandler.test.ts b/test/schemaRequestHandler.test.ts index 6bcdccdd2..751e06146 100644 --- a/test/schemaRequestHandler.test.ts +++ b/test/schemaRequestHandler.test.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { schemaRequestHandler } from '../src/languageservice/services/schemaRequestHandler'; +import { schemaRequestHandler } from '../src/languageservice/services/schemaRequestHandler.ts'; import * as sinon from 'sinon'; import * as request from 'request-light'; import { XHRResponse } from 'request-light'; @@ -14,7 +14,7 @@ import sinonChai from 'sinon-chai'; const expect = chai.expect; chai.use(sinonChai); -import { testFileSystem } from './utils/testHelper'; +import { testFileSystem } from './utils/testHelper.ts'; describe('Schema Request Handler Tests', () => { describe('schemaRequestHandler', () => { diff --git a/test/schemaSelectionHandlers.test.ts b/test/schemaSelectionHandlers.test.ts index 056b7858f..3b1a8cc36 100644 --- a/test/schemaSelectionHandlers.test.ts +++ b/test/schemaSelectionHandlers.test.ts @@ -5,12 +5,12 @@ import * as sinon from 'sinon'; import * as chai from 'chai'; import sinonChai from 'sinon-chai'; -import { JSONSchemaSelection } from '../src/languageserver/handlers/schemaSelectionHandlers'; -import { YAMLSchemaService } from '../src/languageservice/services/yamlSchemaService'; +import { JSONSchemaSelection } from '../src/languageserver/handlers/schemaSelectionHandlers.ts'; +import { YAMLSchemaService } from '../src/languageservice/services/yamlSchemaService.ts'; import { Connection, RemoteClient } from 'vscode-languageserver/node'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { SchemaSelectionRequests } from '../src/requestTypes'; -import { SCHEMA_ID, setupSchemaIDTextDocument } from './utils/testHelper'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { SchemaSelectionRequests } from '../src/requestTypes.ts'; +import { SCHEMA_ID, setupSchemaIDTextDocument } from './utils/testHelper.ts'; const expect = chai.expect; chai.use(sinonChai); diff --git a/test/schemaValidation.test.ts b/test/schemaValidation.test.ts index 03a520f46..fe9a54f4a 100644 --- a/test/schemaValidation.test.ts +++ b/test/schemaValidation.test.ts @@ -2,9 +2,9 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { SCHEMA_ID, TestCustomSchemaProvider, setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper'; -import { createDiagnosticWithData, createExpectedError } from './utils/verifyError'; -import { ServiceSetup } from './utils/serviceSetup'; +import { SCHEMA_ID, TestCustomSchemaProvider, setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper.ts'; +import { createDiagnosticWithData, createExpectedError } from './utils/verifyError.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; import { StringTypeError, BooleanTypeError, @@ -14,19 +14,19 @@ import { DuplicateKeyError, propertyIsNotAllowed, MissingRequiredPropWarning, -} from './utils/errorMessages'; +} from './utils/errorMessages.ts'; import assert from 'assert'; import * as path from 'path'; import { Diagnostic, DiagnosticSeverity, Position } from 'vscode-languageserver-types'; import { expect } from 'chai'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { LanguageService } from '../src/languageservice/yamlLanguageService'; -import { IProblem } from '../src/languageservice/parser/schemaValidation/baseValidator'; -import { JSONSchema } from '../src/languageservice/jsonSchema'; -import { TestTelemetry } from './utils/testsTypes'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { LanguageService } from '../src/languageservice/yamlLanguageService.ts'; +import { IProblem } from '../src/languageservice/parser/schemaValidation/baseValidator.ts'; +import { JSONSchema } from '../src/languageservice/jsonSchema.ts'; +import { TestTelemetry } from './utils/testsTypes.ts'; import { ErrorCode } from 'vscode-json-languageservice'; -import { DEFAULT_KUBERNETES_SCHEMA_VERSION } from '../src/languageservice/utils/schemaUrls'; +import { DEFAULT_KUBERNETES_SCHEMA_VERSION } from '../src/languageservice/utils/schemaUrls.ts'; const KUBERNETES_SCHEMA_URL = `https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/${DEFAULT_KUBERNETES_SCHEMA_VERSION}-standalone-strict/all.json`; diff --git a/test/settingsHandlers.test.ts b/test/settingsHandlers.test.ts index 68f0e9883..27c726108 100644 --- a/test/settingsHandlers.test.ts +++ b/test/settingsHandlers.test.ts @@ -10,14 +10,19 @@ import sinonChai from 'sinon-chai'; import { Connection, RemoteClient, RemoteWorkspace } from 'vscode-languageserver'; import { CodeLensRefreshRequest } from 'vscode-languageserver-protocol'; import { URI } from 'vscode-uri'; -import { LanguageService, LanguageSettings, SchemaConfiguration, SchemaPriority } from '../src'; -import { SettingsHandler } from '../src/languageserver/handlers/settingsHandlers'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { EMPTY_SCHEMA_URL } from '../src/languageservice/utils/schemaUrls'; -import { Telemetry } from '../src/languageservice/telemetry'; -import { SettingsState } from '../src/yamlSettings'; -import { TestCustomSchemaProvider, setupLanguageService, setupSchemaIDTextDocument, setupTextDocument } from './utils/testHelper'; -import { TestWorkspace } from './utils/testsTypes'; +import { LanguageService, LanguageSettings, SchemaConfiguration, SchemaPriority } from '../src/index.ts'; +import { SettingsHandler } from '../src/languageserver/handlers/settingsHandlers.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { EMPTY_SCHEMA_URL } from '../src/languageservice/utils/schemaUrls.ts'; +import { Telemetry } from '../src/languageservice/telemetry.ts'; +import { SettingsState } from '../src/yamlSettings.ts'; +import { + TestCustomSchemaProvider, + setupLanguageService, + setupSchemaIDTextDocument, + setupTextDocument, +} from './utils/testHelper.ts'; +import { TestWorkspace } from './utils/testsTypes.ts'; const expect = chai.expect; chai.use(sinonChai); diff --git a/test/strings.test.ts b/test/strings.test.ts index fc5be71b4..7216d463b 100644 --- a/test/strings.test.ts +++ b/test/strings.test.ts @@ -2,7 +2,7 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { startsWith, endsWith, convertSimple2RegExp, safeCreateUnicodeRegExp } from '../src/languageservice/utils/strings'; +import { startsWith, endsWith, convertSimple2RegExp, safeCreateUnicodeRegExp } from '../src/languageservice/utils/strings.ts'; import assert from 'assert'; import { expect } from 'chai'; diff --git a/test/telemetry.test.ts b/test/telemetry.test.ts index b12d74c34..e94e4d60d 100644 --- a/test/telemetry.test.ts +++ b/test/telemetry.test.ts @@ -5,8 +5,8 @@ import * as sinon from 'sinon'; import sinonChai from 'sinon-chai'; import * as chai from 'chai'; -import { checkSchemaURI } from '../src/languageservice/utils/schemaUrls'; -import { TelemetryImpl } from '../src/languageserver/telemetry'; +import { checkSchemaURI } from '../src/languageservice/utils/schemaUrls.ts'; +import { TelemetryImpl } from '../src/languageserver/telemetry.ts'; import { URI } from 'vscode-uri'; import { Connection } from 'vscode-languageserver'; diff --git a/test/textBuffer.test.ts b/test/textBuffer.test.ts index 385644484..67b887cca 100644 --- a/test/textBuffer.test.ts +++ b/test/textBuffer.test.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { TextBuffer } from '../src/languageservice/utils/textBuffer'; +import { TextBuffer } from '../src/languageservice/utils/textBuffer.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; import assert from 'assert'; diff --git a/test/utils/serviceSetup.ts b/test/utils/serviceSetup.ts index a7bc5d906..cf00d4ce1 100644 --- a/test/utils/serviceSetup.ts +++ b/test/utils/serviceSetup.ts @@ -2,8 +2,8 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LanguageSettings, SchemasSettings } from '../../src/languageservice/yamlLanguageService'; -import { YamlVersion } from '../../src/languageservice/parser/yamlParser07'; +import { LanguageSettings, SchemasSettings } from '../../src/languageservice/yamlLanguageService.ts'; +import { YamlVersion } from '../../src/languageservice/parser/yamlParser07.ts'; export class ServiceSetup { /* diff --git a/test/utils/testHelper.ts b/test/utils/testHelper.ts index 6942830ae..70de7447a 100644 --- a/test/utils/testHelper.ts +++ b/test/utils/testHelper.ts @@ -6,15 +6,15 @@ import { promises as fs } from 'fs'; import { ClientCapabilities } from 'vscode-json-languageservice'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { Connection, createConnection, ClientCapabilities as LSPClientCapabilities } from 'vscode-languageserver/node'; -import { LanguageService, LanguageSettings } from '../../src'; -import { LanguageHandlers } from '../../src/languageserver/handlers/languageHandlers'; -import { ValidationHandler } from '../../src/languageserver/handlers/validationHandlers'; -import { JSONSchema } from '../../src/languageservice/jsonSchema'; -import { yamlDocumentsCache } from '../../src/languageservice/parser/yaml-documents'; -import { FileSystem, schemaRequestHandler, workspaceContext } from '../../src/languageservice/services/schemaRequestHandler'; -import { YAMLServerInit } from '../../src/yamlServerInit'; -import { SettingsState } from '../../src/yamlSettings'; -import { TestTelemetry } from './testsTypes'; +import { LanguageService, LanguageSettings } from '../../src/index.ts'; +import { LanguageHandlers } from '../../src/languageserver/handlers/languageHandlers.ts'; +import { ValidationHandler } from '../../src/languageserver/handlers/validationHandlers.ts'; +import { JSONSchema } from '../../src/languageservice/jsonSchema.ts'; +import { yamlDocumentsCache } from '../../src/languageservice/parser/yaml-documents.ts'; +import { FileSystem, schemaRequestHandler, workspaceContext } from '../../src/languageservice/services/schemaRequestHandler.ts'; +import { YAMLServerInit } from '../../src/yamlServerInit.ts'; +import { SettingsState } from '../../src/yamlSettings.ts'; +import { TestTelemetry } from './testsTypes.ts'; import * as path from 'path'; export function toFsPath(str: unknown): string { diff --git a/test/utils/testsTypes.ts b/test/utils/testsTypes.ts index fbd556b8f..e8c6f74d7 100644 --- a/test/utils/testsTypes.ts +++ b/test/utils/testsTypes.ts @@ -18,8 +18,8 @@ import { ServerCapabilities, } from 'vscode-languageserver-protocol'; import { Connection, RemoteWorkspace } from 'vscode-languageserver'; -import { TelemetryImpl } from '../../src/languageserver/telemetry'; -import { TelemetryEvent } from '../../src/languageservice/telemetry'; +import { TelemetryImpl } from '../../src/languageserver/telemetry.ts'; +import { TelemetryEvent } from '../../src/languageservice/telemetry.ts'; /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unused-vars */ diff --git a/test/yaml-documents.test.ts b/test/yaml-documents.test.ts index 86d3d9059..b892cb0d5 100644 --- a/test/yaml-documents.test.ts +++ b/test/yaml-documents.test.ts @@ -6,12 +6,12 @@ import * as sinon from 'sinon'; import sinonChai from 'sinon-chai'; import * as chai from 'chai'; -import { YamlDocuments } from '../src/languageservice/parser/yaml-documents'; -import { setupTextDocument } from './utils/testHelper'; -import * as yamlParser from '../src/languageservice/parser/yamlParser07'; +import { YamlDocuments } from '../src/languageservice/parser/yaml-documents.ts'; +import { setupTextDocument } from './utils/testHelper.ts'; +import * as yamlParser from '../src/languageservice/parser/yamlParser07.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { isMap, isScalar, isSeq, Pair, Scalar, YAMLMap, YAMLSeq } from 'yaml'; -import { TextBuffer } from '../src/languageservice/utils/textBuffer'; +import { TextBuffer } from '../src/languageservice/utils/textBuffer.ts'; const expect = chai.expect; chai.use(sinonChai); diff --git a/test/yamlCodeActions.test.ts b/test/yamlCodeActions.test.ts index 30cca91e3..4e83187b3 100644 --- a/test/yamlCodeActions.test.ts +++ b/test/yamlCodeActions.test.ts @@ -6,7 +6,7 @@ import * as sinon from 'sinon'; import sinonChai from 'sinon-chai'; import * as chai from 'chai'; -import { YamlCodeActions } from '../src/languageservice/services/yamlCodeActions'; +import { YamlCodeActions } from '../src/languageservice/services/yamlCodeActions.ts'; import { CodeAction, CodeActionContext, @@ -19,10 +19,10 @@ import { WorkspaceEdit, } from 'vscode-languageserver-types'; import { ClientCapabilities, CodeActionParams } from 'vscode-languageserver'; -import { setupTextDocument, TEST_URI } from './utils/testHelper'; -import { createDiagnosticWithData, createExpectedError, createUnusedAnchorDiagnostic } from './utils/verifyError'; -import { YamlCommands } from '../src/commands'; -import { LanguageSettings } from '../src'; +import { setupTextDocument, TEST_URI } from './utils/testHelper.ts'; +import { createDiagnosticWithData, createExpectedError, createUnusedAnchorDiagnostic } from './utils/verifyError.ts'; +import { YamlCommands } from '../src/commands.ts'; +import { LanguageSettings } from '../src/index.ts'; import { ErrorCode } from 'vscode-json-languageservice'; const expect = chai.expect; diff --git a/test/yamlCodeLens.test.ts b/test/yamlCodeLens.test.ts index 65f23ca63..1e4735b23 100644 --- a/test/yamlCodeLens.test.ts +++ b/test/yamlCodeLens.test.ts @@ -5,19 +5,19 @@ import * as sinon from 'sinon'; import sinonChai from 'sinon-chai'; import * as chai from 'chai'; -import { YamlCodeLens } from '../src/languageservice/services/yamlCodeLens'; -import { YAMLSchemaService } from '../src/languageservice/services/yamlSchemaService'; -import { setupTextDocument } from './utils/testHelper'; -import { JSONSchema } from '../src/languageservice/jsonSchema'; +import { YamlCodeLens } from '../src/languageservice/services/yamlCodeLens.ts'; +import { YAMLSchemaService } from '../src/languageservice/services/yamlSchemaService.ts'; +import { setupTextDocument } from './utils/testHelper.ts'; +import { JSONSchema } from '../src/languageservice/jsonSchema.ts'; import { CodeLens, Command, Range } from 'vscode-languageserver-protocol'; import { Connection } from 'vscode-languageserver'; -import { YamlCommands } from '../src/commands'; -import { TelemetryImpl } from '../src/languageserver/telemetry'; -import { Telemetry } from '../src/languageservice/telemetry'; -import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { LanguageService } from '../src/languageservice/yamlLanguageService'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; +import { YamlCommands } from '../src/commands.ts'; +import { TelemetryImpl } from '../src/languageserver/telemetry.ts'; +import { Telemetry } from '../src/languageservice/telemetry.ts'; +import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers.ts'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { LanguageService } from '../src/languageservice/yamlLanguageService.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; const expect = chai.expect; chai.use(sinonChai); diff --git a/test/yamlCommands.test.ts b/test/yamlCommands.test.ts index b0530d453..904821c04 100644 --- a/test/yamlCommands.test.ts +++ b/test/yamlCommands.test.ts @@ -6,8 +6,8 @@ import * as sinon from 'sinon'; import sinonChai from 'sinon-chai'; import * as chai from 'chai'; -import { registerCommands } from '../src/languageservice/services/yamlCommands'; -import { commandExecutor } from '../src/languageserver/commandExecutor'; +import { registerCommands } from '../src/languageservice/services/yamlCommands.ts'; +import { commandExecutor } from '../src/languageserver/commandExecutor.ts'; import { Connection } from 'vscode-languageserver'; import { URI } from 'vscode-uri'; diff --git a/test/yamlDefinition.test.ts b/test/yamlDefinition.test.ts index 9a80dca87..ae6560759 100644 --- a/test/yamlDefinition.test.ts +++ b/test/yamlDefinition.test.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { setupTextDocument, TEST_URI } from './utils/testHelper'; +import { setupTextDocument, TEST_URI } from './utils/testHelper.ts'; import { expect } from 'chai'; -import { YamlDefinition } from '../src/languageservice/services/yamlDefinition'; +import { YamlDefinition } from '../src/languageservice/services/yamlDefinition.ts'; import { LocationLink, Position, Range } from 'vscode-languageserver-types'; -import { Telemetry } from '../src/languageservice/telemetry'; +import { Telemetry } from '../src/languageservice/telemetry.ts'; describe('YAML Definition', () => { it('should not provide definition for non anchor node', () => { diff --git a/test/yamlFolding.test.ts b/test/yamlFolding.test.ts index a3f6f30c5..51e39a8cf 100644 --- a/test/yamlFolding.test.ts +++ b/test/yamlFolding.test.ts @@ -5,9 +5,9 @@ import { expect } from 'chai'; import { FoldingRange } from 'vscode-languageserver-types'; -import { getFoldingRanges } from '../src/languageservice/services/yamlFolding'; -import { FoldingRangesContext } from '../src/languageservice/yamlTypes'; -import { setupTextDocument, TEST_URI } from './utils/testHelper'; +import { getFoldingRanges } from '../src/languageservice/services/yamlFolding.ts'; +import { FoldingRangesContext } from '../src/languageservice/yamlTypes.ts'; +import { setupTextDocument, TEST_URI } from './utils/testHelper.ts'; const context: FoldingRangesContext = { rangeLimit: 10_0000 }; diff --git a/test/yamlLanguageService.test.ts b/test/yamlLanguageService.test.ts index 1806a4c49..d007fe30e 100644 --- a/test/yamlLanguageService.test.ts +++ b/test/yamlLanguageService.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { assert } from 'chai'; import { Position, TextDocument } from 'vscode-languageserver-textdocument'; -import { getLanguageService, LanguageService, SchemaRequestService, WorkspaceContextService } from '../src'; -import { workspaceContext } from '../src/languageservice/services/schemaRequestHandler'; -import { caretPosition, setupSchemaIDTextDocument } from './utils/testHelper'; +import { getLanguageService, LanguageService, SchemaRequestService, WorkspaceContextService } from '../src/index.ts'; +import { workspaceContext } from '../src/languageservice/services/schemaRequestHandler.ts'; +import { caretPosition, setupSchemaIDTextDocument } from './utils/testHelper.ts'; /** * Builds a simple schema request service diff --git a/test/yamlOnTypeFormatting.test.ts b/test/yamlOnTypeFormatting.test.ts index cc4e846be..20932b3f0 100644 --- a/test/yamlOnTypeFormatting.test.ts +++ b/test/yamlOnTypeFormatting.test.ts @@ -5,8 +5,8 @@ import { expect } from 'chai'; import { DocumentOnTypeFormattingParams } from 'vscode-languageserver-protocol'; import { FormattingOptions, Position, Range, TextEdit } from 'vscode-languageserver-types'; -import { doDocumentOnTypeFormatting } from '../src/languageservice/services/yamlOnTypeFormatting'; -import { setupTextDocument } from './utils/testHelper'; +import { doDocumentOnTypeFormatting } from '../src/languageservice/services/yamlOnTypeFormatting.ts'; +import { setupTextDocument } from './utils/testHelper.ts'; function createParams(position: Position): DocumentOnTypeFormattingParams { return { diff --git a/test/yamlParser.test.ts b/test/yamlParser.test.ts index c5c1dc565..03e6963e4 100644 --- a/test/yamlParser.test.ts +++ b/test/yamlParser.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import assert from 'assert'; import { expect } from 'chai'; -import { ArrayASTNode, ObjectASTNode, PropertyASTNode } from '../src/languageservice/jsonASTTypes'; -import { parse, YAMLDocument } from './../src/languageservice/parser/yamlParser07'; -import { aliasDepth } from '../src/languageservice/parser/ast-converter'; +import { ArrayASTNode, ObjectASTNode, PropertyASTNode } from '../src/languageservice/jsonASTTypes.ts'; +import { parse, YAMLDocument } from './../src/languageservice/parser/yamlParser07.ts'; +import { aliasDepth } from '../src/languageservice/parser/ast-converter.ts'; describe('YAML parser', () => { describe('YAML parser', function () { diff --git a/test/yamlRename.test.ts b/test/yamlRename.test.ts index c9be25234..9de3fdec7 100644 --- a/test/yamlRename.test.ts +++ b/test/yamlRename.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { Position, TextEdit } from 'vscode-languageserver-types'; -import { setupLanguageService, setupTextDocument, TEST_URI } from './utils/testHelper'; +import { setupLanguageService, setupTextDocument, TEST_URI } from './utils/testHelper.ts'; import { TextDocument } from 'vscode-languageserver-textdocument'; function applyEdits(document: TextDocument, edits: TextEdit[]): string { diff --git a/test/yamlSchema.test.ts b/test/yamlSchema.test.ts index d5f1b51ab..eb3b81cbf 100644 --- a/test/yamlSchema.test.ts +++ b/test/yamlSchema.test.ts @@ -2,7 +2,7 @@ * Copyright (c) Red Hat. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as SchemaService from '../src/languageservice/services/yamlSchemaService'; +import * as SchemaService from '../src/languageservice/services/yamlSchemaService.ts'; import * as url from 'url'; import * as sinon from 'sinon'; import * as chai from 'chai'; diff --git a/test/yamlSchemaService.test.ts b/test/yamlSchemaService.test.ts index 4be583ba0..9aa26b2a2 100644 --- a/test/yamlSchemaService.test.ts +++ b/test/yamlSchemaService.test.ts @@ -7,10 +7,10 @@ import * as chai from 'chai'; import sinonChai from 'sinon-chai'; import * as path from 'path'; import * as url from 'url'; -import * as SchemaService from '../src/languageservice/services/yamlSchemaService'; -import { parse } from '../src/languageservice/parser/yamlParser07'; -import { SettingsState } from '../src/yamlSettings'; -import { DEFAULT_KUBERNETES_SCHEMA_VERSION, getSchemaUrls } from '../src/languageservice/utils/schemaUrls'; +import * as SchemaService from '../src/languageservice/services/yamlSchemaService.ts'; +import { parse } from '../src/languageservice/parser/yamlParser07.ts'; +import { SettingsState } from '../src/yamlSettings.ts'; +import { DEFAULT_KUBERNETES_SCHEMA_VERSION, getSchemaUrls } from '../src/languageservice/utils/schemaUrls.ts'; const BASE_KUBERNETES_SCHEMA_URL = `https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/${DEFAULT_KUBERNETES_SCHEMA_VERSION}-standalone-strict/`; const KUBERNETES_SCHEMA_URL = BASE_KUBERNETES_SCHEMA_URL + 'all.json'; diff --git a/test/yamlSelectionRanges.test.ts b/test/yamlSelectionRanges.test.ts index 3fffe2b5d..737fe1809 100644 --- a/test/yamlSelectionRanges.test.ts +++ b/test/yamlSelectionRanges.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { Position, Range, SelectionRange } from 'vscode-languageserver-types'; -import { setupTextDocument } from './utils/testHelper'; -import { getSelectionRanges } from '../src/languageservice/services/yamlSelectionRanges'; +import { setupTextDocument } from './utils/testHelper.ts'; +import { getSelectionRanges } from '../src/languageservice/services/yamlSelectionRanges.ts'; function isRangesEqual(range1: Range, range2: Range): boolean { return ( diff --git a/test/yamlValidation.test.ts b/test/yamlValidation.test.ts index 2cb683d35..0970eee70 100644 --- a/test/yamlValidation.test.ts +++ b/test/yamlValidation.test.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Diagnostic, DiagnosticSeverity } from 'vscode-languageserver-types'; -import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers'; -import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings'; -import { ServiceSetup } from './utils/serviceSetup'; -import { setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper'; +import { ValidationHandler } from '../src/languageserver/handlers/validationHandlers.ts'; +import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings.ts'; +import { ServiceSetup } from './utils/serviceSetup.ts'; +import { setupLanguageService, setupSchemaIDTextDocument } from './utils/testHelper.ts'; import { expect } from 'chai'; import * as sinon from 'sinon'; -import { createExpectedError, createUnusedAnchorDiagnostic } from './utils/verifyError'; +import { createExpectedError, createUnusedAnchorDiagnostic } from './utils/verifyError.ts'; type ValidationHandlerWithConnection = { connection: { diff --git a/tsconfig.json b/tsconfig.json index c138cce25..6678f9b0b 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": false, "noImplicitThis": false, "outDir": "./out/server", + "rewriteRelativeImportExtensions": true, "skipLibCheck": true, "sourceMap": true, "strictFunctionTypes": false,