mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 13:03:42 +01:00
introduce IEnvironmentService
This commit is contained in:
@@ -13,7 +13,6 @@ import json = require('vs/base/common/json');
|
||||
import objects = require('vs/base/common/objects');
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
|
||||
|
||||
export interface ISettings {
|
||||
settings: any;
|
||||
@@ -42,10 +41,11 @@ export class UserSettings {
|
||||
this.registerWatchers();
|
||||
}
|
||||
|
||||
public static getValue(contextService: IWorkspaceContextService, key: string, fallback?: any): TPromise<any> {
|
||||
return new TPromise((c, e) => {
|
||||
const appSettingsPath = contextService.getConfiguration().env.appSettingsPath;
|
||||
public static getValue(userDataPath: string, key: string, fallback?: any): TPromise<any> {
|
||||
// TODO@joao cleanup!
|
||||
const appSettingsPath = path.join(userDataPath, 'User', 'settings.json');
|
||||
|
||||
return new TPromise((c, e) => {
|
||||
fs.readFile(appSettingsPath, (error /* ignore */, fileContents) => {
|
||||
let root = Object.create(null);
|
||||
let content = fileContents ? fileContents.toString() : '{}';
|
||||
|
||||
Reference in New Issue
Block a user