File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,7 @@ export async function activate(): Promise<void> {
228
228
] ;
229
229
codeActionProvider = vscode . languages . registerCodeActionsProvider ( selector , {
230
230
provideCodeActions : async ( document : vscode . TextDocument , range : vscode . Range , context : vscode . CodeActionContext ) : Promise < vscode . CodeAction [ ] > => {
231
+
231
232
if ( ! await clients . ActiveClient . getVcpkgEnabled ( ) ) {
232
233
return [ ] ;
233
234
}
@@ -237,13 +238,17 @@ export async function activate(): Promise<void> {
237
238
return [ ] ;
238
239
}
239
240
241
+ const ports : string [ ] = await lookupIncludeInVcpkg ( document , range . start . line ) ;
242
+ if ( ports . length <= 0 ) {
243
+ return [ ] ;
244
+ }
245
+
240
246
telemetry . logLanguageServerEvent ( 'codeActionsProvided' , { "source" : "vcpkg" } ) ;
241
247
242
248
if ( ! await clients . ActiveClient . getVcpkgInstalled ( ) ) {
243
249
return [ getVcpkgHelpAction ( ) ] ;
244
250
}
245
251
246
- const ports : string [ ] = await lookupIncludeInVcpkg ( document , range . start . line ) ;
247
252
const actions : vscode . CodeAction [ ] = ports . map < vscode . CodeAction > ( getVcpkgClipboardInstallAction ) ;
248
253
return actions ;
249
254
}
You can’t perform that action at this time.
0 commit comments