mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
Adding option to open referenced project from SQL Project reference item (#23178)
* Adding hook to open a referenced SQL project * cleanup * adding docstring
This commit is contained in:
@@ -10,6 +10,7 @@ import * as constants from '../../common/constants';
|
||||
import { BaseProjectTreeItem } from './baseTreeItem';
|
||||
import { IconPathHelper } from '../../common/iconHelper';
|
||||
import { IDatabaseReferenceProjectEntry } from 'sqldbproj';
|
||||
import { SqlProjectReferenceProjectEntry } from '../projectEntry';
|
||||
|
||||
/**
|
||||
* Folder for containing references nodes in the tree
|
||||
@@ -35,7 +36,9 @@ export class DatabaseReferencesTreeItem extends BaseProjectTreeItem {
|
||||
}
|
||||
|
||||
for (const reference of databaseReferences) {
|
||||
this.references.push(new DatabaseReferenceTreeItem(reference, this.relativeProjectUri, this.projectFileUri));
|
||||
this.references.push(reference instanceof SqlProjectReferenceProjectEntry
|
||||
? new SqlProjectReferenceTreeItem(reference, this.relativeProjectUri, this.projectFileUri)
|
||||
: new DatabaseReferenceTreeItem(reference, this.relativeProjectUri, this.projectFileUri));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +60,7 @@ export class DatabaseReferencesTreeItem extends BaseProjectTreeItem {
|
||||
}
|
||||
|
||||
export class DatabaseReferenceTreeItem extends BaseProjectTreeItem {
|
||||
constructor(private reference: IDatabaseReferenceProjectEntry, referencesNodeRelativeProjectUri: vscode.Uri, sqlprojUri: vscode.Uri) {
|
||||
constructor(public readonly reference: IDatabaseReferenceProjectEntry, referencesNodeRelativeProjectUri: vscode.Uri, sqlprojUri: vscode.Uri) {
|
||||
super(vscode.Uri.file(path.join(referencesNodeRelativeProjectUri.fsPath, reference.referenceName)), sqlprojUri);
|
||||
this.entryKey = this.friendlyName;
|
||||
}
|
||||
@@ -79,3 +82,9 @@ export class DatabaseReferenceTreeItem extends BaseProjectTreeItem {
|
||||
return refItem;
|
||||
}
|
||||
}
|
||||
|
||||
export class SqlProjectReferenceTreeItem extends DatabaseReferenceTreeItem {
|
||||
public override get type(): constants.DatabaseProjectItemType {
|
||||
return constants.DatabaseProjectItemType.sqlProjectReference;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user