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

12972+ Localized debug step PAUSED ON #12973

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Changes from 2 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
45 changes: 39 additions & 6 deletions packages/debug/src/browser/model/debug-thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// *****************************************************************************

import * as React from '@theia/core/shared/react';
import { CancellationTokenSource, Emitter, Event } from '@theia/core';
import { CancellationTokenSource, Emitter, Event, nls } from '@theia/core';
import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol';
import { TreeElement } from '@theia/core/lib/browser/source-tree';
import { DebugStackFrame } from './debug-stack-frame';
Expand Down Expand Up @@ -230,11 +230,44 @@ export class DebugThread extends DebugThreadData implements TreeElement {

render(): React.ReactNode {
const reason = this.stoppedDetails && this.stoppedDetails.reason;
const status = this.stoppedDetails ? reason ? `Paused on ${reason}` : 'Paused' : 'Running';
return <div className='theia-debug-thread' title='Thread'>
<span className='label'>{this.raw.name}</span>
<span className='status'>{status}</span>
</div>;
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="Thread">
msujew marked this conversation as resolved.
Show resolved Hide resolved
<span className="label">{this.raw.name}</span>
<span className="status">{status}</span>
</div>
);
}

private getlocalizedReason(reason: string | undefined): string {
msujew marked this conversation as resolved.
Show resolved Hide resolved
switch (reason) {
case 'step':
return nls.localize('theia/debug/step', 'step');
case 'breakpoint':
return nls.localize('theia/debug/breakpoint', 'breakpoint');
case 'breakpoint':
return nls.localize('theia/debug/exception', 'exception');
case 'breakpoint':
return nls.localize('theia/debug/pause', 'pause');
case 'breakpoint':
return nls.localize('theia/debug/entry', 'entry');
case 'breakpoint':
return nls.localize('theia/debug/goto', 'goto');
case 'breakpoint':
return nls.localize('theia/debug/function breakpoint', 'function breakpoint');
msujew marked this conversation as resolved.
Show resolved Hide resolved
case 'breakpoint':
return nls.localize('theia/debug/data breakpoint', 'data breakpoint');
case 'breakpoint':
return nls.localize('theia/debug/instruction breakpoint', 'instruction breakpoint');
msujew marked this conversation as resolved.
Show resolved Hide resolved
default:
return '';
}
}

}
Loading