psi_cookbook.md: Format code snippet

This commit is contained in:
Karol Lewandowski 2023-10-18 15:52:54 +02:00
parent 0b9985dfb4
commit 1d13a1ff1a

View File

@ -1,7 +1,7 @@
# PSI Cookbook
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# PSI Cookbook
<link-summary rel="excerpt"/>
<p id="excerpt">
This page gives recipes for the most common operations for working with the PSI (Program Structure Interface).
@ -56,9 +56,9 @@ Unlike [Developing Custom Language Plugins](custom_language_support.md), it is a
### How do I get a reference to the containing package of a Java class?
```java
PsiJavaFile javaFile = (PsiJavaFile)psiClass.getContainingFile();
PsiPackage psiPackage = JavaPsiFacade.getInstance(project)
.findPackage(javaFile.getPackageName());
PsiJavaFile javaFile = (PsiJavaFile) psiClass.getContainingFile();
PsiPackage psiPackage = JavaPsiFacade.getInstance(project)
.findPackage(javaFile.getPackageName());
```
or