diff --git a/newt-vscode/src/extension.ts b/newt-vscode/src/extension.ts index 0d55067..5af64cf 100644 --- a/newt-vscode/src/extension.ts +++ b/newt-vscode/src/extension.ts @@ -128,7 +128,12 @@ export function activate(context: vscode.ExtensionContext) { console.log(`entry ${name} not found`); return null; } - let uri = vscode.Uri.file(entry.fc.file); + const root = vscode.workspace.getWorkspaceFolder(document.uri); + if (!root) { + console.error("Workspace folder not found"); + return null; + } + let uri = vscode.Uri.file(path.join(root.uri.fsPath, entry.fc.file)); let start = new vscode.Position(entry.fc.line, entry.fc.col); let range = new vscode.Range(start, start); return new vscode.Location(uri, range); diff --git a/src/Main.newt b/src/Main.newt index c0a7733..d3b373e 100644 --- a/src/Main.newt +++ b/src/Main.newt @@ -27,7 +27,8 @@ primNS = ("Prim" :: Nil) jsonTopContext : M Json jsonTopContext = do top <- getTop - pure $ JsonObj (("context", JsonArray (map jsonDef $ listValues top.defs)) :: Nil) + let defs = join $ map (\mod => listValues mod.modDefs) $ listValues top.modules + pure $ JsonObj (("context", JsonArray (map jsonDef $ defs)) :: Nil) where jsonDef : TopEntry -> Json -- There is no FC here...