mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-01 01:20:31 -04:00
Merge from vscode 2cd495805cf99b31b6926f08ff4348124b2cf73d
This commit is contained in:
committed by
AzureDataStudio
parent
a8a7559229
commit
1388493cc1
@@ -310,7 +310,7 @@ class SessionTreeItem extends BaseTreeItem {
|
||||
return 999;
|
||||
}
|
||||
|
||||
addPath(source: Source): void {
|
||||
async addPath(source: Source): Promise<void> {
|
||||
|
||||
let folder: IWorkspaceFolder | null;
|
||||
let url: string;
|
||||
@@ -347,9 +347,8 @@ class SessionTreeItem extends BaseTreeItem {
|
||||
} else {
|
||||
// on unix try to tildify absolute paths
|
||||
path = normalize(path);
|
||||
const userHome = this._pathService.resolvedUserHome;
|
||||
if (userHome && !isWindows) {
|
||||
path = tildify(path, userHome.fsPath);
|
||||
if (!isWindows) {
|
||||
path = tildify(path, (await this._pathService.userHome()).fsPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -518,27 +517,28 @@ export class LoadedScriptsView extends ViewPane {
|
||||
}
|
||||
};
|
||||
|
||||
const addSourcePathsToSession = (session: IDebugSession) => {
|
||||
const addSourcePathsToSession = async (session: IDebugSession) => {
|
||||
const sessionNode = root.add(session);
|
||||
return session.getLoadedSources().then(paths => {
|
||||
paths.forEach(path => sessionNode.addPath(path));
|
||||
scheduleRefreshOnVisible();
|
||||
});
|
||||
const paths = await session.getLoadedSources();
|
||||
for (const path of paths) {
|
||||
await sessionNode.addPath(path);
|
||||
}
|
||||
scheduleRefreshOnVisible();
|
||||
};
|
||||
|
||||
const registerSessionListeners = (session: IDebugSession) => {
|
||||
this._register(session.onDidChangeName(() => {
|
||||
this._register(session.onDidChangeName(async () => {
|
||||
// Re-add session, this will trigger proper sorting and id recalculation.
|
||||
root.remove(session.getId());
|
||||
addSourcePathsToSession(session);
|
||||
await addSourcePathsToSession(session);
|
||||
}));
|
||||
this._register(session.onDidLoadedSource(event => {
|
||||
this._register(session.onDidLoadedSource(async event => {
|
||||
let sessionRoot: SessionTreeItem;
|
||||
switch (event.reason) {
|
||||
case 'new':
|
||||
case 'changed':
|
||||
sessionRoot = root.add(session);
|
||||
sessionRoot.addPath(event.source);
|
||||
await sessionRoot.addPath(event.source);
|
||||
scheduleRefreshOnVisible();
|
||||
if (event.reason === 'changed') {
|
||||
DebugContentProvider.refreshDebugContent(event.source.uri);
|
||||
|
||||
Reference in New Issue
Block a user