Open sergey-s-betke opened 4 years ago
How I can set local path to package for linter? May be, in comment?
I believe this error message is coming from the Saxon Processor invoked from an XSLT task, not the linter. The Saxon documentation explains how package names are resolved using a configuration file ‘xsltpackages’ element here.
The location of this Saxon configuration file can be specified in an XSLT task using the ‘configFilename’ property.
Looking at the details more closely I realise that it is the linter causing the error message for f:outline. I need to read up on the xsl:use-package instruction more fully to see what is the best way to remedy this issue.
xsl:use-package
used @name
- is not uri. For Saxon I must previously compile my packages, load, and then compile my xslt.
I think, we need set in config for this extension (in .vscode/settings.json) packages names and file paths.
I will add what you suggest as a first option. Longer term I think I may need to add an extension setting that identifies the Saxon configuration file that I believe is used by Saxon to resolve the package names.
There is now a VSCode extension setting XSLT.resources.xsltPackages
for this purpose.
I try to add XSLT.resources.xsltPackages
to my settings:
https://github.com/test-st-petersburg/DocTemplates/blob/c2231445733ca7e3cf79dddf8873fc21c48b4d54/.vscode/settings.json#L25-L76
But "Go to definition" does not work in XSLT: https://github.com/test-st-petersburg/DocTemplates/blob/c2231445733ca7e3cf79dddf8873fc21c48b4d54/tools/xslt/Build-OOMacroLib.xslt#L8-L10
And one more suggestion: please add one new setting for specifying directories, where your package will automatically search for XSLT packages, determine their names and versions by root node attributes
Apologies, I had missed the last two comments! I will reopen this issue.
But "Go to definition" does not work in XSLT:
Initially, the main goal was to prevent the linter reporting 'undefined' errors for functions, variables etc. defined in another package.
I will look to add 'Goto Definition' (and possibly 'Rename Symbol') support for symbols referenced in the names
attribute of 'xsl:acceptand
xsl:expose`.
The xsl:override
instruction is most likely not fully supported by the VS Code linter so I will need to investigate that also.
Example:
but using
<xsl:apply-templates mode="f:outline" ... />
generate error: "templates for mode not found".