sczerwinski / wavefront-obj-intellij-plugin

IntelliJ platform plugin for Wavefront OBJ format
https://plugins.jetbrains.com/plugin/14843-wavefront-obj
Apache License 2.0
13 stars 1 forks source link

Fix deprecations in IC-2020.3 #44

Closed sczerwinski closed 3 years ago

sczerwinski commented 3 years ago

Steps

  1. Go to https://plugins.jetbrains.com/plugin/14843-wavefront-obj/versions
  2. Run plugin verification with latest IDE version (203.*)

Result

IntelliJ IDEA Ultimate IU-203.5600.34 Compatible. 1 usage of scheduled for removal API and 3 usages of deprecated API

Expected Result

Compatible

IDE Details

IntelliJ IDEA Ultimate IU-203.5600.34

sczerwinski commented 3 years ago

In ObjFormattingModelBuilder, change overridden createModel(...) method:

override fun createModel(formattingContext: FormattingContext): FormattingModel =
    FormattingModelProvider.createFormattingModelForPsiFile(
        formattingContext.psiElement.containingFile,
        ObjBlock(
            node = formattingContext.psiElement.node,
            spacingBuilder = createSpaceBuilder(formattingContext.codeStyleSettings)
        ),
        formattingContext.codeStyleSettings
    )
sczerwinski commented 3 years ago

IconLoader.getIcon(String) should be replaced with IconLoader.getIcon(String, Class), which specifies the class to be used to get a ClassLoader.

sczerwinski commented 3 years ago

Collection.max() should be replaced with Collection.maxOrNull().

sczerwinski commented 3 years ago

Changes to ObjFormattingModelBuilder require platform version 2020.3. Building with platform version 2020.3 requires Java 11.

sczerwinski commented 3 years ago

Also: PsiManager.addPsiTreeChangeListener(...)