Skip to content

Commit

Permalink
feat: semantic highlight
Browse files Browse the repository at this point in the history
Ref: arduino/vscode-arduino-tools#43
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Dec 15, 2023
1 parent 73b6dc4 commit 541c65f
Show file tree
Hide file tree
Showing 5 changed files with 574 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ import { DebugSessionWidget } from '@theia/debug/lib/browser/view/debug-session-
import { DebugConfigurationWidget } from './theia/debug/debug-configuration-widget';
import { DebugConfigurationWidget as TheiaDebugConfigurationWidget } from '@theia/debug/lib/browser/view/debug-configuration-widget';
import { DebugToolBar } from '@theia/debug/lib/browser/view/debug-toolbar-widget';
import { InoHighlight } from './contributions/ino-highlight';

// Hack to fix copy/cut/paste issue after electron version update in Theia.
// https://github.com/eclipse-theia/theia/issues/12487
Expand Down Expand Up @@ -767,6 +768,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
Contribution.configure(bind, UpdateArduinoState);
Contribution.configure(bind, BoardsDataMenuUpdater);
Contribution.configure(bind, AutoSelectProgrammer);
Contribution.configure(bind, InoHighlight);

bindContributionProvider(bind, StartupTaskProvider);
bind(StartupTaskProvider).toService(BoardsServiceProvider); // to reuse the boards config in another window
Expand Down
4 changes: 2 additions & 2 deletions arduino-ide-extension/src/browser/contributions/format.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { MaybePromise } from '@theia/core';
import { inject, injectable } from '@theia/core/shared/inversify';
import * as monaco from '@theia/monaco-editor-core';
import { Formatter } from '../../common/protocol/formatter';
Expand All @@ -15,13 +14,14 @@ export class Format
@inject(Formatter)
private readonly formatter: Formatter;

override onStart(): MaybePromise<void> {
override onStart(): void {
monaco.languages.registerDocumentRangeFormattingEditProvider(
InoSelector,
this
);
monaco.languages.registerDocumentFormattingEditProvider(InoSelector, this);
}

async provideDocumentRangeFormattingEdits(
model: monaco.editor.ITextModel,
range: monaco.Range,
Expand Down
Loading

0 comments on commit 541c65f

Please sign in to comment.