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

Commits on May 16, 2023

  1. Investigation of impact of unavailability of extension point "org.jet…

    …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 committed May 16, 2023
    Configuration menu
    Copy the full SHA
    413819b View commit details
    Browse the repository at this point in the history

Commits on May 18, 2023

  1. Replace LeafElement.replaceWithText(String) with `LeafElement.rawRe…

    …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)`.
    paul-dingemans committed May 18, 2023
    Configuration menu
    Copy the full SHA
    ac2f0dc View commit details
    Browse the repository at this point in the history
  2. Replace PsiElement.addAfter(PsiElement, PsiElement) on `LeafElement…

    …` 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)`.
    paul-dingemans committed May 18, 2023
    Configuration menu
    Copy the full SHA
    53c082f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8e929ec View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    90cb01b View commit details
    Browse the repository at this point in the history
  5. Replace PsiElement.replace(PsiElement) with a sequence of `AstNode.…

    …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.
    paul-dingemans committed May 18, 2023
    Configuration menu
    Copy the full SHA
    d6a17fc View commit details
    Browse the repository at this point in the history
  6. Replace PsiElement.replace(PsiElement) with a sequence of `AstNode.…

    …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 committed May 18, 2023
    Configuration menu
    Copy the full SHA
    dac1a98 View commit details
    Browse the repository at this point in the history
  7. Fix lint violations

    paul-dingemans committed May 18, 2023
    Configuration menu
    Copy the full SHA
    e840569 View commit details
    Browse the repository at this point in the history