Skip to content

Commit

Permalink
[mod] doclink api
Browse files Browse the repository at this point in the history
  • Loading branch information
apb2006 committed May 14, 2023
1 parent 53ce5f0 commit 21efcde
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/compiler/static_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ exports.StaticContext = function (parent, pos, processor) {
defaultElementNamespace: '',
namespaces: namespaces,
availableModuleNamespaces: [],
locations: {}, // ns:{location:..,pos:..}
locations: {}, // ns:{url:..,pos:..}
importModule: function (uri, prefix, pos,ats) {
if (this !== this.root) {
throw new Error('Function not invoked from the root static context.');
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ exports.Translator = function(rootStcx, ast){
if(!seenAt) return;
var uri = TreeOps.flatten(node);
uri = uri.substring(1, uri.length - 1);
ats.push({location:uri,pos: node.pos});
ats.push({uri:uri,range: node.pos});
}});
this.visitChildren(node, Handlers.ModuleImport(translator, rootStcx, node,ats));
return true;
Expand Down
8 changes: 6 additions & 2 deletions lib/xqlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ exports.XQLint = function (source, opts) {
};

this.getDocLinks = function () {
const dl=sctx.getDocLinks();
return dl;
const doclinks=[];
for (const [key, value] of Object.entries(sctx.getDocLinks())) {
//console.log(key, value);
doclinks.push(value);
}
return doclinks;
};

var markers = [];
Expand Down

0 comments on commit 21efcde

Please sign in to comment.