You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the document position to obtain the TokenStyle associated with the PhraseNodeAttributeKey attribute that was applied by avail.anvil.RenderingEngine.applyStylesAndPhrasePaths
Use the TokenStyle to obtain the name / symbol (NameInModule) and token index / message part index
Use these to interrogate a Repository and a NamesIndex to obtain all usages associated with the name / symbol
The message part index (usually called tokenIndexInName) is currently used only to highlight the message part that the user specified. It does not appear that LSP (or lsp4j) are capable of transmitting this additional information as opaque client data. If we want to preserve the current behavior, then we will need to reply with LocationLinks rather than mere Locations, and use the MessageSplitter (or something akin but with pared down functionality) in the IDEA plugin to identify and highlight the message part. The current behavior was nice enough to build in Swing/Anvil in the first place, but is likely to require significant additional effort to port to IDEA, so we may want to consider strict parity as a stretch goal.
The following items count as usages:
Lexical sends appearing directly in source code
Generated sends appearing in macro substitution phrases (produced by executing macro sends during compilation)
The text was updated successfully, but these errors were encountered:
Support for locating the usages of the name at the specified module coordinates. Mandated by Find References Request.
This amounts to implementing
org.eclipse.lsp4j.TextDocumentService.references
.For guidance, the places to begin digging into Swing/Anvil are:
avail.anvil.AvailEditor.handleClick
avail.anvil.AvailWorkbench.navigateToSendersOfName
avail.anvil.AvailWorkbench.allUsagesThen
avail.anvil.RenderingEngine.applyStylesAndPhrasePaths
Currently, the technique is:
TokenStyle
associated with thePhraseNodeAttributeKey
attribute that was applied byavail.anvil.RenderingEngine.applyStylesAndPhrasePaths
TokenStyle
to obtain the name / symbol (NameInModule
) and token index / message part indexRepository
and aNamesIndex
to obtain all usages associated with the name / symbolThe message part index (usually called
tokenIndexInName
) is currently used only to highlight the message part that the user specified. It does not appear that LSP (orlsp4j
) are capable of transmitting this additional information as opaque client data. If we want to preserve the current behavior, then we will need to reply withLocationLink
s rather than mereLocation
s, and use theMessageSplitter
(or something akin but with pared down functionality) in the IDEA plugin to identify and highlight the message part. The current behavior was nice enough to build in Swing/Anvil in the first place, but is likely to require significant additional effort to port to IDEA, so we may want to consider strict parity as a stretch goal.The following items count as usages:
The text was updated successfully, but these errors were encountered: