@@ -23,7 +23,7 @@ import { YAMLHover } from './services/yamlHover';
23
23
import { YAMLValidation } from './services/yamlValidation' ;
24
24
import { YAMLFormatter } from './services/yamlFormatter' ;
25
25
// 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' ;
27
27
import { findLinks } from './services/yamlLinks' ;
28
28
29
29
export interface LanguageSettings {
@@ -41,56 +41,6 @@ export interface LanguageSettings {
41
41
indentation ?: string ;
42
42
}
43
43
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
-
94
44
export interface WorkspaceContextService {
95
45
resolveRelativePath ( relativePath : string , resource : string ) : string ;
96
46
}
@@ -99,7 +49,7 @@ export interface WorkspaceContextService {
99
49
* in case of an error, a displayable error string
100
50
*/
101
51
export interface SchemaRequestService {
102
- ( uri : string ) : Thenable < string > ;
52
+ ( uri : string ) : Promise < string > ;
103
53
}
104
54
105
55
export interface SchemaConfiguration {
@@ -129,13 +79,13 @@ export interface CustomFormatterOptions {
129
79
export interface LanguageService {
130
80
configure ( settings : LanguageSettings ) : void ;
131
81
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 > ;
135
85
findDocumentSymbols ( document : TextDocument ) : SymbolInformation [ ] ;
136
86
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 [ ] > ;
139
89
resetSchema ( uri : string ) : boolean ;
140
90
doFormat ( document : TextDocument , options : CustomFormatterOptions ) : TextEdit [ ] ;
141
91
addSchema ( schemaID : string , schema : JSONSchema ) : void ;
0 commit comments