Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into nodenext-polish
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed May 20, 2022
2 parents 0f21f71 + 5521f80 commit 076047c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
13 changes: 9 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,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 : []);

Expand Down Expand Up @@ -1286,9 +1290,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}`);

Expand Down

0 comments on commit 076047c

Please sign in to comment.