File tree Expand file tree Collapse file tree 3 files changed +2
-23
lines changed Expand file tree Collapse file tree 3 files changed +2
-23
lines changed Original file line number Diff line number Diff line change 56
56
{
57
57
"id" : " npm" ,
58
58
"name" : " %view.name%" ,
59
- "when" : " npm:showScriptExplorer" ,
60
59
"icon" : " images/code.svg" ,
61
60
"visibility" : " hidden"
62
61
}
237
236
"type" : " boolean" ,
238
237
"default" : false ,
239
238
"scope" : " resource" ,
239
+ "deprecationMessage" : " The NPM Script Explorer is now available in the 'Views' menu in the Explorer in all folders." ,
240
240
"description" : " %config.npm.enableScriptExplorer%"
241
241
},
242
242
"npm.enableRunFromFolder" : {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import * as vscode from 'vscode';
8
8
import { addJSONProviders } from './features/jsonContributions' ;
9
9
import { runSelectedScript , selectAndRunScriptFromFolder } from './commands' ;
10
10
import { NpmScriptsTreeDataProvider } from './npmView' ;
11
- import { invalidateTasksCache , NpmTaskProvider , hasPackageJson } from './tasks' ;
11
+ import { invalidateTasksCache , NpmTaskProvider } from './tasks' ;
12
12
import { invalidateHoverScriptsCache , NpmScriptHoverProvider } from './scriptHover' ;
13
13
14
14
let treeDataProvider : NpmScriptsTreeDataProvider | undefined ;
@@ -44,11 +44,6 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
44
44
registerHoverProvider ( context ) ;
45
45
46
46
context . subscriptions . push ( vscode . commands . registerCommand ( 'npm.runSelectedScript' , runSelectedScript ) ) ;
47
-
48
- if ( await hasPackageJson ( ) ) {
49
- vscode . commands . executeCommand ( 'setContext' , 'npm:showScriptExplorer' , true ) ;
50
- }
51
-
52
47
context . subscriptions . push ( vscode . commands . registerCommand ( 'npm.runScriptFromFolder' , selectAndRunScriptFromFolder ) ) ;
53
48
}
54
49
Original file line number Diff line number Diff line change @@ -311,22 +311,6 @@ export function getPackageJsonUriFromTask(task: Task): Uri | null {
311
311
return null ;
312
312
}
313
313
314
- export async function hasPackageJson ( ) : Promise < boolean > {
315
- let folders = workspace . workspaceFolders ;
316
- if ( ! folders ) {
317
- return false ;
318
- }
319
- for ( const folder of folders ) {
320
- if ( folder . uri . scheme === 'file' ) {
321
- let packageJson = path . join ( folder . uri . fsPath , 'package.json' ) ;
322
- if ( await exists ( packageJson ) ) {
323
- return true ;
324
- }
325
- }
326
- }
327
- return false ;
328
- }
329
-
330
314
async function exists ( file : string ) : Promise < boolean > {
331
315
return new Promise < boolean > ( ( resolve , _reject ) => {
332
316
fs . exists ( file , ( value ) => {
You can’t perform that action at this time.
0 commit comments