Archived
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -18,6 +18,7 @@ import { EnvironmentService } from 'vs/platform/environment/node/environmentServ
|
||||
import extfs = require('vs/base/node/extfs');
|
||||
import uuid = require('vs/base/common/uuid');
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { mkdirp } from 'vs/base/node/pfs';
|
||||
|
||||
class SettingsTestEnvironmentService extends EnvironmentService {
|
||||
|
||||
@@ -36,9 +37,9 @@ suite('ConfigurationService - Node', () => {
|
||||
const newDir = path.join(parentDir, 'config', id);
|
||||
const testFile = path.join(newDir, 'config.json');
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
callback(testFile, (callback) => extfs.del(parentDir, os.tmpdir(), () => { }, callback));
|
||||
});
|
||||
const onMkdirp = error => callback(testFile, (callback) => extfs.del(parentDir, os.tmpdir(), () => { }, callback));
|
||||
|
||||
mkdirp(newDir, 493).done(() => onMkdirp(null), error => onMkdirp(error));
|
||||
}
|
||||
|
||||
test('simple', (done: () => void) => {
|
||||
@@ -47,7 +48,7 @@ suite('ConfigurationService - Node', () => {
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
const config = service.getConfiguration<{ foo: string }>();
|
||||
const config = service.getValue<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
assert.equal(config.foo, 'bar');
|
||||
|
||||
@@ -63,7 +64,7 @@ suite('ConfigurationService - Node', () => {
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
const config = service.getConfiguration<{ testworkbench: { editor: { tabs: boolean } } }>();
|
||||
const config = service.getValue<{ testworkbench: { editor: { tabs: boolean } } }>();
|
||||
assert.ok(config);
|
||||
assert.ok(config.testworkbench);
|
||||
assert.ok(config.testworkbench.editor);
|
||||
@@ -81,7 +82,7 @@ suite('ConfigurationService - Node', () => {
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
const config = service.getConfiguration<{ foo: string }>();
|
||||
const config = service.getValue<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
|
||||
service.dispose();
|
||||
@@ -98,7 +99,7 @@ suite('ConfigurationService - Node', () => {
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
const config = service.getConfiguration<{ foo: string }>();
|
||||
const config = service.getValue<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
|
||||
service.dispose();
|
||||
@@ -110,20 +111,20 @@ suite('ConfigurationService - Node', () => {
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
let config = service.getConfiguration<{ foo: string }>();
|
||||
let config = service.getValue<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
assert.equal(config.foo, 'bar');
|
||||
|
||||
fs.writeFileSync(testFile, '{ "foo": "changed" }');
|
||||
|
||||
// still outdated
|
||||
config = service.getConfiguration<{ foo: string }>();
|
||||
config = service.getValue<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
assert.equal(config.foo, 'bar');
|
||||
|
||||
// force a reload to get latest
|
||||
service.reloadConfiguration().then(() => {
|
||||
config = service.getConfiguration<{ foo: string }>();
|
||||
config = service.getValue<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
assert.equal(config.foo, 'changed');
|
||||
|
||||
@@ -156,7 +157,7 @@ suite('ConfigurationService - Node', () => {
|
||||
});
|
||||
|
||||
let serviceWithoutFile = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, '__testFile'));
|
||||
let setting = serviceWithoutFile.getConfiguration<ITestSetting>();
|
||||
let setting = serviceWithoutFile.getValue<ITestSetting>();
|
||||
|
||||
assert.ok(setting);
|
||||
assert.equal(setting.configuration.service.testSetting, 'isSet');
|
||||
@@ -166,7 +167,7 @@ suite('ConfigurationService - Node', () => {
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
let setting = service.getConfiguration<ITestSetting>();
|
||||
let setting = service.getValue<ITestSetting>();
|
||||
|
||||
assert.ok(setting);
|
||||
assert.equal(setting.configuration.service.testSetting, 'isSet');
|
||||
@@ -174,7 +175,7 @@ suite('ConfigurationService - Node', () => {
|
||||
fs.writeFileSync(testFile, '{ "configuration.service.testSetting": "isChanged" }');
|
||||
|
||||
service.reloadConfiguration().then(() => {
|
||||
let setting = service.getConfiguration<ITestSetting>();
|
||||
let setting = service.getValue<ITestSetting>();
|
||||
|
||||
assert.ok(setting);
|
||||
assert.equal(setting.configuration.service.testSetting, 'isChanged');
|
||||
|
||||
Reference in New Issue
Block a user