import { TextDocuments , Disposable , ClientCapabilities , WorkspaceFolder } from 'vscode-languageserver/node' ; import { CustomFormatterOptions , SchemaConfiguration } from './languageservice/yamlLanguageService' ; import { ISchemaAssociations } from './requestTypes' ; import { URI } from 'vscode-uri' ; import { JSONSchema } from './languageservice/jsonSchema' ; import { TextDocument } from 'vscode-languageserver-textdocument' ; import { JSON_SCHEMASTORE_URL } from './languageservice/utils/schemaUrls' ; import { YamlVersion } from './languageservice/parser/yamlParser07' ; export interface Settings { yaml : { format : CustomFormatterOptions ; schemas : JSONSchemaSettings [ ] ; validate : boolean ; hover : boolean ; completion : boolean ; customTags : Array < string > ; schemaStore : { url : string ; enable : boolean ; } ; disableDefaultProperties : boolean ; disableAdditionalProperties : boolean ; maxItemsComputed : number ; yamlVersion : YamlVersion ; } ; http : { proxy : string ; proxyStrictSSL : boolean ; } ; yamlEditor : { 'editor.tabSize' : number ; 'editor.insertSpaces' : boolean ; 'editor.formatOnType' : boolean ; } ; } export interface JSONSchemaSettings { fileMatch ? : string [ ] ; url ? : string ; schema ? : JSONSchema ; } export class SettingsState { yamlConfigurationSettings : JSONSchemaSettings [ ] = undefined ; schemaAssociations : ISchemaAssociations | SchemaConfiguration [ ] | undefined = undefined ; formatterRegistration : Thenable < Disposable > = null ; specificValidatorPaths = [ ] ; schemaConfigurationSettings = [ ] ; yamlShouldValidate = true ; yamlFormatterSettings = { singleQuote : false , bracketSpacing : true , proseWrap : 'preserve' , printWidth : 80 , enable : true , } as CustomFormatterOptions ; yamlShouldHover = true ; yamlShouldCompletion = true ; schemaStoreSettings = [ ] ; customTags = [ ] ; schemaStoreEnabled = true ; schemaStoreUrl = JSON_SCHEMASTORE_URL ; indentation : string | undefined = undefined ; disableAdditionalProperties = false ; disableDefaultProperties = false ; maxItemsComputed = 5000 ; pendingValidationRequests : { [ uri ] : NodeJS . Timer ; } = { } ; validationDelayMs = 200 ; documents : TextDocuments < TextDocument > | TextDocumentTestManager = new TextDocuments ( TextDocument ) ; capabilities : ClientCapabilities ; workspaceRoot : URI = null ; workspaceFolders : WorkspaceFolder [ ] = [ ] ; clientDynamicRegisterSupport = false ; hierarchicalDocumentSymbolSupport = false ; hasWorkspaceFolderCapability = false ; hasConfigurationCapability = false ; useVSCodeContentRequest = false ; yamlVersion : YamlVersion = '1.2' ; useSchemaSelectionRequests = false ; hasWsChangeWatchedFileDynamicRegistration = false ; } export class TextDocumentTestManager extends TextDocuments < TextDocument > { testTextDocuments = new Map < string , TextDocument > ( ) ; constructor ( ) { super ( TextDocument ) ; } get ( uri ) { return this . testTextDocuments . get ( uri ) ; } set ( textDocument ) { this . testTextDocuments . set ( textDocument . uri , textDocument ) ; } }