Skip to content

Commit

Permalink
Open Panel other than SQL files
Browse files Browse the repository at this point in the history
  • Loading branch information
toukoudo committed Oct 21, 2024
1 parent f596081 commit 1d359c0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/treeview_provider/modelTreeviewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ abstract class ModelTreeviewProvider
if (element) {
return Promise.resolve(this.getTreeItems(element.key, event));
}
const fileName = path.basename(
const fileName = path.parse(
window.activeTextEditor!.document.fileName,
".sql",
);
).name;
const model = event.nodeMetaMap.lookupByBaseName(fileName);
if (!model) {
return Promise.resolve([]);
Expand Down Expand Up @@ -222,10 +221,9 @@ class DocumentationTreeviewProvider implements TreeDataProvider<DocTreeItem> {
const { nodeMetaMap } = event;

if (!element) {
const modelName = path.basename(
const modelName = path.parse(
window.activeTextEditor!.document.fileName,
".sql",
);
).name;
const currentNode = nodeMetaMap.lookupByBaseName(modelName);
if (currentNode === undefined) {
return Promise.resolve([]);
Expand Down

0 comments on commit 1d359c0

Please sign in to comment.