Skip to content

Commit 5473f5d

Browse files
committed
Fix performance problem when creating standalone editor.
Signed-off-by: Thomas Mäder <[email protected]>
1 parent 58a4d67 commit 5473f5d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/monaco/src/browser/monaco-frontend-module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ export function createMonacoConfigurationService(container: interfaces.Container
215215
return proxy;
216216
};
217217

218+
/*
219+
* Since we never read values from the underlying service, writing to it doesn't make sense. The standalone editor writes to the configuration when being created,
220+
* which makes sense in the standalone case where there is no preference infrastructure in place. Those writes degrade the performance, however, so we patch the
221+
* service to an empty implementation.
222+
*/
223+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
224+
service.updateValues = (values: [string, any][]) => Promise.resolve();
225+
218226
const toTarget = (scope: PreferenceScope): ConfigurationTarget => {
219227
switch (scope) {
220228
case PreferenceScope.Default: return ConfigurationTarget.DEFAULT;

0 commit comments

Comments
 (0)