Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 204d71b

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Fixed highlighting of non-unicode chars in Output
Closes #1210 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 5cb9166 commit 204d71b

File tree

3 files changed

+34
-18
lines changed

3 files changed

+34
-18
lines changed

‎arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ import { WorkspaceDeleteHandler } from './theia/workspace/workspace-delete-handl
141141
import { TabBarToolbar } from './theia/core/tab-bar-toolbar';
142142
import { EditorWidgetFactory as TheiaEditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory';
143143
import { EditorWidgetFactory } from './theia/editor/editor-widget-factory';
144-
import { OutputWidget as TheiaOutputWidget } from '@theia/output/lib/browser/output-widget';
145-
import { OutputWidget } from './theia/output/output-widget';
146144
import { BurnBootloader } from './contributions/burn-bootloader';
147145
import {
148146
ExamplesServicePath,
@@ -215,7 +213,10 @@ import { SearchInWorkspaceFactory } from './theia/search-in-workspace/search-in-
215213
import { SearchInWorkspaceResultTreeWidget as TheiaSearchInWorkspaceResultTreeWidget } from '@theia/search-in-workspace/lib/browser/search-in-workspace-result-tree-widget';
216214
import { SearchInWorkspaceResultTreeWidget } from './theia/search-in-workspace/search-in-workspace-result-tree-widget';
217215
import { MonacoEditorProvider } from './theia/monaco/monaco-editor-provider';
218-
import { MonacoEditorProvider as TheiaMonacoEditorProvider } from '@theia/monaco/lib/browser/monaco-editor-provider';
216+
import {
217+
MonacoEditorFactory,
218+
MonacoEditorProvider as TheiaMonacoEditorProvider,
219+
} from '@theia/monaco/lib/browser/monaco-editor-provider';
219220
import { StorageWrapper } from './storage-wrapper';
220221
import { NotificationManager } from './theia/messages/notifications-manager';
221222
import { NotificationManager as TheiaNotificationManager } from '@theia/messages/lib/browser/notifications-manager';
@@ -332,6 +333,7 @@ import {
332333
LibraryFilterRenderer,
333334
} from './widgets/component-list/filter-renderer';
334335
import { CheckForUpdates } from './contributions/check-for-updates';
336+
import { OutputEditorFactory } from './theia/output/output-editor-factory';
335337

336338
const registerArduinoThemes = () => {
337339
const themes: MonacoThemeJson[] = [
@@ -587,8 +589,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
587589
return container.get(TabBarToolbar);
588590
}
589591
);
590-
bind(OutputWidget).toSelf().inSingletonScope();
591-
rebind(TheiaOutputWidget).toService(OutputWidget);
592592
bind(OutputChannelManager).toSelf().inSingletonScope();
593593
rebind(TheiaOutputChannelManager).toService(OutputChannelManager);
594594
bind(OutputChannelRegistryMainImpl).toSelf().inTransientScope();
@@ -657,6 +657,11 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
657657
bind(EditorMenuContribution).toSelf().inSingletonScope();
658658
rebind(TheiaEditorMenuContribution).toService(EditorMenuContribution);
659659

660+
// To disable the highlighting of non-unicode characters in the _Output_ view
661+
bind(OutputEditorFactory).toSelf().inSingletonScope();
662+
// Rebind to `TheiaOutputEditorFactory` when https://github.com/eclipse-theia/theia/pull/11615 is available.
663+
rebind(MonacoEditorFactory).toService(OutputEditorFactory);
664+
660665
bind(ArduinoDaemon)
661666
.toDynamicValue((context) =>
662667
WebSocketConnectionProvider.createProxy(
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { injectable } from '@theia/core/shared/inversify';
2+
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
3+
import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model';
4+
import { OutputEditorFactory as TheiaOutputEditorFactory } from '@theia/output/lib/browser/output-editor-factory';
5+
6+
@injectable()
7+
export class OutputEditorFactory extends TheiaOutputEditorFactory {
8+
protected override createOptions(
9+
model: MonacoEditorModel,
10+
defaultOptions: MonacoEditor.IOptions
11+
): MonacoEditor.IOptions {
12+
const options = super.createOptions(model, defaultOptions);
13+
return {
14+
...options,
15+
// Taken from https://github.com/microsoft/vscode/blob/35b971c92d210face8c446a1c6f1e470ad2bcb54/src/vs/workbench/contrib/output/browser/outputView.ts#L211-L214
16+
// To fix https://github.com/arduino/arduino-ide/issues/1210
17+
unicodeHighlight: {
18+
nonBasicASCII: false,
19+
invisibleCharacters: false,
20+
ambiguousCharacters: false,
21+
},
22+
};
23+
}
24+
}

‎arduino-ide-extension/src/browser/theia/output/output-widget.ts‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /