diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index b32bf9597..8aa6147cf 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -11,8 +11,8 @@ contact_links: - name: "Help! My Types Are Missing!" about: "This is likely a configuration problem. Check our README" - url: "https://typestrong.org/ts-node/docs/types" + url: "https://typestrong.org/ts-node/docs/troubleshooting#missing-types" - name: "TSError or SyntaxError" - about: "These errors come from TypeScript and node, respectively. Use StackOverflow or Discord for usage and configuration help." + about: "These errors come from TypeScript and node, respectively. Use Discussions or Discord for usage and configuration help." url: "https://typestrong.org/ts-node/docs/troubleshooting" diff --git a/src/index.ts b/src/index.ts index dafc9f85d..b4ca47e47 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1071,9 +1071,13 @@ export function createFromPreloadedConfig( }; getTypeInfo = (code: string, fileName: string, position: number) => { - updateMemoryCache(code, fileName); + const normalizedFileName = normalizeSlashes(fileName); + updateMemoryCache(code, normalizedFileName); - const info = service.getQuickInfoAtPosition(fileName, position); + const info = service.getQuickInfoAtPosition( + normalizedFileName, + position + ); const name = ts.displayPartsToString(info ? info.displayParts : []); const comment = ts.displayPartsToString(info ? info.documentation : []); @@ -1257,9 +1261,10 @@ export function createFromPreloadedConfig( }; getTypeInfo = (code: string, fileName: string, position: number) => { - updateMemoryCache(code, fileName); + const normalizedFileName = normalizeSlashes(fileName); + updateMemoryCache(code, normalizedFileName); - const sourceFile = builderProgram.getSourceFile(fileName); + const sourceFile = builderProgram.getSourceFile(normalizedFileName); if (!sourceFile) throw new TypeError(`Unable to read file: ${fileName}`);