Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
10 changes: 5 additions & 5 deletions src/languageserver/handlers/languageHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
10 changes: 5 additions & 5 deletions src/languageserver/handlers/notificationHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/languageserver/handlers/requestHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/languageserver/handlers/schemaSelectionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 8 additions & 8 deletions src/languageserver/handlers/settingsHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/languageserver/handlers/validationHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/languageserver/handlers/workspaceHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { ExecuteCommandParams, Connection } from 'vscode-languageserver';
import { CommandExecutor } from '../commandExecutor';
import { CommandExecutor } from '../commandExecutor.ts';

export class WorkspaceHandlers {
constructor(
Expand Down
4 changes: 2 additions & 2 deletions src/languageserver/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
2 changes: 1 addition & 1 deletion src/languageservice/jsonASTTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/languageservice/jsonSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/languageservice/parser/ast-converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -29,7 +29,7 @@ import {
NumberASTNodeImpl,
ArrayASTNodeImpl,
BooleanASTNodeImpl,
} from './jsonDocument';
} from './jsonDocument.ts';

type NodeRange = [number, number, number];

Expand Down
2 changes: 1 addition & 1 deletion src/languageservice/parser/astNodeUtils.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/languageservice/parser/custom-tag-provider.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/languageservice/parser/isKubernetes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions src/languageservice/parser/jsonDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
Expand Down
20 changes: 10 additions & 10 deletions src/languageservice/parser/schemaValidation/baseValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: ';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
18 changes: 9 additions & 9 deletions src/languageservice/parser/yaml-documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading