File tree Expand file tree Collapse file tree 4 files changed +10
-12
lines changed
Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 3939 "activationEvents" : [
4040 " previewDocSidebar"
4141 ],
42- "files" : [
43- " dist"
44- ],
4542 "icon" : " ./assets/images/icon.png" ,
4643 "main" : " ./dist/extension.js" ,
4744 "contributes" : {
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ type Dependency = {
1111export const getProjectDependencies = async ( ) : Promise < Dependency [ ] > => {
1212 const dependencies : Dependency [ ] = [ ] ;
1313 const packageJsonPath = `${ getProjectDirectory ( ) } /package.json` ;
14-
15- if ( ! existsSync ( packageJsonPath ) ) {
16- vscode . window . showErrorMessage ( 'Cannot find package.json!' ) ;
14+ const dir = vscode . workspace . workspaceFolders ?. [ 0 ] ?. uri ;
15+ const dirContent = dir && await vscode . workspace . fs . readDirectory ( dir ) ;
16+ if ( ! existsSync ( packageJsonPath ) && dirContent ?. length ) {
17+ vscode . window . showErrorMessage ( `Cannot find package.json!` ) ;
1718 return [ ] ;
1819 } else {
1920 const packageJSON = await readPackageJSON ( packageJsonPath ) ;
You can’t perform that action at this time.
0 commit comments