Skip to content

Commit cd81cbf

Browse files
code-asherkylecarbs
authored andcommitted
Client partially loaded
Need to resolve the remaining modules and then check and apply any necessary patches.
1 parent aa82194 commit cd81cbf

File tree

5 files changed

+180
-453
lines changed

5 files changed

+180
-453
lines changed

packages/vscode/src/index.ts

-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ const load = (): Promise<void> => {
2020
],
2121
});
2222

23-
client.mkDirs.then(() => {
24-
resolve();
25-
});
26-
2723
const importTime = time(1500);
2824
import(/* webpackPrefetch: true */ "./workbench").then((module) => {
2925
logger.info("Loaded workbench bundle", field("duration", importTime));

packages/vscode/src/storageService.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
1+
import { IStorageService, StorageScope } from "vs/platform/storage/common/storage";
22

33
export class StorageService implements IStorageService {
44

55
public _serviceBrand: any;
66

7-
private _globalObject: object;
8-
private _workspaceObject: object;
7+
private _globalObject: { [key: string]: any };
8+
private _workspaceObject: { [ key: string]: any };
99

1010
public constructor(globalState: object, workspaceState: object) {
1111
this._globalObject = globalState;
@@ -39,12 +39,13 @@ export class StorageService implements IStorageService {
3939
public getBoolean(key: string, scope?: StorageScope, defaultValue?: boolean): boolean {
4040
const v = this.get(key, scope);
4141
if (typeof v !== "undefined") {
42-
return v === 'true';
42+
return v === "true";
4343
}
44+
4445
return defaultValue;
4546
}
4647

47-
private getObject(scope = StorageScope.GLOBAL): object {
48+
private getObject(scope = StorageScope.GLOBAL): { [key: string]: any } {
4849
switch (scope) {
4950
case StorageScope.GLOBAL:
5051
return this._globalObject;
@@ -55,4 +56,4 @@ export class StorageService implements IStorageService {
5556
}
5657
}
5758

58-
}
59+
}

packages/vscode/src/workbench.ts

+25-46
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,19 @@
1-
import * as fs from "fs";
2-
import {
3-
Client, Emitter, getFactory, IPosition, IFileConflict, ConflictResolution,
4-
Event,
5-
IDisposable,
6-
IDocumentContentChangedEvent, IURI, IRange, escapePath,
7-
IOrphanedChangedEvent,
8-
} from 'coder/common';
9-
import { Protocol } from 'vs/base/parts/ipc/node/ipc.net';
10-
import { IModelService } from 'vs/editor/common/services/modelService';
11-
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
12-
import { ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle';
13-
import { TPromise } from 'vs/base/common/winjs.base';
14-
import { ITextModel, TrackedRangeStickiness, IModelDeltaDecoration } from 'vs/editor/common/model';
15-
import { Position } from 'vs/editor/common/core/position';
16-
import { Selection } from 'vs/editor/common/core/selection';
17-
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
18-
import { registerContextMenuListener } from 'vs/base/parts/contextmenu/electron-main/contextmenu';
19-
import { Workbench } from 'vs/workbench/electron-browser/workbench';
20-
import { StorageService } from 'coder/storageService';
21-
import { IContentData, IFileService, FileOperationError, FileOperationResult, FileSystemProviderCapabilities, IStat, FileType } from 'vs/platform/files/common/files';
22-
import { onInstantiation as onFileServiceInstantiation } from 'vs/workbench/services/files/electron-browser/fileService';
23-
import { URI } from 'vs/base/common/uri';
24-
import { EventEmitter } from 'events';
25-
import { Range } from 'vs/editor/common/core/range';
26-
import product from 'vs/platform/node/product';
27-
import { CONFLICT_RESOLUTION_SCHEME } from 'vs/workbench/parts/files/electron-browser/saveErrorHandler';
28-
import { ITextFileService, ModelState } from 'vs/workbench/services/textfile/common/textfiles';
29-
import { field, logger } from 'coder/logger';
30-
import { events } from 'coder/analytics';
31-
import { IDecorationsService } from 'vs/workbench/services/decorations/browser/decorations';
32-
import { registerCollaboratorDecorations } from 'coder/collaborators';
33-
import { IInitData as ISharedProcessInitData } from 'vs/code/electron-browser/sharedProcess/sharedProcessClient';
34-
import { LogLevel } from 'vs/platform/log/common/log';
35-
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
36-
import { toLocalISOString } from 'vs/base/common/date';
37-
import { RawContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
1+
import { Client } from "@coder/ide";
2+
import { Emitter } from "@coder/events";
3+
import { logger } from "@coder/logger";
4+
5+
import { Protocol } from "vs/base/parts/ipc/node/ipc.net";
6+
import { IModelService } from "vs/editor/common/services/modelService";
7+
import { ICodeEditorService } from "vs/editor/browser/services/codeEditorService";
8+
import { registerContextMenuListener } from "vs/base/parts/contextmenu/electron-main/contextmenu";
9+
import { Workbench } from "vs/workbench/electron-browser/workbench";
10+
import { IDecorationsService } from "vs/workbench/services/decorations/browser/decorations";
11+
import { LogLevel } from "vs/platform/log/common/log";
12+
import { INotificationService, Severity } from "vs/platform/notification/common/notification";
13+
import { toLocalISOString } from "vs/base/common/date";
14+
import { RawContextKey, IContextKeyService } from "vs/platform/contextkey/common/contextkey";
15+
16+
import { StorageService } from "./storageService";
3817

3918
let protoResolve: (protocol: Protocol) => void;
4019
export const protocolPromise = new Promise<Protocol>((res) => {
@@ -79,14 +58,6 @@ function getCodeEditorService(): ICodeEditorService {
7958
return workbench.workbenchParams.serviceCollection.get(ICodeEditorService) as ICodeEditorService;
8059
}
8160

82-
function getFileService(): IFileService {
83-
return workbench.workbenchParams.serviceCollection.get(IFileService) as IFileService;
84-
}
85-
86-
function getTextFileService(): ITextFileService {
87-
return workbench.workbenchParams.serviceCollection.get(ITextFileService) as ITextFileService;
88-
}
89-
9061
function getNotificationService(): INotificationService {
9162
return workbench.workbenchParams.serviceCollection.get(INotificationService) as INotificationService;
9263
}
@@ -96,6 +67,7 @@ export const initialize = async (client: Client): Promise<void> {
9667
event.preventDefault();
9768
});
9869

70+
// TODO: Fetch configuration.
9971
const storageServicePromise = client.wrapTask("Set configurations", 5, async (state) => {
10072
const storageService = new StorageService(state.global, state.workspace);
10173
storageResolve(storageService);
@@ -239,7 +211,14 @@ export const initialize = async (client: Client): Promise<void> {
239211
await registerCollaboratorDecorations(client, decorations);
240212

241213
return workbenchShell;
242-
}, client.workspace.then((w) => w.connect()), mountPromise, client.mkDirs);
214+
}, client.mkDirs);
215+
216+
client.wrapTask("Set up saving state", 5, async () => {
217+
if (!navigator.sendBeacon) {
218+
throw new Error("cannot save state");
219+
}
220+
// TODO: save storageSevice.globalObject and storageService.workspaceObject
221+
});
243222

244223
await workbenchPromise;
245224
};

scripts/vscode.css.patch

+146
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,149 @@ index 651843fcc9..aa31b52cb9 100644
3030
- margin-left: auto;
3131
text-align: center;
3232
}
33+
diff --git a/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css b/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css
34+
index 5a92b2e1f5..1d3c735e75 100644
35+
--- a/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css
36+
+++ b/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css
37+
@@ -4,25 +4,130 @@
38+
*--------------------------------------------------------------------------------------------*/
39+
40+
.monaco-workbench > .part.activitybar {
41+
- width: 50px;
42+
+ width: 50px;
43+
}
44+
45+
.monaco-workbench > .activitybar > .content {
46+
- height: 100%;
47+
- display: flex;
48+
- flex-direction: column;
49+
- justify-content: space-between;
50+
+ height: 100%;
51+
+ display: flex;
52+
+ flex-direction: column;
53+
+ justify-content: space-between;
54+
}
55+
56+
.monaco-workbench > .activitybar > .content .monaco-action-bar {
57+
- text-align: left;
58+
- background-color: inherit;
59+
+ text-align: left;
60+
+ background-color: inherit;
61+
}
62+
63+
.monaco-workbench > .activitybar .action-item:focus {
64+
- outline: 0 !important; /* activity bar indicates focus custom */
65+
+ outline: 0 !important; /* activity bar indicates focus custom */
66+
}
67+
68+
.monaco-workbench .activitybar > .content > .composite-bar > .monaco-action-bar .action-label.toggle-more {
69+
- -webkit-mask: url('ellipsis-global.svg') no-repeat 50% 50%;
70+
-}
71+
\ No newline at end of file
72+
+ -webkit-mask: url("ellipsis-global.svg") no-repeat 50% 50%;
73+
+}
74+
+
75+
+.monaco-workbench .activitybar > .content > .extras-bar {
76+
+ flex: 1;
77+
+ display: flex;
78+
+ flex-direction: column;
79+
+ overflow: visible;
80+
+}
81+
+
82+
+.monaco-workbench .activitybar > .content > .extras-bar .toggle-terminal {
83+
+ transition: 500ms color ease;
84+
+ opacity: 0.65;
85+
+ filter: brightness(115%);
86+
+ padding-top: 10px;
87+
+ padding-bottom: 10px;
88+
+}
89+
+
90+
+.monaco-workbench .activitybar > .content > .extras-bar .toggle-terminal:hover {
91+
+ opacity: 1;
92+
+}
93+
+
94+
+.monaco-workbench .activitybar > .content > .extras-bar .toggle-terminal.disabled {
95+
+ cursor: disabled;
96+
+ opacity: 0.45 !important;
97+
+}
98+
+
99+
+.monaco-workbench .activitybar > .content > .extras-bar .toggle-terminal > .icon {
100+
+ text-align: center;
101+
+ display: block;
102+
+}
103+
+
104+
+.monaco-workbench .activitybar > .content > .extras-bar .toggle-terminal > .icon > svg {
105+
+ width: 29px;
106+
+ fill: currentColor;
107+
+}
108+
+
109+
+.monaco-workbench .activitybar > .content > .extras-bar .fasttime {
110+
+ transition: 500ms color ease;
111+
+ opacity: 0.65;
112+
+ filter: brightness(115%);
113+
+}
114+
+
115+
+.monaco-workbench .activitybar > .content > .extras-bar .fasttime:hover {
116+
+ opacity: 1;
117+
+}
118+
+
119+
+.monaco-workbench .activitybar > .content > .extras-bar .fasttime.disabled {
120+
+ cursor: disabled;
121+
+ opacity: 0.45 !important;
122+
+}
123+
+
124+
+.monaco-workbench .activitybar > .content > .extras-bar .fasttime > .icon {
125+
+ text-align: center;
126+
+ display: block;
127+
+}
128+
+
129+
+.monaco-workbench .activitybar > .content > .extras-bar .fasttime > .icon > svg {
130+
+ width: 22px;
131+
+ fill: currentColor;
132+
+}
133+
+
134+
+.monaco-workbench .activitybar > .content > .extras-bar .fasttime > .text {
135+
+ font-size: 12px;
136+
+ text-align: center;
137+
+}
138+
+
139+
+.monaco-workbench .activitybar > .content > .extras-bar .fasttime > .text.unknown {
140+
+ font-size: 8px;
141+
+ opacity: 0;
142+
+}
143+
+
144+
+.monaco-workbench .activitybar > .content > .extras-bar > .feedback {
145+
+ transition: 500ms color ease;
146+
+ padding-top: 10px;
147+
+ padding-bottom: 10px;
148+
+ margin-left: 0px;
149+
+ margin-top: auto;
150+
+ flex: 0;
151+
+ cursor: default;
152+
+}
153+
+
154+
+.monaco-workbench .activitybar > .content > .extras-bar .feedback > .icon {
155+
+ text-align: center;
156+
+ display: block;
157+
+ opacity: 0.65;
158+
+ filter: brightness(115%);
159+
+ cursor: pointer;
160+
+}
161+
+
162+
+.monaco-workbench .activitybar > .content > .extras-bar .feedback .feedback {
163+
+ position: initial;
164+
+ margin-left: 0px;
165+
+}
166+
+
167+
+.monaco-workbench .activitybar > .content > .extras-bar .feedback .feedback-dropdown {
168+
+ bottom: -63px;
169+
+}
170+
+
171+
+.monaco-workbench .activitybar > .content > .extras-bar .feedback:hover > .icon {
172+
+ opacity: 1;
173+
+}
174+
+
175+
+.monaco-workbench .activitybar > .content > .extras-bar .feedback > .icon > svg {
176+
+ width: 29px;
177+
+ fill: currentColor;
178+
+}

0 commit comments

Comments
 (0)