@@ -23,7 +23,7 @@ import { YAMLHover } from './services/yamlHover';
2323import { YAMLValidation } from './services/yamlValidation' ;
2424import { YAMLFormatter } from './services/yamlFormatter' ;
2525// eslint-disable-next-line @typescript-eslint/no-unused-vars
26- import { JSONWorkerContribution , JSONDocument , DefinitionLink } from 'vscode-json-languageservice' ;
26+ import { JSONDocument , DefinitionLink } from 'vscode-json-languageservice' ;
2727import { findLinks } from './services/yamlLinks' ;
2828
2929export interface LanguageSettings {
@@ -41,56 +41,6 @@ export interface LanguageSettings {
4141 indentation ?: string ;
4242}
4343
44- export interface PromiseConstructor {
45- /**
46- * Creates a new Promise.
47- * @param executor A callback used to initialize the promise. This callback is passed two arguments:
48- * a resolve callback used resolve the promise with a value or the result of another promise,
49- * and a reject callback used to reject the promise with a provided reason or error.
50- */
51- // eslint-disable-next-line @typescript-eslint/no-explicit-any
52- new < T > ( executor : ( resolve : ( value ?: T | Thenable < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Thenable < T > ;
53-
54- /**
55- * Creates a Promise that is resolved with an array of results when all of the provided Promises
56- * resolve, or rejected when any Promise is rejected.
57- * @param values An array of Promises.
58- * @returns A new Promise.
59- */
60- all < T > ( values : Array < T | Thenable < T > > ) : Thenable < T [ ] > ;
61- /**
62- * Creates a new rejected promise for the provided reason.
63- * @param reason The reason the promise was rejected.
64- * @returns A new rejected Promise.
65- */
66- // eslint-disable-next-line @typescript-eslint/no-explicit-any
67- reject < T > ( reason : any ) : Thenable < T > ;
68-
69- /**
70- * Creates a new resolved promise for the provided value.
71- * @param value A promise.
72- * @returns A promise whose internal state matches the provided promise.
73- */
74- resolve < T > ( value : T | Thenable < T > ) : Thenable < T > ;
75- }
76-
77- export interface Thenable < R > {
78- /**
79- * Attaches callbacks for the resolution and/or rejection of the Promise.
80- * @param onfulfilled The callback to execute when the Promise is resolved.
81- * @param onrejected The callback to execute when the Promise is rejected.
82- * @returns A Promise for the completion of which ever callback is executed.
83- */
84- // eslint-disable-next-line @typescript-eslint/no-explicit-any
85- then < TResult > (
86- onfulfilled ?: ( value : R ) => TResult | Thenable < TResult > ,
87- // eslint-disable-next-line @typescript-eslint/no-explicit-any
88- onrejected ?: ( reason : any ) => TResult | Thenable < TResult >
89- ) : Thenable < TResult > ;
90- // eslint-disable-next-line @typescript-eslint/no-explicit-any
91- then < TResult > ( onfulfilled ?: ( value : R ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => void ) : Thenable < TResult > ;
92- }
93-
9444export interface WorkspaceContextService {
9545 resolveRelativePath ( relativePath : string , resource : string ) : string ;
9646}
@@ -99,7 +49,7 @@ export interface WorkspaceContextService {
9949 * in case of an error, a displayable error string
10050 */
10151export interface SchemaRequestService {
102- ( uri : string ) : Thenable < string > ;
52+ ( uri : string ) : Promise < string > ;
10353}
10454
10555export interface SchemaConfiguration {
@@ -129,13 +79,13 @@ export interface CustomFormatterOptions {
12979export interface LanguageService {
13080 configure ( settings : LanguageSettings ) : void ;
13181 registerCustomSchemaProvider ( schemaProvider : CustomSchemaProvider ) : void ;
132- doComplete ( document : TextDocument , position : Position , isKubernetes : boolean ) : Thenable < CompletionList > ;
133- doValidation ( document : TextDocument , isKubernetes : boolean ) : Thenable < Diagnostic [ ] > ;
134- doHover ( document : TextDocument , position : Position ) : Thenable < Hover | null > ;
82+ doComplete ( document : TextDocument , position : Position , isKubernetes : boolean ) : Promise < CompletionList > ;
83+ doValidation ( document : TextDocument , isKubernetes : boolean ) : Promise < Diagnostic [ ] > ;
84+ doHover ( document : TextDocument , position : Position ) : Promise < Hover | null > ;
13585 findDocumentSymbols ( document : TextDocument ) : SymbolInformation [ ] ;
13686 findDocumentSymbols2 ( document : TextDocument ) : DocumentSymbol [ ] ;
137- findDefinition ( document : TextDocument , position : Position , doc : JSONDocument ) : Thenable < DefinitionLink [ ] > ;
138- findLinks ( document : TextDocument ) : Thenable < DocumentLink [ ] > ;
87+ findDefinition ( document : TextDocument , position : Position , doc : JSONDocument ) : Promise < DefinitionLink [ ] > ;
88+ findLinks ( document : TextDocument ) : Promise < DocumentLink [ ] > ;
13989 resetSchema ( uri : string ) : boolean ;
14090 doFormat ( document : TextDocument , options : CustomFormatterOptions ) : TextEdit [ ] ;
14191 addSchema ( schemaID : string , schema : JSONSchema ) : void ;
0 commit comments