Skip to content

Commit

Permalink
Fix performance problem when creating standalone editor.
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder committed Feb 5, 2024
1 parent 58a4d67 commit 5473f5d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/monaco/src/browser/monaco-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ export function createMonacoConfigurationService(container: interfaces.Container
return proxy;
};

/*
* 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,
* 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
* service to an empty implementation.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
service.updateValues = (values: [string, any][]) => Promise.resolve();

const toTarget = (scope: PreferenceScope): ConfigurationTarget => {
switch (scope) {
case PreferenceScope.Default: return ConfigurationTarget.DEFAULT;
Expand Down

0 comments on commit 5473f5d

Please sign in to comment.