mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
addressed PR feedback: renamed 'toRelativePath' to 'convertToRelativePath'
This commit is contained in:
parent
534bb62c59
commit
83919f0a3e
@ -87,7 +87,7 @@ namespace ts {
|
||||
if (diagnostic.file) {
|
||||
let loc = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
|
||||
const relativeFileName = host
|
||||
? toRelativePath(diagnostic.file.fileName, host.getCurrentDirectory(), fileName => host.getCanonicalFileName(fileName))
|
||||
? convertToRelativePath(diagnostic.file.fileName, host.getCurrentDirectory(), fileName => host.getCanonicalFileName(fileName))
|
||||
: diagnostic.file.fileName;
|
||||
|
||||
output += `${ relativeFileName }(${ loc.line + 1 },${ loc.character + 1 }): `;
|
||||
|
||||
@ -2182,7 +2182,7 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function toRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string {
|
||||
export function convertToRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string {
|
||||
return !isRootedDiskPath(absoluteOrRelativePath)
|
||||
? absoluteOrRelativePath
|
||||
: getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /* isAbsolutePathAnUrl */ false);
|
||||
|
||||
@ -377,10 +377,10 @@ class ProjectRunner extends RunnerBase {
|
||||
bug: testCase.bug,
|
||||
rootDir: testCase.rootDir,
|
||||
resolvedInputFiles: ts.map(compilerResult.program.getSourceFiles(), inputFile => {
|
||||
return ts.toRelativePath(inputFile.fileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path));
|
||||
return ts.convertToRelativePath(inputFile.fileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path));
|
||||
}),
|
||||
emittedFiles: ts.map(compilerResult.outputFiles, outputFile => {
|
||||
return ts.toRelativePath(outputFile.emittedFileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path));
|
||||
return ts.convertToRelativePath(outputFile.emittedFileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path));
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user