File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,23 @@ describe('Tests for schema provider feature', () => {
134134 }
135135 ]
136136 } ) ;
137+ } ) ;
138+
139+ it ( 'Multiple contributors with one throwing an error' , async ( ) => {
140+ const client = await activate ( docUri ) ;
141+ client . _customSchemaContributors = { } ;
142+ client . registerContributor ( SCHEMA2 , onRequestSchema2URI , onRequestSchema2Content ) ;
143+ client . registerContributor ( "schemathrowingerror" , onRequestSchemaURIThrowError , onRequestSchemaContentThrowError ) ;
144+
145+ await testCompletion ( docUri , new vscode . Position ( 0 , 0 ) , {
146+ items : [
147+ {
148+ label : "apple" ,
149+ kind : 9 ,
150+ documentation : "An apple"
151+ }
152+ ]
153+ } ) ;
137154 } ) ;
138155} ) ;
139156
@@ -165,6 +182,14 @@ function onRequestSchema1Content(schemaUri: string): string | undefined {
165182 return schemaJSON ;
166183}
167184
185+ function onRequestSchemaURIThrowError ( resource : string ) : string | undefined {
186+ throw new Error ( 'test what happens when an error is thrown and not caught' ) ;
187+ }
188+
189+ function onRequestSchemaContentThrowError ( schemaUri : string ) : string | undefined {
190+ throw new Error ( 'test what happens when an error is thrown and not caught' ) ;
191+ }
192+
168193const schemaJSON2 = JSON . stringify ( {
169194 "type" : "object" ,
170195 "properties" : {
You can’t perform that action at this time.
0 commit comments