@@ -1159,7 +1159,6 @@ namespace ts {
11591159 useCaseSensitiveFileNames ?( ) : boolean ;
11601160
11611161 readDirectory ( path : string , extensions ?: string [ ] , exclude ?: string [ ] , include ?: string [ ] ) : string [ ] ;
1162- resolvePath ( path : string ) : string ;
11631162 readFile ( path : string , encoding ?: string ) : string ;
11641163 fileExists ( path : string ) : boolean ;
11651164
@@ -4589,7 +4588,7 @@ namespace ts {
45894588 }
45904589
45914590 const absolutePath = normalizeAndPreserveTrailingSlash ( isRootedDiskPath ( fragment ) ? fragment : combinePaths ( scriptPath , fragment ) ) ;
4592- const baseDirectory = host . resolvePath ( getDirectoryPath ( absolutePath ) ) ;
4591+ const baseDirectory = getDirectoryPath ( absolutePath ) ;
45934592 const ignoreCase = ! ( host . useCaseSensitiveFileNames && host . useCaseSensitiveFileNames ( ) ) ;
45944593
45954594 if ( directoryProbablyExists ( baseDirectory , host ) ) {
@@ -4827,7 +4826,14 @@ namespace ts {
48274826 } ) ;
48284827 }
48294828 else if ( host . getDirectories && options . typeRoots ) {
4830- const absoluteRoots = map ( options . typeRoots , rootDirectory => getAbsoluteProjectPath ( rootDirectory , host , options . project ) ) ;
4829+ const absoluteRoots = map ( options . typeRoots , rootDirectory => {
4830+ if ( isRootedDiskPath ( rootDirectory ) ) {
4831+ return normalizePath ( rootDirectory ) ;
4832+ }
4833+
4834+ const basePath = options . project || host . getCurrentDirectory ( ) ;
4835+ return normalizePath ( combinePaths ( basePath , rootDirectory ) ) ;
4836+ } ) ;
48314837 forEach ( absoluteRoots , absoluteRoot => getCompletionEntriesFromDirectories ( host , options , absoluteRoot , result ) ) ;
48324838 }
48334839
@@ -4842,18 +4848,6 @@ namespace ts {
48424848 return result ;
48434849 }
48444850
4845- function getAbsoluteProjectPath ( path : string , host : LanguageServiceHost , projectDir ?: string ) {
4846- if ( isRootedDiskPath ( path ) ) {
4847- return normalizePath ( path ) ;
4848- }
4849-
4850- if ( projectDir ) {
4851- return normalizePath ( combinePaths ( projectDir , path ) ) ;
4852- }
4853-
4854- return normalizePath ( host . resolvePath ( path ) ) ;
4855- }
4856-
48574851 function getCompletionEntriesFromDirectories ( host : LanguageServiceHost , options : CompilerOptions , directory : string , result : ImportCompletionEntry [ ] ) {
48584852 if ( host . getDirectories && directoryProbablyExists ( directory , host ) ) {
48594853 forEach ( host . getDirectories ( directory ) , typeDirectory => {
0 commit comments