Skip to content

Commit 25748fd

Browse files
committed
Always add files to sources before checking output
1 parent 02cb67a commit 25748fd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ts-node.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,14 @@ export function register (opts?: Options) {
119119
)
120120
}
121121

122-
function compile (fileName: string) {
122+
function addFileName (fileName: string) {
123123
// Add to the `files` object before compiling - otherwise our file will
124124
// not found (unless it's in our `tsconfig.json` file).
125125
files[fileName] = true
126+
}
127+
128+
function compile (fileName: string) {
129+
addFileName(fileName)
126130

127131
const diagnostics = getDiagnostics(service, fileName, options)
128132

@@ -145,6 +149,8 @@ export function register (opts?: Options) {
145149
}
146150

147151
function getTypeInfo (fileName: string, position: number) {
152+
addFileName(fileName)
153+
148154
const info = service.getQuickInfoAtPosition(fileName, position)
149155
const name = ts.displayPartsToString(info.displayParts || [])
150156
const comment = ts.displayPartsToString(info.documentation || [])

0 commit comments

Comments
 (0)