fixed save-as. added sketchload

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2020-07-30 19:58:14 +02:00
parent 528f4150d3
commit 8ab70f48f8
19 changed files with 360 additions and 114 deletions

View File

@@ -17,7 +17,9 @@ export class EditorManager extends TheiaEditorManager {
const { editor } = widget;
if (editor instanceof MonacoEditor) {
const codeEditor = editor.getControl();
codeEditor.updateOptions({ readOnly });
const lineNumbersMinChars = 2;
const overviewRulerLanes = 0;
codeEditor.updateOptions({ readOnly, lineNumbersMinChars, overviewRulerLanes });
}
}
return widget;

View File

@@ -7,7 +7,6 @@ import { ApplicationServer } from '@theia/core/lib/common/application-protocol';
import { FrontendApplication } from '@theia/core/lib/browser/frontend-application';
import { FocusTracker, Widget } from '@theia/core/lib/browser';
import { WorkspaceService as TheiaWorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
import { EditorMode } from '../../editor-mode';
import { ConfigService } from '../../../common/protocol/config-service';
import { SketchesService } from '../../../common/protocol/sketches-service';
import { ArduinoWorkspaceRootResolver } from '../../arduino-workspace-resolver';
@@ -24,9 +23,6 @@ export class WorkspaceService extends TheiaWorkspaceService {
@inject(LabelProvider)
protected readonly labelProvider: LabelProvider;
@inject(EditorMode)
protected readonly editorMode: EditorMode;
@inject(MessageService)
protected readonly messageService: MessageService;
@@ -82,13 +78,7 @@ export class WorkspaceService extends TheiaWorkspaceService {
if (!exists) {
return false;
}
// The workspace root location must exist. However, when opening a workspace root in pro-mode,
// the workspace root must not be a sketch folder. It can be the default sketch directory, or any other directories, for instance.
if (this.editorMode.proMode) {
return true;
}
const sketchFolder = await this.sketchService.isSketchFolder(uri);
return sketchFolder;
return this.sketchService.isSketchFolder(uri);
}
protected onCurrentWidgetChange({ newValue }: FocusTracker.IChangedArgs<Widget>): void {