From 9c9de5575f9690c219bc09948b71049b0dbe88fa Mon Sep 17 00:00:00 2001 From: Liam Barry Allan Date: Wed, 3 Aug 2022 16:05:41 -0400 Subject: [PATCH] Support for vscode-vfs Signed-off-by: Liam Barry Allan --- src/language/parser.js | 10 ++++++++-- src/vscode/LanguageWorker.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/language/parser.js b/src/language/parser.js index 6d24b9b3..8a5c1d47 100644 --- a/src/language/parser.js +++ b/src/language/parser.js @@ -121,7 +121,7 @@ module.exports = class Parser { /** * @param {vscode.Uri} workingUri Path being worked with * @param {string} getPath IFS or member path to fetch - * @returns {Promise<{lines: string[], found: boolean, uri: vscode.Uri, path: string, type: "member"|"streamfile"|"file"}>} + * @returns {Promise<{lines: string[], found: boolean, uri: vscode.Uri, path: string, type: string}>} */ async getContent(workingUri, getPath) { //const hrstart = process.hrtime(); @@ -133,7 +133,8 @@ module.exports = class Parser { let found = true; let attemptedPath; - let {type, memberPath, finishedPath} = Generic.getPathInfo(workingUri, getPath); + const type = workingUri.scheme; + const {finishedPath} = Generic.getPathInfo(workingUri, getPath); try { let doc; @@ -178,6 +179,7 @@ module.exports = class Parser { break; case `file`: + case `vscode-vfs`: // We have to find the file because of the case insensitivity if (getPath.startsWith(`'`)) getPath = getPath.substring(1); if (getPath.endsWith(`'`)) getPath = getPath.substring(0, getPath.length - 1); @@ -217,6 +219,10 @@ module.exports = class Parser { found = false; } break; + + default: + found = false; + break; } } catch (e) { found = false; diff --git a/src/vscode/LanguageWorker.js b/src/vscode/LanguageWorker.js index e6b1988c..d5cba3d1 100644 --- a/src/vscode/LanguageWorker.js +++ b/src/vscode/LanguageWorker.js @@ -173,7 +173,7 @@ module.exports = class LanguageWorker { return new vscode.Hover( new vscode.MarkdownString( - `\`'${include.path}'\` (${include.type}${include.found ? `` : `, not found`})` + (include.path ? `\`${include.path}\`` : linePieces[1]) + `(${include.type}${include.found ? `` : `, not found`})` ) ) }