File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed
language-service/lib/plugins
typescript-plugin/lib/requests Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export function create(
5555 const lastImportNode = getLastImportNode ( ts , script . ast ) ;
5656 const incomingFileName = URI . parse ( importUri ) . fsPath . replace ( / \\ / g, '/' ) ;
5757
58- let importPath : string | undefined ;
58+ let importPath : string | null | undefined ;
5959
6060 const serviceScript = info . script . generated . languagePlugin . typescript ?. getServiceScript ( info . root ) ;
6161 if ( serviceScript ) {
@@ -66,13 +66,11 @@ export function create(
6666 serviceScript . code . snapshot ,
6767 ) ;
6868 const preferences = await getUserPreferences ( context , tsDocument ) ;
69- importPath = (
70- await getImportPathForFile (
71- info . root . fileName ,
72- incomingFileName ,
73- preferences ,
74- ) ?? { }
75- ) . path ;
69+ importPath = await getImportPathForFile (
70+ info . root . fileName ,
71+ incomingFileName ,
72+ preferences ,
73+ ) ;
7674 }
7775
7876 if ( ! importPath ) {
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ export function getImportPathForFile(
77 fileName : string ,
88 incomingFileName : string ,
99 preferences : ts . UserPreferences ,
10- ) : { path ?: string } {
10+ ) : string | undefined {
1111 const incomingFile = program . getSourceFile ( incomingFileName ) ;
1212 const sourceFile = program . getSourceFile ( fileName ) ;
1313 if ( ! program || ! sourceFile || ! incomingFile ) {
14- return { } ;
14+ return ;
1515 }
1616
1717 const getModuleSpecifiersWithCacheInfo : (
@@ -36,7 +36,5 @@ export function getImportPathForFile(
3636 preferences ,
3737 ) ;
3838
39- return {
40- path : moduleSpecifiers [ 0 ] ,
41- } ;
39+ return moduleSpecifiers [ 0 ] ;
4240}
You can’t perform that action at this time.
0 commit comments