提交 06550ab0 编写于 作者: S Sandeep Somavarapu

Version 2

上级 2a1e406d
......@@ -2951,24 +2951,52 @@ declare module 'vscode' {
}
/**
* Represents the workspace configuration.
* The configuration target
*/
export enum ConfigurationTarget {
/**
* Global configuration
*/
Global = 1,
/**
* Workspace configuration
*/
Workspace = 2,
/**
* Workspace folder configuration
*/
WorkspaceFolder = 3
}
/**
* Represents the configuration. It is a merged view of
*
* The workspace configuration is a merged view: Configurations of the current [workspace](#workspace.rootPath)
* (if available), files like `launch.json`, and the installation-wide configuration. Workspace specific values
* shadow installation-wide values.
* - Default configuration
* - Global configuration
* - Workspace configuration (if available)
* - Workspace folder configuration of the requested resource (if available)
*
* *Note:* The merged configuration of the current [workspace](#workspace.rootPath)
* also contains settings from files like `launch.json` and `tasks.json`. Their basename will be
* **Global configuration** comes from User Settings and shadows Defaults.
*
* **Workspace configuration** comes from Workspace Settings and shadows Global configuration.
*
* **Workspace Folder configuration** comes from `.vscode` folder under one of the [workspace folders](#workspace.workspaceFolders).
*
* *Note:* Workspace and Workspace Folder configurations contains `launch` and `tasks` settings. Their basename will be
* part of the section identifier. The following snippets shows how to retrieve all configurations
* from `launch.json`:
*
* ```ts
* // launch.json configuration
* const config = workspace.getConfiguration('launch');
* const config = workspace.getConfiguration(workspace.workspaceFolders[1], 'launch');
*
* // retrieve values
* const values = config.get('configurations');
* ```
*
* Refer to [Settings](https://code.visualstudio.com/docs/getstarted/settings) for more information.
*/
export interface WorkspaceConfiguration {
......@@ -2999,10 +3027,13 @@ declare module 'vscode' {
/**
* Retrieve all information about a configuration setting. A configuration value
* often consists of a *default* value, a global or installation-wide value, and
* a workspace-specific value. The *effective* value (returned by [`get`](#WorkspaceConfiguration.get))
* often consists of a *default* value, a global or installation-wide value,
* a workspace-specific value and a folder-specific value.
*
* The *effective* value (returned by [`get`](#WorkspaceConfiguration.get))
* is computed like this: `defaultValue` overwritten by `globalValue`,
* `globalValue` overwritten by `workspaceValue`. Refer to [Settings Inheritence](https://code.visualstudio.com/docs/getstarted/settings)
* `globalValue` overwritten by `workspaceValue`. `workspaceValue` overwritten by `folderValue`.
* Refer to [Settings Inheritence](https://code.visualstudio.com/docs/getstarted/settings)
* for more information.
*
* *Note:* The configuration name must denote a leaf in the configuration tree
......@@ -3011,54 +3042,32 @@ declare module 'vscode' {
* @param section Configuration name, supports _dotted_ names.
* @return Information about a configuration setting or `undefined`.
*/
inspect<T>(section: string): { key: string; defaultValue?: T; globalValue?: T; workspaceValue?: T } | undefined;
/**
* Update the global value of the configuration
*
* *Note 1:* Setting a global value in the presence of a more specific workspace value
* has no observable effect in that workspace, but in others. Refer to [Settings Inheritence](https://code.visualstudio.com/docs/getstarted/settings)
* for more information.
*
* *Note 2:* To remove a configuration value use `undefined`, like so: `config.updateFolderValue('somekey', undefined)`
*
* @param section Configuration name, supports _dotted_ names.
* @param value The new value.
*/
updateGlobalValue(section: string, value: any): Thenable<void>;
inspect<T>(section: string): { key: string; defaultValue?: T; globalValue?: T; workspaceValue?: T, folderValue?: T } | undefined;
/**
* Update the workspace value of the configuration
* Update a configuration value. The updated configuration values are persisted.
*
* *Note 1:* Setting a workspace value in the presence of a more specific folder value
* has no observable effect for the resources under respective [folder](#workspace.workspaceFolders),
* but in others. Refer to [Settings Inheritence](https://code.visualstudio.com/docs/getstarted/settings)
* for more information.
* A value can be changed in
*
* *Note 2:* To remove a configuration value use `undefined`, like so: `config.updateFolderValue('somekey', undefined)`
* - [Global configuration](#ConfigurationTarget.Global): Changes the value for all instances of the editor.
* - [Workspace configuration](#ConfigurationTarget.Workspace): Changes the value for current workspace, if available.
* - [Workspace folder configuration](#ConfigurationTarget.WorkspaceFolder): Changes the value for the
* [Workspace folder](#workspace.workspaceFolders) to which the current [configuration](#WorkspaceConfiguration) is scoped to.
*
* @param section Configuration name, supports _dotted_ names.
* @param value The new value.
*/
updateWorkspaceValue(section: string, value: any): Thenable<void>;
/**
* Update a configuration value. A value can be changed for the current
* [workspace](#workspace.rootPath) only, or globally for all instances of the
* editor. The updated configuration values are persisted.
*
* *Note 1:* Setting an installation-wide value (`global: true`) in the presence of
* a more specific workspace value has no observable effect in that workspace, but
* in others.
* *Note 1:* Setting a global value in the presence of a more specific workspace value
* has no observable effect in that workspace, but in others. Setting a workspace value
* in the presence of a more specific folder value has no observable effect for the resources
* under respective [folder](#workspace.workspaceFolders), but in others. Refer to
* [Settings Inheritence](https://code.visualstudio.com/docs/getstarted/settings) for more information.
*
* *Note 2:* To remove a configuration value use `undefined`, like so: `config.update('somekey', undefined)`
*
* @deprecated Use [`updateGlobalValue`](#WorkspaceConfiguration.updateGlobalValue) or [`updateWorkspaceValue`](#WorkspaceConfiguration.updateWorkspaceValue) instead.
*
* @param section Configuration name, supports _dotted_ names.
* @param value The new value.
* @param global When `true` changes the configuration value for all instances of the editor.
* @param configurationTarget The [configuration target](#ConfigurationTarget)
* @param global When `true` changes the global configuration value otherwise workspace configuration value
*/
update(section: string, value: any, configurationTarget: ConfigurationTarget): Thenable<void>;
update(section: string, value: any, global?: boolean): Thenable<void>;
/**
......@@ -3067,67 +3076,6 @@ declare module 'vscode' {
readonly [key: string]: any;
}
/**
* Represents the configuration of a resource
*
* The resource configuration is a merged view of
*
* - Default configuration
* - Global configuration
* - Workspace configuration (if available)
* - Folder configuration of the resource (if available)
*
* **Global configuration** comes from User Settings and shadows Defaults.
*
* **Workspace configuration** comes from Workspace Settings and shadows Global configuration.
*
* **Folder configurations** comes from `.vscode` folder under [workspace folders](#workspace.workspaceFolders). Each [workspace folder](#workspace.workspaceFolders)
* has a configuration and the requested resource determines which folder configuration to pick. Folder configuration shodows Workspace configuration.
*
* *Note:* Workspace and Folder configurations contains settings from `launch.json` and `tasks.json` files. Their basename will be
* part of the section identifier. The following snippets shows how to retrieve all configurations
* from `launch.json`:
*
* ```ts
* // launch.json configuration
* const config = workspace.getConfiguration(workspace.workspaceFolders[1], 'launch');
*
* // retrieve values
* const values = config.get('configurations');
* ```
*/
export interface ResourceConfiguration extends WorkspaceConfiguration {
/**
* Retrieve all information about a configuration setting. A configuration value
* often consists of a *default* value, a global or installation-wide value,
* a workspace-specific value and a folder-specific value.
*
* The *effective* value (returned by [`get`](#WorkspaceConfiguration.get))
* is computed like this: `defaultValue` overwritten by `globalValue`,
* `globalValue` overwritten by `workspaceValue`. `workspaceValue` overwritten by `folderValue`.
* Refer to [Settings Inheritence](https://code.visualstudio.com/docs/getstarted/settings)
* for more information.
*
* *Note:* The configuration name must denote a leaf in the configuration tree
* (`editor.fontSize` vs `editor`) otherwise no result is returned.
*
* @param section Configuration name, supports _dotted_ names.
* @return Information about a configuration setting or `undefined`.
*/
inspect<T>(section: string): { key: string; defaultValue?: T; globalValue?: T; workspaceValue?: T, folderValue?: T } | undefined;
/**
* Update the folder value of the configuration
*
* *Note:* To remove a configuration value use `undefined`, like so: `config.updateFolderValue('somekey', undefined)`
*
* @param section Configuration name, supports _dotted_ names.
* @param value The new value.
*/
updateFolderValue(section: string, value: any): Thenable<void>;
}
/**
* Represents a location inside a resource, such as a line
* inside a text file.
......@@ -4947,23 +4895,13 @@ declare module 'vscode' {
* is returned. Dots in the section-identifier are interpreted as child-access,
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
*
* @param section A dot-separated identifier.
* @return The full configuration or a subset.
*/
export function getConfiguration(section?: string): WorkspaceConfiguration;
/**
* Get a resource configuration object.
*
* When a section-identifier is provided only that part of the configuration
* is returned. Dots in the section-identifier are interpreted as child-access,
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
* When a resource is provided, configuration scoped to that resource is returned.
*
* @param section A dot-separated identifier.
* @param resource A resource for which configuration is asked for
* @param resource A resource for which the configuration is asked for
* @return The full configuration or a subset.
*/
export function getConfiguration(resource: Uri, section?: string): ResourceConfiguration;
export function getConfiguration(section?: string, resource?: Uri): WorkspaceConfiguration;
/**
* An event that is emitted when the [configuration](#WorkspaceConfiguration) changed.
......
......@@ -7,12 +7,6 @@
declare module 'vscode' {
export interface WorkspaceConfiguration2 extends WorkspaceConfiguration {
inspect<T>(section: string): { key: string; defaultValue?: T; globalValue?: T; workspaceValue?: T, folderValue?: T } | undefined;
}
// todo@joh discover files etc
export interface FileSystemProvider {
// todo@joh -> added, deleted, renamed, changed
......@@ -25,79 +19,6 @@ declare module 'vscode' {
export namespace workspace {
export function registerFileSystemProvider(authority: string, provider: FileSystemProvider): Disposable;
/**
* Get a configuration object.
*
* When a section-identifier is provided only that part of the configuration
* is returned. Dots in the section-identifier are interpreted as child-access,
* like `{ myExt: { setting: { doIt: true }}}` and `getConfiguration('myExt.setting').get('doIt') === true`.
*
* When a resource is provided, only configuration scoped to that resource
* is returned.
*
* If editor is opened with `no folders` then returns the global configuration.
*
* If editor is opened with `folders` then returns the configuration from the folder in which the resource belongs to.
*
* If resource does not belongs to any opened folders, then returns the workspace configuration.
*
* @param section A dot-separated identifier.
* @param resource A resource for which configuration is asked
* @return The full workspace configuration or a subset.
*/
export function getConfiguration2(section?: string, resource?: Uri): WorkspaceConfiguration2;
}
/**
* Represents the workspace configuration.
*
* The workspace configuration is a merged view of
*
* - Default configuration
* - Global configuration
* - Workspace configuration (if available)
* - Folder configuration of the [resource](#workspace.getConfiguration2) (if requested and available)
*
* **Global configuration** comes from User Settings and shadows Defaults.
*
* **Workspace configuration** comes from the `.vscode` folder under first [workspace folders](#workspace.workspaceFolders)
* and shadows Globals configuration.
*
* **Folder configurations** comes from `.vscode` folder under [workspace folders](#workspace.workspaceFolders). Each [workspace folder](#workspace.workspaceFolders)
* has a configuration and the requested resource determines which folder configuration to pick. Folder configuration shodows Workspace configuration.
*
* *Note:* Workspace and Folder configurations contains settings from `launch.json` and `tasks.json` files. Their basename will be
* part of the section identifier. The following snippets shows how to retrieve all configurations
* from `launch.json`:
*
* ```ts
* // launch.json configuration
* const config = workspace.getConfiguration('launch', workspace.workspaceFolders[1]);
*
* // retrieve values
* const values = config.get('configurations');
* ```
*/
export interface WorkspaceConfiguration2 extends WorkspaceConfiguration {
/**
* Retrieve all information about a configuration setting. A configuration value
* often consists of a *default* value, a global or installation-wide value,
* a workspace-specific value and a folder-specific value.
*
* The *effective* value (returned by [`get`](#WorkspaceConfiguration.get))
* is computed like this: `defaultValue` overwritten by `globalValue`,
* `globalValue` overwritten by `workspaceValue`. `workspaceValue` overwritten by `folderValue`.
*
* *Note:* The configuration name must denote a leaf in the configuration tree
* (`editor.fontSize` vs `editor`) otherwise no result is returned.
*
* @param section Configuration name, supports _dotted_ names.
* @return Information about a configuration setting or `undefined`.
*/
inspect<T>(section: string): { key: string; defaultValue?: T; globalValue?: T; workspaceValue?: T, folderValue?: T } | undefined;
}
export namespace window {
......
......@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import URI from 'vs/base/common/uri';
import { TPromise } from 'vs/base/common/winjs.base';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
......@@ -34,11 +35,11 @@ export class MainThreadConfiguration extends MainThreadConfigurationShape {
this._toDispose = dispose(this._toDispose);
}
$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): TPromise<void> {
return this._configurationEditingService.writeConfiguration(target, { key, value }, { donotNotifyError: true });
$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any, resource: URI): TPromise<void> {
return this._configurationEditingService.writeConfiguration(target, { key, value }, { donotNotifyError: true, scopes: { resource } });
}
$removeConfigurationOption(target: ConfigurationTarget, key: string): TPromise<void> {
return this._configurationEditingService.writeConfiguration(target, { key, value: undefined }, { donotNotifyError: true });
$removeConfigurationOption(target: ConfigurationTarget, key: string, resource: URI): TPromise<void> {
return this._configurationEditingService.writeConfiguration(target, { key, value: undefined }, { donotNotifyError: true, scopes: { resource } });
}
}
......@@ -445,12 +445,9 @@ export function createApiFactory(
onDidChangeConfiguration: (listener: (_: any) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) => {
return extHostConfiguration.onDidChangeConfiguration(listener, thisArgs, disposables);
},
getConfiguration: (section?: string): vscode.WorkspaceConfiguration => {
return extHostConfiguration.getConfiguration(section);
getConfiguration: (section?: string, resource?: vscode.Uri): vscode.WorkspaceConfiguration => {
return extHostConfiguration.getConfiguration(section, <URI>resource);
},
getConfiguration2: proposedApiFunction(extension, (section?: string, resource?: vscode.Uri): vscode.WorkspaceConfiguration => {
return extHostConfiguration.getConfiguration2(section, <URI>resource);
}),
registerTaskProvider: (type: string, provider: vscode.TaskProvider) => {
return extHostTask.registerTaskProvider(extension, provider);
},
......@@ -578,7 +575,8 @@ export function createApiFactory(
TaskGroup: extHostTypes.TaskGroup,
ProcessExecution: extHostTypes.ProcessExecution,
ShellExecution: extHostTypes.ShellExecution,
Task: extHostTypes.Task
Task: extHostTypes.Task,
ConfigurationTarget: extHostTypes.ConfigurationTarget
};
};
}
......
......@@ -123,8 +123,8 @@ export abstract class MainThreadCommandsShape {
}
export abstract class MainThreadConfigurationShape {
$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): TPromise<void> { throw ni(); }
$removeConfigurationOption(target: ConfigurationTarget, key: string): TPromise<void> { throw ni(); }
$updateConfigurationOption(target: ConfigurationTarget, key: string, value: any, resource: URI): TPromise<void> { throw ni(); }
$removeConfigurationOption(target: ConfigurationTarget, key: string, resource: URI): TPromise<void> { throw ni(); }
}
export abstract class MainThreadDiagnosticsShape {
......
......@@ -7,9 +7,10 @@
import { mixin } from 'vs/base/common/objects';
import URI from 'vs/base/common/uri';
import Event, { Emitter } from 'vs/base/common/event';
import { WorkspaceConfiguration, WorkspaceConfiguration2 } from 'vscode';
import { WorkspaceConfiguration } from 'vscode';
import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace';
import { ExtHostConfigurationShape, MainThreadConfigurationShape } from './extHost.protocol';
import { ConfigurationTarget as ExtHostConfigurationTarget } from './extHostTypes';
import { IConfigurationData, Configuration } from 'vs/platform/configuration/common/configuration';
import { ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing';
......@@ -55,20 +56,26 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape {
this._onDidChangeConfiguration.fire(undefined);
}
getConfiguration(section?: string): WorkspaceConfiguration {
return this._getConfiguration(section, null, true);
}
getConfiguration2(section?: string, resource?: URI): WorkspaceConfiguration2 {
return this._getConfiguration(section, resource, false);
}
private _getConfiguration(section: string, resource: URI, legacy: boolean): WorkspaceConfiguration {
getConfiguration(section?: string, resource?: URI): WorkspaceConfiguration {
const config = section
? lookUp(this._configuration.getValue(null, { resource }), section)
: this._configuration.getValue(null, { resource });
function parseConfigurationTarget(arg: boolean | ExtHostConfigurationTarget): ConfigurationTarget {
if (arg === void 0 || arg === null) {
return ConfigurationTarget.WORKSPACE;
}
if (typeof arg === 'boolean') {
return arg ? ConfigurationTarget.USER : ConfigurationTarget.WORKSPACE;
}
switch (arg) {
case ExtHostConfigurationTarget.Global: return ConfigurationTarget.USER;
case ExtHostConfigurationTarget.Workspace: return ConfigurationTarget.WORKSPACE;
case ExtHostConfigurationTarget.WorkspaceFolder: return ConfigurationTarget.FOLDER;
}
}
const result: WorkspaceConfiguration = {
has(key: string): boolean {
return typeof lookUp(config, key) !== 'undefined';
......@@ -80,29 +87,26 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape {
}
return result;
},
update: (key: string, value: any, global: boolean = false) => {
update: (key: string, value: any, arg: boolean | ExtHostConfigurationTarget) => {
key = section ? `${section}.${key}` : key;
const target = global ? ConfigurationTarget.USER : ConfigurationTarget.WORKSPACE;
const target = parseConfigurationTarget(arg);
if (value !== void 0) {
return this._proxy.$updateConfigurationOption(target, key, value);
return this._proxy.$updateConfigurationOption(target, key, value, resource);
} else {
return this._proxy.$removeConfigurationOption(target, key);
return this._proxy.$removeConfigurationOption(target, key, resource);
}
},
inspect: <T>(key: string): ConfigurationInspect<T> => {
key = section ? `${section}.${key}` : key;
const config = legacy ? this._configuration.lookupLegacy<T>(key) : this._configuration.lookup<T>(key, { resource });
const config = this._configuration.lookup<T>(key, { resource });
if (config) {
const inspect: ConfigurationInspect<T> = {
return {
key,
defaultValue: config.default,
globalValue: config.user,
workspaceValue: config.workspace,
folderValue: config.folder
};
if (!legacy) {
inspect.folderValue = config.folder;
}
return inspect;
}
return undefined;
}
......
......@@ -1316,3 +1316,11 @@ export class ThemeColor {
this.id = id;
}
}
export enum ConfigurationTarget {
Global = 1,
Workspace = 2,
WorkspaceFolder = 3
}
\ No newline at end of file
......@@ -108,13 +108,13 @@ suite('ExtHostConfiguration', function () {
assert.equal(actual.defaultValue, 'off');
assert.equal(actual.globalValue, 'on');
assert.equal(actual.workspaceValue, undefined);
assert.ok(Object.keys(actual).indexOf('folderValue') === -1);
assert.equal(actual.folderValue, undefined);
actual = testObject.getConfiguration('editor').inspect('wordWrap');
assert.equal(actual.defaultValue, 'off');
assert.equal(actual.globalValue, 'on');
assert.equal(actual.workspaceValue, undefined);
assert.ok(Object.keys(actual).indexOf('folderValue') === -1);
assert.equal(actual.folderValue, undefined);
});
test('inspect in single root context', function () {
......@@ -153,21 +153,21 @@ suite('ExtHostConfiguration', function () {
assert.equal(actual1.defaultValue, 'off');
assert.equal(actual1.globalValue, 'on');
assert.equal(actual1.workspaceValue, 'bounded');
assert.ok(Object.keys(actual1).indexOf('folderValue') === -1);
assert.equal(actual1.folderValue, undefined);
actual1 = testObject.getConfiguration('editor').inspect('wordWrap');
assert.equal(actual1.defaultValue, 'off');
assert.equal(actual1.globalValue, 'on');
assert.equal(actual1.workspaceValue, 'bounded');
assert.ok(Object.keys(actual1).indexOf('folderValue') === -1);
assert.equal(actual1.folderValue, undefined);
let actual2 = testObject.getConfiguration2(null, workspaceUri).inspect('editor.wordWrap');
let actual2 = testObject.getConfiguration(null, workspaceUri).inspect('editor.wordWrap');
assert.equal(actual2.defaultValue, 'off');
assert.equal(actual2.globalValue, 'on');
assert.equal(actual2.workspaceValue, 'bounded');
assert.equal(actual2.folderValue, 'bounded');
actual2 = testObject.getConfiguration2('editor', workspaceUri).inspect('wordWrap');
actual2 = testObject.getConfiguration('editor', workspaceUri).inspect('wordWrap');
assert.equal(actual2.defaultValue, 'off');
assert.equal(actual2.globalValue, 'on');
assert.equal(actual2.workspaceValue, 'bounded');
......@@ -225,59 +225,59 @@ suite('ExtHostConfiguration', function () {
let actual1 = testObject.getConfiguration().inspect('editor.wordWrap');
assert.equal(actual1.defaultValue, 'off');
assert.equal(actual1.globalValue, 'on');
assert.equal(actual1.workspaceValue, 'off');
assert.ok(Object.keys(actual1).indexOf('folderValue') === -1);
assert.equal(actual1.workspaceValue, 'bounded');
assert.equal(actual1.folderValue, undefined);
actual1 = testObject.getConfiguration('editor').inspect('wordWrap');
assert.equal(actual1.defaultValue, 'off');
assert.equal(actual1.globalValue, 'on');
assert.equal(actual1.workspaceValue, 'off');
assert.ok(Object.keys(actual1).indexOf('folderValue') === -1);
assert.equal(actual1.workspaceValue, 'bounded');
assert.equal(actual1.folderValue, undefined);
actual1 = testObject.getConfiguration('editor').inspect('lineNumbers');
assert.equal(actual1.defaultValue, 'on');
assert.equal(actual1.globalValue, undefined);
assert.equal(actual1.workspaceValue, 'relative');
assert.ok(Object.keys(actual1).indexOf('folderValue') === -1);
assert.equal(actual1.workspaceValue, undefined);
assert.equal(actual1.folderValue, undefined);
let actual2 = testObject.getConfiguration2(null, firstRoot).inspect('editor.wordWrap');
let actual2 = testObject.getConfiguration(null, firstRoot).inspect('editor.wordWrap');
assert.equal(actual2.defaultValue, 'off');
assert.equal(actual2.globalValue, 'on');
assert.equal(actual2.workspaceValue, 'bounded');
assert.equal(actual2.folderValue, 'off');
actual2 = testObject.getConfiguration2('editor', firstRoot).inspect('wordWrap');
actual2 = testObject.getConfiguration('editor', firstRoot).inspect('wordWrap');
assert.equal(actual2.defaultValue, 'off');
assert.equal(actual2.globalValue, 'on');
assert.equal(actual2.workspaceValue, 'bounded');
assert.equal(actual2.folderValue, 'off');
actual2 = testObject.getConfiguration2('editor', firstRoot).inspect('lineNumbers');
actual2 = testObject.getConfiguration('editor', firstRoot).inspect('lineNumbers');
assert.equal(actual2.defaultValue, 'on');
assert.equal(actual2.globalValue, undefined);
assert.equal(actual2.workspaceValue, undefined);
assert.equal(actual2.folderValue, 'relative');
actual2 = testObject.getConfiguration2(null, secondRoot).inspect('editor.wordWrap');
actual2 = testObject.getConfiguration(null, secondRoot).inspect('editor.wordWrap');
assert.equal(actual2.defaultValue, 'off');
assert.equal(actual2.globalValue, 'on');
assert.equal(actual2.workspaceValue, 'bounded');
assert.equal(actual2.folderValue, 'on');
actual2 = testObject.getConfiguration2('editor', secondRoot).inspect('wordWrap');
actual2 = testObject.getConfiguration('editor', secondRoot).inspect('wordWrap');
assert.equal(actual2.defaultValue, 'off');
assert.equal(actual2.globalValue, 'on');
assert.equal(actual2.workspaceValue, 'bounded');
assert.equal(actual2.folderValue, 'on');
actual2 = testObject.getConfiguration2(null, thirdRoot).inspect('editor.wordWrap');
actual2 = testObject.getConfiguration(null, thirdRoot).inspect('editor.wordWrap');
assert.equal(actual2.defaultValue, 'off');
assert.equal(actual2.globalValue, 'on');
assert.equal(actual2.workspaceValue, 'bounded');
assert.ok(Object.keys(actual2).indexOf('folderValue') !== -1);
assert.equal(actual2.folderValue, undefined);
actual2 = testObject.getConfiguration2('editor', thirdRoot).inspect('wordWrap');
actual2 = testObject.getConfiguration('editor', thirdRoot).inspect('wordWrap');
assert.equal(actual2.defaultValue, 'off');
assert.equal(actual2.globalValue, 'on');
assert.equal(actual2.workspaceValue, 'bounded');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册