mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPF-CR-1427, minor stylistic changes
(cherry picked from commit 608dd146c0eb947e042a782eb29f95c97a2bb483) IJ-MR-12967 GitOrigin-RevId: 1cd1ef26a005b0bf4056fbeb2fc4b492bb8c065a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
22cb210fe5
commit
dc7708188d
@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.renderer.render
|
||||
* A quick fix to add file-level annotations, e.g. `@file:OptIn(SomeExperimentalAnnotation::class)`.
|
||||
*
|
||||
* The fix either creates a new annotation or adds the argument to the existing annotation entry.
|
||||
* It does not check whether the annotation class allows duplicating annotations, it is the caller responsibility.
|
||||
* It does not check whether the annotation class allows duplicating annotations; it is the caller responsibility.
|
||||
* For example, only one `@file:OptIn(...)` annotation is allowed, so if this annotation entry already exists,
|
||||
* the caller should pass the non-null smart pointer to it as the `existingAnnotationEntry` argument.
|
||||
*
|
||||
@@ -52,7 +52,7 @@ class AddFileAnnotationFix(
|
||||
|
||||
val psiFactory = KtPsiFactory(fileToAnnotate)
|
||||
if (fileToAnnotate.fileAnnotationList == null) {
|
||||
// If there is no existing file-level annotations, create an annotation list with the new annotation
|
||||
// If there are no existing file-level annotations, create an annotation list with the new annotation
|
||||
val newAnnotationList = psiFactory.createFileAnnotationListWithAnnotation(annotationText)
|
||||
val createdAnnotationList = replaceFileAnnotationList(fileToAnnotate, newAnnotationList)
|
||||
fileToAnnotate.addAfter(psiFactory.createWhiteSpace("\n"), createdAnnotationList)
|
||||
|
||||
Reference in New Issue
Block a user