mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
tests around #update, #1396
This commit is contained in:
@@ -102,7 +102,7 @@ export class ExtHostAPIImplementation {
|
||||
const extHostDocuments = col.define(ExtHostContext.ExtHostDocuments).set<ExtHostDocuments>(new ExtHostDocuments(threadService));
|
||||
const extHostEditors = col.define(ExtHostContext.ExtHostEditors).set<ExtHostEditors>(new ExtHostEditors(threadService, extHostDocuments));
|
||||
const extHostCommands = col.define(ExtHostContext.ExtHostCommands).set<ExtHostCommands>(new ExtHostCommands(threadService, extHostEditors));
|
||||
const extHostConfiguration = col.define(ExtHostContext.ExtHostConfiguration).set<ExtHostConfiguration>(new ExtHostConfiguration(threadService));
|
||||
const extHostConfiguration = col.define(ExtHostContext.ExtHostConfiguration).set<ExtHostConfiguration>(new ExtHostConfiguration(threadService.get(MainContext.MainThreadConfiguration)));
|
||||
const extHostDiagnostics = col.define(ExtHostContext.ExtHostDiagnostics).set<ExtHostDiagnostics>(new ExtHostDiagnostics(threadService));
|
||||
const languageFeatures = col.define(ExtHostContext.ExtHostLanguageFeatures).set<ExtHostLanguageFeatures>(new ExtHostLanguageFeatures(threadService, extHostDocuments, extHostCommands, extHostDiagnostics));
|
||||
const extHostFileSystemEvent = col.define(ExtHostContext.ExtHostFileSystemEventService).set<ExtHostFileSystemEventService>(new ExtHostFileSystemEventService());
|
||||
|
||||
@@ -8,8 +8,7 @@ import {mixin} from 'vs/base/common/objects';
|
||||
import {illegalState} from 'vs/base/common/errors';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {WorkspaceConfiguration} from 'vscode';
|
||||
import {ExtHostConfigurationShape, MainContext, MainThreadConfigurationShape} from './extHost.protocol';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {ExtHostConfigurationShape, MainThreadConfigurationShape} from './extHost.protocol';
|
||||
import {ConfigurationTarget, ConfigurationEditingResult} from 'vs/workbench/services/configuration/common/configurationEditing';
|
||||
|
||||
export class ExtHostConfiguration extends ExtHostConfigurationShape {
|
||||
@@ -17,12 +16,11 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape {
|
||||
private _proxy: MainThreadConfigurationShape;
|
||||
private _hasConfig: boolean;
|
||||
private _config: any;
|
||||
private _onDidChangeConfiguration: Emitter<void>;
|
||||
private _onDidChangeConfiguration = new Emitter<void>();
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
constructor(proxy: MainThreadConfigurationShape) {
|
||||
super();
|
||||
this._proxy = threadService.get(MainContext.MainThreadConfiguration);
|
||||
this._onDidChangeConfiguration = new Emitter<void>();
|
||||
this._proxy = proxy;
|
||||
}
|
||||
|
||||
get onDidChangeConfiguration(): Event<void> {
|
||||
@@ -56,6 +54,7 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape {
|
||||
return result;
|
||||
},
|
||||
update: (key: string, value: any, global: boolean) => {
|
||||
key = section ? `${section}.${key}` : key;
|
||||
const target = global ? ConfigurationTarget.USER : ConfigurationTarget.WORKSPACE;
|
||||
return this._proxy.$updateConfigurationOption(target, key, value).then(value => {
|
||||
if (value !== ConfigurationEditingResult.OK) {
|
||||
|
||||
Reference in New Issue
Block a user