eclipse-lemminx/lemminx

Set root of document tree for XML references

Opened this issue · 0 comments

The XML project I'm involved in (PreTeXt) encourages users to use modular files via xi:include. Using the XML vscode plugin, we can set the names for references (in our case, set with xml:id and called with xref ref=). With the correct settings, the suggestions for references when calling one looks down the document tree and includes any ids that are in documents included with the xi:include. However, not surprisingly, you do not see suggestions for ids above the file you are working in.

I understand that scanning the entire project for reference ids is prohibitively time intensive. What about allowing a project to specify a root document though, from which all reference ids are sourced? I assume the language server now looks at the current document to build this list; my suggestion would allow the option of having a static file replace that "current document". This file could then be set by a plugin; if it isn't present, then the current file is used as the root.