DeltaXML / vscode-xslt-tokenizer

VSCode extension for highlighting XSLT and XPath (upto 3.0/3.1)
MIT License
46 stars 4 forks source link

Goto Definition in modes not work #107

Closed kvdubina closed 2 years ago

kvdubina commented 2 years ago

in Futures: Goto Definition — For all symbol references like variables, parameters, functions, modes, accumulators etc.

Ехаmple:

<xsl:apply-templates select="node" mode="mode1"/>

<xsl:template match="node" mode="mode1">
<xsl:value-of select="name"/>
</xsl:template>

Goto on mode1 in does not go to

But it works for variables

Video https://user-images.githubusercontent.com/16345533/189931333-aa1f8459-ebe8-43e4-9585-ee12d9ff034b.mov

pgfearo commented 2 years ago

Thanks for reporting this bug. In XSLT, modes are defined quite differently than other symbols, this possibly accounts for the problem.

With other symbols there can be only one definition, with XSLT I suppose we can say that there's a mode definition on each xsl:template instruction where a mode name is specified. The xsl:mode instruction should also be considered a 'definition' if it has a name attribute.

The xsl:apply-templates instruction with a named mode can therefore be considered a symbol reference.

pgfearo commented 2 years ago

The Rename Symbol feature is related to this. There's a bug when renaming a mode - the mode name change is repeated at the cursor position

pgfearo commented 2 years ago

Summary of fixes

Goto Definition - for modes