mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-10 18:59:28 +00:00
Compare commits
2 Commits
dependabot
...
temporary-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad6df0d9e4 | ||
|
|
93d27ea72a |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -322,7 +322,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
if: runner.name != 'WINDOWS-SIGN-PC'
|
if: runner.name != 'WINDOWS-SIGN-PC'
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
@@ -456,7 +456,7 @@ jobs:
|
|||||||
name: ${{ env.STAGED_CHANNEL_FILE_ARTIFACT_PREFIX }}*
|
name: ${{ env.STAGED_CHANNEL_FILE_ARTIFACT_PREFIX }}*
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|||||||
2
.github/workflows/check-i18n-task.yml
vendored
2
.github/workflows/check-i18n-task.yml
vendored
@@ -59,7 +59,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install Node.js 18.17
|
- name: Install Node.js 18.17
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18.17'
|
node-version: '18.17'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|||||||
2
.github/workflows/check-javascript.yml
vendored
2
.github/workflows/check-javascript.yml
vendored
@@ -68,7 +68,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: yarn
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
|||||||
2
.github/workflows/check-yarn.yml
vendored
2
.github/workflows/check-yarn.yml
vendored
@@ -67,7 +67,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: yarn
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
|||||||
2
.github/workflows/compose-full-changelog.yml
vendored
2
.github/workflows/compose-full-changelog.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|||||||
2
.github/workflows/i18n-nightly-push.yml
vendored
2
.github/workflows/i18n-nightly-push.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install Node.js 18.17
|
- name: Install Node.js 18.17
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18.17'
|
node-version: '18.17'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|||||||
2
.github/workflows/i18n-weekly-pull.yml
vendored
2
.github/workflows/i18n-weekly-pull.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install Node.js 18.17
|
- name: Install Node.js 18.17
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18.17'
|
node-version: '18.17'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|||||||
2
.github/workflows/test-javascript.yml
vendored
2
.github/workflows/test-javascript.yml
vendored
@@ -85,7 +85,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: yarn
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
|||||||
2
.github/workflows/themes-weekly-pull.yml
vendored
2
.github/workflows/themes-weekly-pull.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export class ConfigServiceClient implements FrontendApplicationContribution {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onStart(): void {
|
onStart(): void {
|
||||||
|
console.log('just a test');
|
||||||
this.notificationCenter.onConfigDidChange((config) => this.use(config));
|
this.notificationCenter.onConfigDidChange((config) => this.use(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,3 +67,7 @@ export function truncateLines(
|
|||||||
}
|
}
|
||||||
return [lines, charCount];
|
return [lines, charCount];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function joinLines(lines: Line[]): string {
|
||||||
|
return lines.map((line: Line) => line.message).join('');
|
||||||
|
}
|
||||||
@@ -52,6 +52,9 @@ export namespace SerialMonitor {
|
|||||||
},
|
},
|
||||||
'vscode/output.contribution/clearOutput.label'
|
'vscode/output.contribution/clearOutput.label'
|
||||||
);
|
);
|
||||||
|
export const COPY_OUTPUT = {
|
||||||
|
id: 'serial-monitor-copy-output',
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,6 +152,12 @@ export class MonitorViewContribution
|
|||||||
'Clear Output'
|
'Clear Output'
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
registry.registerItem({
|
||||||
|
id: SerialMonitor.Commands.COPY_OUTPUT.id,
|
||||||
|
command: SerialMonitor.Commands.COPY_OUTPUT.id,
|
||||||
|
icon: codicon('copy'),
|
||||||
|
tooltip: nls.localize('arduino/serial/copyOutput', 'Copy Output'),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
override registerCommands(commands: CommandRegistry): void {
|
override registerCommands(commands: CommandRegistry): void {
|
||||||
@@ -161,6 +170,15 @@ export class MonitorViewContribution
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
commands.registerCommand(SerialMonitor.Commands.COPY_OUTPUT, {
|
||||||
|
isEnabled: (widget) => widget instanceof MonitorWidget,
|
||||||
|
isVisible: (widget) => widget instanceof MonitorWidget,
|
||||||
|
execute: (widget) => {
|
||||||
|
if (widget instanceof MonitorWidget) {
|
||||||
|
widget.copyOutput();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
if (this.toggleCommand) {
|
if (this.toggleCommand) {
|
||||||
commands.registerCommand(this.toggleCommand, {
|
commands.registerCommand(this.toggleCommand, {
|
||||||
execute: () => this.toggle(),
|
execute: () => this.toggle(),
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import {
|
|||||||
import { MonitorModel } from '../../monitor-model';
|
import { MonitorModel } from '../../monitor-model';
|
||||||
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
||||||
import { serialMonitorWidgetLabel } from '../../../common/nls';
|
import { serialMonitorWidgetLabel } from '../../../common/nls';
|
||||||
|
import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class MonitorWidget extends ReactWidget {
|
export class MonitorWidget extends ReactWidget {
|
||||||
@@ -47,6 +48,7 @@ export class MonitorWidget extends ReactWidget {
|
|||||||
*/
|
*/
|
||||||
protected closing = false;
|
protected closing = false;
|
||||||
protected readonly clearOutputEmitter = new Emitter<void>();
|
protected readonly clearOutputEmitter = new Emitter<void>();
|
||||||
|
protected readonly copyOutputEmitter = new Emitter<void>();
|
||||||
|
|
||||||
@inject(MonitorModel)
|
@inject(MonitorModel)
|
||||||
private readonly monitorModel: MonitorModel;
|
private readonly monitorModel: MonitorModel;
|
||||||
@@ -56,6 +58,8 @@ export class MonitorWidget extends ReactWidget {
|
|||||||
private readonly boardsServiceProvider: BoardsServiceProvider;
|
private readonly boardsServiceProvider: BoardsServiceProvider;
|
||||||
@inject(FrontendApplicationStateService)
|
@inject(FrontendApplicationStateService)
|
||||||
private readonly appStateService: FrontendApplicationStateService;
|
private readonly appStateService: FrontendApplicationStateService;
|
||||||
|
@inject(ClipboardService)
|
||||||
|
private readonly clipboardService: ClipboardService;
|
||||||
|
|
||||||
private readonly toDisposeOnReset: DisposableCollection;
|
private readonly toDisposeOnReset: DisposableCollection;
|
||||||
|
|
||||||
@@ -102,6 +106,10 @@ export class MonitorWidget extends ReactWidget {
|
|||||||
this.clearOutputEmitter.fire(undefined);
|
this.clearOutputEmitter.fire(undefined);
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copyOutput(): void {
|
||||||
|
this.copyOutputEmitter.fire();
|
||||||
|
}
|
||||||
|
|
||||||
override dispose(): void {
|
override dispose(): void {
|
||||||
this.toDisposeOnReset.dispose();
|
this.toDisposeOnReset.dispose();
|
||||||
@@ -247,6 +255,8 @@ export class MonitorWidget extends ReactWidget {
|
|||||||
monitorModel={this.monitorModel}
|
monitorModel={this.monitorModel}
|
||||||
monitorManagerProxy={this.monitorManagerProxy}
|
monitorManagerProxy={this.monitorManagerProxy}
|
||||||
clearConsoleEvent={this.clearOutputEmitter.event}
|
clearConsoleEvent={this.clearOutputEmitter.event}
|
||||||
|
copyOutputEvent={this.copyOutputEmitter.event}
|
||||||
|
clipboardService={this.clipboardService}
|
||||||
height={Math.floor(this.widgetHeight - 50)}
|
height={Math.floor(this.widgetHeight - 50)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ import { Event } from '@theia/core/lib/common/event';
|
|||||||
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
||||||
import { areEqual, FixedSizeList as List } from 'react-window';
|
import { areEqual, FixedSizeList as List } from 'react-window';
|
||||||
import dateFormat from 'dateformat';
|
import dateFormat from 'dateformat';
|
||||||
import { messagesToLines, truncateLines } from './monitor-utils';
|
import { messagesToLines, truncateLines, joinLines } from './monitor-utils';
|
||||||
import { MonitorManagerProxyClient } from '../../../common/protocol';
|
import { MonitorManagerProxyClient } from '../../../common/protocol';
|
||||||
import { MonitorModel } from '../../monitor-model';
|
import { MonitorModel } from '../../monitor-model';
|
||||||
|
import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
|
||||||
|
|
||||||
export type Line = { message: string; timestamp?: Date; lineLen: number };
|
export type Line = { message: string; timestamp?: Date; lineLen: number };
|
||||||
|
|
||||||
@@ -74,6 +75,9 @@ export class SerialMonitorOutput extends React.Component<
|
|||||||
this.props.clearConsoleEvent(() =>
|
this.props.clearConsoleEvent(() =>
|
||||||
this.setState({ lines: [], charCount: 0 })
|
this.setState({ lines: [], charCount: 0 })
|
||||||
),
|
),
|
||||||
|
this.props.copyOutputEvent(() =>
|
||||||
|
this.props.clipboardService.writeText(joinLines(this.state.lines))
|
||||||
|
),
|
||||||
this.props.monitorModel.onChange(({ property }) => {
|
this.props.monitorModel.onChange(({ property }) => {
|
||||||
if (property === 'timestamp') {
|
if (property === 'timestamp') {
|
||||||
const { timestamp } = this.props.monitorModel;
|
const { timestamp } = this.props.monitorModel;
|
||||||
@@ -130,6 +134,8 @@ export namespace SerialMonitorOutput {
|
|||||||
readonly monitorModel: MonitorModel;
|
readonly monitorModel: MonitorModel;
|
||||||
readonly monitorManagerProxy: MonitorManagerProxyClient;
|
readonly monitorManagerProxy: MonitorManagerProxyClient;
|
||||||
readonly clearConsoleEvent: Event<void>;
|
readonly clearConsoleEvent: Event<void>;
|
||||||
|
readonly copyOutputEvent: Event<void>;
|
||||||
|
readonly clipboardService: ClipboardService;
|
||||||
readonly height: number;
|
readonly height: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { expect } from 'chai';
|
|||||||
import {
|
import {
|
||||||
messagesToLines,
|
messagesToLines,
|
||||||
truncateLines,
|
truncateLines,
|
||||||
|
joinLines,
|
||||||
} from '../../browser/serial/monitor/monitor-utils';
|
} from '../../browser/serial/monitor/monitor-utils';
|
||||||
import { Line } from '../../browser/serial/monitor/serial-monitor-send-output';
|
import { Line } from '../../browser/serial/monitor/serial-monitor-send-output';
|
||||||
import { set, reset } from 'mockdate';
|
import { set, reset } from 'mockdate';
|
||||||
@@ -15,6 +16,7 @@ type TestLine = {
|
|||||||
charCount: number;
|
charCount: number;
|
||||||
maxCharacters?: number;
|
maxCharacters?: number;
|
||||||
};
|
};
|
||||||
|
expectedJoined?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
@@ -22,6 +24,7 @@ const testLines: TestLine[] = [
|
|||||||
{
|
{
|
||||||
messages: ['Hello'],
|
messages: ['Hello'],
|
||||||
expected: { lines: [{ message: 'Hello', lineLen: 5 }], charCount: 5 },
|
expected: { lines: [{ message: 'Hello', lineLen: 5 }], charCount: 5 },
|
||||||
|
expectedJoined: 'Hello',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
messages: ['Hello', 'Dog!'],
|
messages: ['Hello', 'Dog!'],
|
||||||
@@ -36,6 +39,7 @@ const testLines: TestLine[] = [
|
|||||||
],
|
],
|
||||||
charCount: 10,
|
charCount: 10,
|
||||||
},
|
},
|
||||||
|
expectedJoined: 'Hello\nDog!'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
messages: ['Dog!'],
|
messages: ['Dog!'],
|
||||||
@@ -67,6 +71,7 @@ const testLines: TestLine[] = [
|
|||||||
{ message: "You're a good boy!", lineLen: 8 },
|
{ message: "You're a good boy!", lineLen: 8 },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
expectedJoined: "Hello Dog!\n Who's a good boy?\nYou're a good boy!",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
messages: ['boy?\n', "You're a good boy!"],
|
messages: ['boy?\n', "You're a good boy!"],
|
||||||
@@ -116,6 +121,7 @@ const testLines: TestLine[] = [
|
|||||||
{ message: 'Yo', lineLen: 2 },
|
{ message: 'Yo', lineLen: 2 },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
expectedJoined: "Hello Dog!\nWho's a good boy?\nYo",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -165,6 +171,10 @@ describe('Monitor Utils', () => {
|
|||||||
});
|
});
|
||||||
expect(totalCharCount).to.equal(charCount);
|
expect(totalCharCount).to.equal(charCount);
|
||||||
}
|
}
|
||||||
|
if (testLine.expectedJoined) {
|
||||||
|
const joined_str = joinLines(testLine.expected.lines);
|
||||||
|
expect(joined_str).to.equal(testLine.expectedJoined);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -435,6 +435,7 @@
|
|||||||
"autoscroll": "Autoscroll",
|
"autoscroll": "Autoscroll",
|
||||||
"carriageReturn": "Carriage Return",
|
"carriageReturn": "Carriage Return",
|
||||||
"connecting": "Connecting to '{0}' on '{1}'...",
|
"connecting": "Connecting to '{0}' on '{1}'...",
|
||||||
|
"copyOutput": "Copy Output",
|
||||||
"message": "Message (Enter to send message to '{0}' on '{1}')",
|
"message": "Message (Enter to send message to '{0}' on '{1}')",
|
||||||
"newLine": "New Line",
|
"newLine": "New Line",
|
||||||
"newLineCarriageReturn": "Both NL & CR",
|
"newLineCarriageReturn": "Both NL & CR",
|
||||||
|
|||||||
Reference in New Issue
Block a user