Skip to content

Commit

Permalink
Use description field as thread stopped status. fixes #13049 (#13050)
Browse files Browse the repository at this point in the history
If thread Stopped event contains description field, UI must show description as is


Co-authored-by: Andrey Ovsyankin <ovsa@1c.ru>
  • Loading branch information
EvilBeaver and Andrey Ovsyankin authored Nov 13, 2023
1 parent 6d1feca commit 7ac24b7
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions packages/debug/src/browser/model/debug-thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,22 +229,35 @@ export class DebugThread extends DebugThreadData implements TreeElement {
}

render(): React.ReactNode {
const reason = this.stoppedDetails && this.stoppedDetails.reason;
const localizedReason = this.getLocalizedReason(reason);

const status = this.stoppedDetails
? reason
? nls.localizeByDefault('Paused on {0}', localizedReason)
: nls.localizeByDefault('Paused')
: nls.localizeByDefault('Running');
return (
<div className="theia-debug-thread" title={nls.localizeByDefault('Session')}>
<span className="label">{this.raw.name}</span>
<span className="status">{status}</span>
<span className="status">{this.threadStatus()}</span>
</div>
);
}

protected threadStatus(): string {

if (!this.stoppedDetails) {
return nls.localizeByDefault('Running');
}

const description = this.stoppedDetails.description;

if (description) {
// According to DAP we must show description as is. Translation is made by debug adapter
return description;
}

const reason = this.stoppedDetails.reason;
const localizedReason = this.getLocalizedReason(reason);

return reason
? nls.localizeByDefault('Paused on {0}', localizedReason)
: nls.localizeByDefault('Paused');
}

protected getLocalizedReason(reason: string | undefined): string {
switch (reason) {
case 'step':
Expand All @@ -269,5 +282,4 @@ export class DebugThread extends DebugThreadData implements TreeElement {
return '';
}
}

}

0 comments on commit 7ac24b7

Please sign in to comment.