Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use description field as thread stopped status. fixes #13049 #13050

Merged
merged 2 commits into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 '';
}
}

}
Loading