File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Nodejs/Product/Nodejs/Workspace Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1111using Microsoft . NodejsTools . NpmUI ;
1212using Microsoft . VisualStudio ;
1313using Microsoft . VisualStudio . OLE . Interop ;
14+ using Microsoft . VisualStudio . Shell ;
1415using Microsoft . VisualStudio . Workspace ;
1516using Microsoft . VisualStudio . Workspace . Debug ;
1617using Microsoft . VisualStudio . Workspace . VSIntegration . UI ;
1718using Microsoft . VisualStudioTools . Project ;
19+ using ShellInterop = Microsoft . VisualStudio . Shell . Interop ;
1820
1921namespace Microsoft . NodejsTools . Workspace
2022{
@@ -166,6 +168,11 @@ private async void ExecDebugAsync(WorkspaceVisualNodeBase node)
166168 var workspace = node . Workspace ;
167169 var packageJson = PackageJsonFactory . Create ( ( ( IFileNode ) node ) . FullPath ) ;
168170
171+ if ( string . IsNullOrEmpty ( packageJson . Main ) )
172+ {
173+ return ;
174+ }
175+
169176 //invoke debuglaunchtargetprovider on this file
170177 var fileContextActions = await node . Workspace . GetFileContextActionsAsync ( packageJson . Main , new [ ] { DebugLaunchActionContext . ContextTypeGuid } ) ;
171178 if ( fileContextActions . Any ( ) )
Original file line number Diff line number Diff line change @@ -43,13 +43,16 @@ protected override Task<List<FileReferenceInfo>> ComputeFileReferencesAsync(stri
4343
4444 var packageJson = PackageJsonFactory . Create ( filePath ) ;
4545 var main = packageJson . Main ;
46- var fileReferences = new List < FileReferenceInfo >
46+
47+ var fileReferences = new List < FileReferenceInfo > ( ) ;
48+
49+ if ( ! string . IsNullOrEmpty ( main ) )
4750 {
48- new FileReferenceInfo ( main ,
49- context : "Debug" ,
50- target : main ,
51- referenceType : ( int ) FileReferenceInfoType . Output )
52- } ;
51+ fileReferences . Add ( new FileReferenceInfo ( main ,
52+ context : "Debug" ,
53+ target : main ,
54+ referenceType : ( int ) FileReferenceInfoType . Output ) ) ;
55+ }
5356
5457 return Task . FromResult ( fileReferences ) ;
5558 }
You can’t perform that action at this time.
0 commit comments