Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigation of impact of kotlin 1.9 treeCopyHandler #2031

Closed
wants to merge 8 commits into from

Conversation

paul-dingemans
Copy link
Collaborator

Description

Investigation of impact of unavailability of extension point "org.jetbrains.kotlin.com.intellij.treeCopyHandler" in kotlin 1.9 (#1981)

Some tests are failing as a result of this.

DO NOT MERGE TO MASTER

Checklist

  • PR description added
  • tests are added
  • KtLint has been applied on source code itself and violations are fixed
  • documentation is updated
  • CHANGELOG.md is updated

In case of adding a new rule:

…brains.kotlin.com.intellij.treeCopyHandler" in kotlin 1.9

Some tests are failing as a result of this.

DO NOT MERGE TO MASTER
@paul-dingemans paul-dingemans marked this pull request as draft May 16, 2023 15:53
…placeWithText(String)`

Up until Kotlin 1.8 the KotlinPsiFactory registered the treeCopyHandler extension point which is needed in order to use the `LeafElement.replaceWithText(String)`. With the Kotlin 1.9 it is no longer possible to register this extension point which results in exception.

The exception does not occur when using method `LeafElement.rawReplaceWithText(String)`.
…` with `AstNode.addChild(AstNode, AstNode)`

Up until Kotlin 1.8 the KotlinPsiFactory registered the treeCopyHandler extension point which is needed in order to use the `PsiElement.addAfter(PsiLeaf, PsiLeaf)`. With the Kotlin 1.9 it is no longer possible to register this extension point which results in exception.

The exception does not occur when using method `AstNode.addChild(AstNode, AstNode)`. Note that this method inserts the new node (first) argument *before* the second argument node and as of that is not a simple replacement of the `PsiElement.addAfter(PsiElement, PsiElement)`.
…addChild(AstNode, AstNode)` and `AstNode.removeChild(AstNode)`

Up until Kotlin 1.8 the KotlinPsiFactory registered the treeCopyHandler extension point which is needed in order to use the `PsiElement.replace(PsiElement)`. With the Kotlin 1.9 it is no longer possible to register this extension point which results in exception.
…addChild(AstNode, AstNode)` and `AstNode.removeChild(AstNode)` [bugfix]

Up until Kotlin 1.8 the KotlinPsiFactory registered the treeCopyHandler extension point which is needed in order to use the `PsiElement.replace(PsiElement)`. With the Kotlin 1.9 it is no longer possible to register this extension point which results in exception.
@paul-dingemans
Copy link
Collaborator Author

Closed in favour of #2044

@paul-dingemans paul-dingemans deleted the 1981-kotlin-1.9 branch December 2, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant