提交 78615c0e 编写于 作者: B Benjamin Pasero

remove unused code

上级 92b85fe7
......@@ -311,14 +311,6 @@ export function isUNC(path: string): boolean {
return true;
}
function isPosixAbsolute(path: string): boolean {
return path && path[0] === '/';
}
export function makePosixAbsolute(path: string): string {
return isPosixAbsolute(normalize(path)) ? path : sep + path;
}
// Reference: https://en.wikipedia.org/wiki/Filename
const INVALID_FILE_CHARS = isWindows ? /[\\/:\*\?"<>\|]/g : /[\\/]/g;
const WINDOWS_FORBIDDEN_NAMES = /^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])$/i;
......
......@@ -117,15 +117,6 @@ suite('Paths', () => {
});
test('makeAbsolute', () => {
assert.equal(paths.makePosixAbsolute('foo'), '/foo');
assert.equal(paths.makePosixAbsolute('foo/bar'), '/foo/bar');
assert.equal(paths.makePosixAbsolute('foo/bar/'), '/foo/bar/');
assert.equal(paths.makePosixAbsolute('/foo/bar'), '/foo/bar');
assert.equal(paths.makePosixAbsolute('/'), '/');
assert.equal(paths.makePosixAbsolute(''), '/');
});
test('basename', () => {
assert.equal(paths.basename('foo/bar'), 'bar');
assert.equal(paths.basename('foo\\bar'), 'bar');
......
......@@ -100,7 +100,7 @@ export class TestContextService implements IWorkspaceContextService {
}
public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string {
return paths.makePosixAbsolute(paths.normalize(resource.fsPath.substr('c:'.length), toOSPath));
return makePosixAbsolute(paths.normalize(resource.fsPath.substr('c:'.length), toOSPath));
}
public toResource(workspaceRelativePath: string): URI {
......@@ -108,6 +108,14 @@ export class TestContextService implements IWorkspaceContextService {
}
}
function isPosixAbsolute(path: string): boolean {
return path && path[0] === '/';
}
function makePosixAbsolute(path: string): string {
return isPosixAbsolute(paths.normalize(path)) ? path : paths.sep + path;
}
export class TestTextFileService extends TextFileService {
public cleanupBackupsBeforeShutdownCalled: boolean;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册