fix table designer error when sql project has folders (#19667)

* fix table designer error when sql project has folders

* filter on .sql file extension

* compare lowercase

* add back EntryType.File filter
This commit is contained in:
Kim Santiago
2022-06-07 15:59:36 -07:00
committed by GitHub
parent d95fe113e4
commit 487b3450bb

View File

@@ -20,6 +20,7 @@ import { GenerateProjectFromOpenApiSpecOptions, ItemType } from 'sqldbproj';
import { TableFileNode } from '../models/tree/fileFolderTreeItem';
import { ProjectRootTreeItem } from '../models/tree/projectTreeItem';
import { getAzdataApi } from '../common/utils';
import { EntryType } from '../models/projectEntry';
/**
* The main controller class that initializes the extension
@@ -102,7 +103,8 @@ export default class MainController implements vscode.Disposable {
isNewTable: false,
tableScriptPath: filePath,
projectFilePath: projectPath,
allScripts: projectNode.project.files.map(entry => entry.fsUri.fsPath),
allScripts: projectNode.project.files.filter(entry => entry.type === EntryType.File && path.extname(entry.fsUri.fsPath).toLowerCase() === constants.sqlFileExtension)
.map(entry => entry.fsUri.fsPath),
targetVersion: targetVersion
}, {
'ProjectTargetVersion': targetVersion