Skip to content

Commit

Permalink
use node.js path#relative (for #31667)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Nov 17, 2017
1 parent 18d7e50 commit 4a8327a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -23,6 +23,7 @@ import * as extfs from 'vs/base/node/extfs';
import { JSONEditingService } from 'vs/workbench/services/configuration/node/jsonEditingService';
import { WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { relative } from 'path';

// node.hs helper functions

Expand Down Expand Up @@ -332,7 +333,7 @@ export class FolderConfiguration extends Disposable {

private toFolderRelativePath(resource: URI, toOSPath?: boolean): string {
if (this.contains(resource)) {
return paths.normalize(paths.relative(this.folder.fsPath, resource.fsPath), toOSPath);
return paths.normalize(relative(this.folder.fsPath, resource.fsPath), toOSPath);
}

return null;
Expand Down
Expand Up @@ -17,6 +17,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi
import { toResource } from 'vs/workbench/common/editor';
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { relative } from 'path';

export class ConfigurationResolverService implements IConfigurationResolverService {
_serviceBrand: any;
Expand Down Expand Up @@ -69,7 +70,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
}

private get relativeFile(): string {
return (this.workspaceRoot) ? paths.relative(this.workspaceRoot, this.file) : this.file;
return (this.workspaceRoot) ? relative(this.workspaceRoot, this.file) : this.file;
}

private get fileBasename(): string {
Expand Down

0 comments on commit 4a8327a

Please sign in to comment.