Skip to content

Commit

Permalink
Support for vscode-vfs
Browse files Browse the repository at this point in the history
Signed-off-by: Liam Barry Allan <[email protected]>
  • Loading branch information
worksofliam committed Aug 3, 2022
1 parent 28e52de commit 9c9de55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/language/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -217,6 +219,10 @@ module.exports = class Parser {
found = false;
}
break;

default:
found = false;
break;
}
} catch (e) {
found = false;
Expand Down
2 changes: 1 addition & 1 deletion src/vscode/LanguageWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`})`
)
)
}
Expand Down

0 comments on commit 9c9de55

Please sign in to comment.