@@ -12,7 +12,7 @@ import {
1212import { visit , JSONVisitor } from 'jsonc-parser' ;
1313import {
1414 NpmTaskDefinition , getPackageJsonUriFromTask , getScripts ,
15- isWorkspaceFolder , getTaskName , createTask , extractDebugArgFromScript , startDebugging
15+ isWorkspaceFolder , getTaskName , createTask , extractDebugArgFromScript , startDebugging , isAutoDetectionEnabled
1616} from './tasks' ;
1717import * as nls from 'vscode-nls' ;
1818
@@ -119,8 +119,8 @@ class NpmScript extends TreeItem {
119119}
120120
121121class NoScripts extends TreeItem {
122- constructor ( ) {
123- super ( localize ( 'noScripts' , 'No scripts found' ) , TreeItemCollapsibleState . None ) ;
122+ constructor ( message : string ) {
123+ super ( message , TreeItemCollapsibleState . None ) ;
124124 this . contextValue = 'noscripts' ;
125125 }
126126}
@@ -260,7 +260,11 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider<TreeItem> {
260260 if ( taskItems ) {
261261 this . taskTree = this . buildTaskTree ( taskItems ) ;
262262 if ( this . taskTree . length === 0 ) {
263- this . taskTree = [ new NoScripts ( ) ] ;
263+ let message = localize ( 'noScripts' , 'No scripts found.' ) ;
264+ if ( ! isAutoDetectionEnabled ( ) ) {
265+ message = localize ( 'autoDetectIsOff' , 'The setting "npm.autoDetect" is "off".' ) ;
266+ }
267+ this . taskTree = [ new NoScripts ( message ) ] ;
264268 }
265269 }
266270 }
0 commit comments