Skip to content

Commit f2d492b

Browse files
author
Alberto Iannaccone
authored
show represented file on MacOS (#868)
1 parent 5979e5a commit f2d492b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: arduino-ide-extension/src/browser/theia/workspace/workspace-service.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as remote from '@theia/core/electron-shared/@electron/remote';
12
import { injectable, inject } from 'inversify';
23
import URI from '@theia/core/lib/common/uri';
34
import { EditorWidget } from '@theia/editor/lib/browser';
@@ -77,7 +78,9 @@ export class WorkspaceService extends TheiaWorkspaceService {
7778
),
7879
]);
7980
// On Dindows, `getRecentWorkspaces` returns only file paths, not URIs as expected by the `isValid` method.
80-
const recentWorkspaces = recentWorkspacesPaths.map(e => VSCodeUri.file(e).toString());
81+
const recentWorkspaces = recentWorkspacesPaths.map((e) =>
82+
VSCodeUri.file(e).toString()
83+
);
8184
const toOpen = await new ArduinoWorkspaceRootResolver({
8285
isValid: this.isValid.bind(this),
8386
}).resolve({ hash, recentWorkspaces, recentSketches });
@@ -127,6 +130,8 @@ export class WorkspaceService extends TheiaWorkspaceService {
127130
}: FocusTracker.IChangedArgs<Widget>): void {
128131
if (newValue instanceof EditorWidget) {
129132
const { uri } = newValue.editor;
133+
const currentWindow = remote.getCurrentWindow();
134+
currentWindow.setRepresentedFilename(uri.path.toString());
130135
if (Sketch.isSketchFile(uri.toString())) {
131136
this.updateTitle();
132137
} else {

0 commit comments

Comments
 (0)