@@ -13,10 +13,12 @@ import {
1313 expectText ,
1414 openFileInWorkspaceAsync ,
1515} from './integrationHelpers' ;
16+ import { CSharpExtensionExports } from '../../../src/csharpExtensionExports' ;
1617
1718describe ( `Code Actions Tests` , ( ) => {
19+ let csharpExports : CSharpExtensionExports | undefined = undefined ;
1820 beforeAll ( async ( ) => {
19- await activateCSharpExtension ( ) ;
21+ csharpExports = await activateCSharpExtension ( ) ;
2022 } ) ;
2123
2224 beforeEach ( async ( ) => {
@@ -34,7 +36,11 @@ describe(`Code Actions Tests`, () => {
3436
3537 test ( 'Lightbulb displays actions' , async ( ) => {
3638 console . log ( 'LIGHTBULB TEST' ) ;
39+ csharpExports ! . experimental . outputChannel . appendLine ( 'Lightbulb displays actions' ) ;
40+ csharpExports ! . experimental . traceChannel . appendLine ( 'Lightbulb displays actions' ) ;
3741 const actions = await getCodeActions ( new vscode . Range ( 0 , 0 , 0 , 12 ) ) ;
42+ csharpExports ! . experimental . traceChannel . appendLine ( `Got actions ${ actions . length } ` ) ;
43+ csharpExports ! . experimental . traceChannel . appendLine ( JSON . stringify ( actions , null , 4 ) ) ;
3844 expect ( actions . length ) . toBeGreaterThanOrEqual ( 3 ) ;
3945 console . log ( actions . length ) ;
4046 console . log ( actions . map ( ( a ) => a . title ) . join ( ', ' ) ) ;
@@ -314,22 +320,18 @@ async function getCodeActions(
314320 range : vscode . Range ,
315321 resolveCount : number | undefined = undefined
316322) : Promise < vscode . CodeAction [ ] > {
323+ const uri = vscode . window . activeTextEditor ! . document . uri ;
324+ console . log ( `Getting actions for ${ uri . toString ( ) } ` ) ;
317325 const codeActions = await vscode . commands . executeCommand < vscode . CodeAction [ ] > (
318326 'vscode.executeCodeActionProvider' ,
319- vscode . window . activeTextEditor ! . document . uri ,
327+ uri ,
320328 range ,
321329 /** kind **/ undefined ,
322330 resolveCount
323331 ) ;
324332
325333 console . log ( JSON . stringify ( codeActions , null , 4 ) ) ;
326334
327- const moreAction = codeActions . find ( ( a ) => a . title === 'More...' ) ;
328- if ( moreAction ) {
329- console . log ( 'More actions available' ) ;
330- console . log ( JSON . stringify ( moreAction , null , 4 ) ) ;
331- }
332-
333335 return codeActions ;
334336}
335337
0 commit comments