Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
div
classnavigation
HTML Table
width100%
Table Row (tr)
Table Cell (td)
Align
alignleft
Previous
span
classsep
|
span
classtext
Completion Contributor
Table Cell (td)
Align
aligncenter
Top
span
classsep
|
span
classtext
Custom Language Support
Table Cell (td) Align
alignright
Next
span
classsep
|
span
classtext
Find Usages Provider Wiki Markup
{div:class=navigation}
{table:width=100%}
 {tr}
  {td} {align:left}[Previous|Completion Contributor] {span:class=sep}\|{span} {span:class=text}Completion Contributor{span}{align} {td}
  {td} {align:center}[Top|Custom Language Support] {span:class=sep}\|{span} {span:class=text}Custom Language Support{span}{align} {td}
  {td} {align:right}[Next|Find Usages Provider] {span:class=sep}\|{span} {span:class=text}Find Usages Provider{span}{align} {td}
 {tr}
{table}
{div}

References is one of the most important and tricky parts in the implementation of a custom language support. Resolving references means the ability to go from the usage of an element to the declaration of the element, completion, rename refactoring, find usages, etc.

Note
iconfalse

Every element which can be renamed or referenced needs to implement

span
classid
Wiki Markup
{span:class=id}com.intellij.psi.PsiNamedElement{span}
interface.

1. Define a base named element class

...

As you see the IDE now resolves the property and provides completion.

Additionally it supports

Rename
span
classshortcut
Wiki Markup
{span:class=shortcut}Rename{span}
refactoring available from definition and usages.

...

Code Block
<lang.refactoringSupport language="Simple" implementationClass="com.simpleplugin.SimpleRefactoringSupportProvider"/>

11. Run the project

div
classnavigation
HTML Table
width100%
Table Row (tr)
Table Cell (td)
Align
alignleft
Previous
span
classsep
|
span
classtext
Completion Contributor
Table Cell (td)
Align
aligncenter
Top
span
classsep
|
span
classtext
Custom Language Support
Table Cell (td) Align
alignright
Next
span
classsep
|
span
classtext
Find Usages Provider Wiki Markup
{div:class=navigation}
{table:width=100%}
 {tr}
  {td} {align:left}[Previous|Completion Contributor] {span:class=sep}\|{span} {span:class=text}Completion Contributor{span}{align} {td}
  {td} {align:center}[Top|Custom Language Support] {span:class=sep}\|{span} {span:class=text}Custom Language Support{span}{align} {td}
  {td} {align:right}[Next|Find Usages Provider] {span:class=sep}\|{span} {span:class=text}Find Usages Provider{span}{align} {td}
 {tr}
{table}
{div}