Skip to content

Commit 076047c

Browse files
committed
Merge remote-tracking branch 'origin/main' into nodenext-polish
2 parents 0f21f71 + 5521f80 commit 076047c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ contact_links:
1111
-
1212
name: "Help! My Types Are Missing!"
1313
about: "This is likely a configuration problem. Check our README"
14-
url: "https://typestrong.org/ts-node/docs/types"
14+
url: "https://typestrong.org/ts-node/docs/troubleshooting#missing-types"
1515
-
1616
name: "TSError or SyntaxError"
17-
about: "These errors come from TypeScript and node, respectively. Use StackOverflow or Discord for usage and configuration help."
17+
about: "These errors come from TypeScript and node, respectively. Use Discussions or Discord for usage and configuration help."
1818
url: "https://typestrong.org/ts-node/docs/troubleshooting"

src/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,9 +1100,13 @@ export function createFromPreloadedConfig(
11001100
};
11011101

11021102
getTypeInfo = (code: string, fileName: string, position: number) => {
1103-
updateMemoryCache(code, fileName);
1103+
const normalizedFileName = normalizeSlashes(fileName);
1104+
updateMemoryCache(code, normalizedFileName);
11041105

1105-
const info = service.getQuickInfoAtPosition(fileName, position);
1106+
const info = service.getQuickInfoAtPosition(
1107+
normalizedFileName,
1108+
position
1109+
);
11061110
const name = ts.displayPartsToString(info ? info.displayParts : []);
11071111
const comment = ts.displayPartsToString(info ? info.documentation : []);
11081112

@@ -1286,9 +1290,10 @@ export function createFromPreloadedConfig(
12861290
};
12871291

12881292
getTypeInfo = (code: string, fileName: string, position: number) => {
1289-
updateMemoryCache(code, fileName);
1293+
const normalizedFileName = normalizeSlashes(fileName);
1294+
updateMemoryCache(code, normalizedFileName);
12901295

1291-
const sourceFile = builderProgram.getSourceFile(fileName);
1296+
const sourceFile = builderProgram.getSourceFile(normalizedFileName);
12921297
if (!sourceFile)
12931298
throw new TypeError(`Unable to read file: ${fileName}`);
12941299

0 commit comments

Comments
 (0)