mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
psi_elements.md: update
This commit is contained in:
parent
27c2a04f01
commit
0477c67201
@ -13,7 +13,7 @@ The [`PsiElement`](upsource:///platform/core-api/src/com/intellij/psi/PsiElement
|
|||||||
|
|
||||||
## How do I get a PSI element?
|
## How do I get a PSI element?
|
||||||
|
|
||||||
* From an Action: `e.getData(LangDataKeys.PSI_ELEMENT)`.
|
* From an Action: `e.getData(CommonDataKeys.PSI_ELEMENT)`.
|
||||||
Note: if an editor is currently open and the element under caret is a [reference](psi_references.md), this will return the result of resolving the reference.
|
Note: if an editor is currently open and the element under caret is a [reference](psi_references.md), this will return the result of resolving the reference.
|
||||||
This may or may not be what you need.
|
This may or may not be what you need.
|
||||||
* From a file by offset: `PsiFile.findElementAt()`.
|
* From a file by offset: `PsiFile.findElementAt()`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user