提交 a99b64ae 编写于 作者: B Benjamin Pasero

paths - avoid posix usages

上级 5038a82f
......@@ -8,7 +8,7 @@ import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensio
import { ILogService } from 'vs/platform/log/common/log';
import { fork, ChildProcess } from 'child_process';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { posix } from 'vs/base/common/path';
import { join } from 'vs/base/common/path';
import { Limiter } from 'vs/base/common/async';
import { Event } from 'vs/base/common/event';
import { Schemas } from 'vs/base/common/network';
......@@ -45,7 +45,7 @@ export class ExtensionsLifecycle extends Disposable {
this.logService.warn(extension.identifier.id, extension.manifest.version, `${scriptKey} should be a node script`);
return null;
}
return { script: posix.join(extension.location.fsPath, script[1]), args: script.slice(2) || [] };
return { script: join(extension.location.fsPath, script[1]), args: script.slice(2) || [] };
}
return null;
}
......@@ -130,6 +130,6 @@ export class ExtensionsLifecycle extends Disposable {
}
private getExtensionStoragePath(extension: ILocalExtension): string {
return posix.join(this.environmentService.globalStorageHome, extension.identifier.id.toLowerCase());
return join(this.environmentService.globalStorageHome, extension.identifier.id.toLowerCase());
}
}
......@@ -16,7 +16,7 @@ import product from 'vs/platform/node/product';
import { distinct, equals } from 'vs/base/common/arrays';
import { Event, Emitter } from 'vs/base/common/event';
import { Schemas } from 'vs/base/common/network';
import { posix } from 'vs/base/common/path';
import { join } from 'vs/base/common/path';
interface ILanguagePack {
hash: string;
......@@ -105,7 +105,7 @@ class LanguagePacksCache extends Disposable {
@ILogService private readonly logService: ILogService
) {
super();
this.languagePacksFilePath = posix.join(environmentService.userDataPath, 'languagepacks.json');
this.languagePacksFilePath = join(environmentService.userDataPath, 'languagepacks.json');
this.languagePacksFileLimiter = new Queue();
}
......@@ -151,7 +151,7 @@ class LanguagePacksCache extends Disposable {
languagePack.extensions.push({ extensionIdentifier, version: extension.manifest.version });
}
for (const translation of localizationContribution.translations) {
languagePack.translations[translation.id] = posix.join(extension.location.fsPath, translation.path);
languagePack.translations[translation.id] = join(extension.location.fsPath, translation.path);
}
}
}
......
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { tmpdir } from 'os';
import { posix } from 'vs/base/common/path';
import { join } from 'vs/base/common/path';
import * as vscode from 'vscode';
import { URI } from 'vs/base/common/uri';
import { isMalformedFileUri } from 'vs/base/common/resources';
......@@ -130,7 +130,7 @@ CommandsRegistry.registerCommand(SetEditorLayoutAPICommand.ID, adjustHandler(Set
CommandsRegistry.registerCommand('_workbench.downloadResource', function (accessor: ServicesAccessor, resource: URI) {
const downloadService = accessor.get(IDownloadService);
const location = posix.join(tmpdir(), generateUuid());
const location = join(tmpdir(), generateUuid());
return downloadService.download(resource, location).then(() => URI.file(location));
});
\ No newline at end of file
......@@ -6,7 +6,7 @@
import { MainContext, MainThreadOutputServiceShape, IMainContext, ExtHostOutputServiceShape } from './extHost.protocol';
import * as vscode from 'vscode';
import { URI } from 'vs/base/common/uri';
import { posix } from 'vs/base/common/path';
import { join } from 'vs/base/common/path';
import { OutputAppender } from 'vs/workbench/contrib/output/node/outputAppender';
import { toLocalISOString } from 'vs/base/common/date';
import { Event, Emitter } from 'vs/base/common/event';
......@@ -103,7 +103,7 @@ export class ExtHostOutputChannelBackedByFile extends AbstractExtHostOutputChann
constructor(name: string, outputDir: string, proxy: MainThreadOutputServiceShape) {
const fileName = `${ExtHostOutputChannelBackedByFile._namePool++}-${name}`;
const file = URI.file(posix.join(outputDir, `${fileName}.log`));
const file = URI.file(join(outputDir, `${fileName}.log`));
super(name, false, file, proxy);
this._appender = new OutputAppender(fileName, file.fsPath);
......@@ -150,7 +150,7 @@ export class ExtHostOutputService implements ExtHostOutputServiceShape {
private _visibleChannelDisposable: IDisposable;
constructor(logsLocation: URI, mainContext: IMainContext) {
this._outputDir = posix.join(logsLocation.fsPath, `output_logging_${toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')}`);
this._outputDir = join(logsLocation.fsPath, `output_logging_${toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')}`);
this._proxy = mainContext.getProxy(MainContext.MainThreadOutputService);
}
......
......@@ -236,7 +236,7 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe
case 'relativeFile':
if (folderUri) {
return resolvedValue = paths.posix.normalize(paths.relative(folderUri.fsPath, filePath));
return resolvedValue = paths.normalize(paths.relative(folderUri.fsPath, filePath));
}
return resolvedValue = filePath;
......
......@@ -101,7 +101,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
@ILifecycleService private readonly _lifecycleService: ILifecycleService
) {
super();
this._extensionHostLogsLocation = URI.file(path.posix.join(this._environmentService.logsPath, `exthost${this._windowService.getCurrentWindowId()}`));
this._extensionHostLogsLocation = URI.file(path.join(this._environmentService.logsPath, `exthost${this._windowService.getCurrentWindowId()}`));
this._registry = null;
this._installedExtensionsReady = new Barrier();
this._isDev = !this._environmentService.isBuilt || this._environmentService.isExtensionDevelopment;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册