Skip to content

Commit 97b5eb4

Browse files
Fix bug trying to retrieve file content for not-open files
1 parent 2188f70 commit 97b5eb4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

libs/vscode/server/src/lib/helpers/get-file-strings.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ export async function GetFileStrings(uri: string): Promise<string> {
2020
if (doc !== undefined) {
2121
strings = doc.getText();
2222
} else {
23+
/** Get fs path */
24+
const fsPath = GetFSPath(uri);
25+
2326
/**
2427
* Silently ignore when the file is deleted which is handled
2528
* elsewhere
2629
*/
27-
if (existsSync(uri)) {
28-
strings = readFileSync(GetFSPath(uri), 'utf8');
30+
if (existsSync(fsPath)) {
31+
strings = readFileSync(GetFSPath(fsPath), 'utf8');
2932
}
3033
}
3134

0 commit comments

Comments
 (0)