diff --git a/CHANGELOG.md b/CHANGELOG.md index df0b840..b54f760 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Unreleased + +### Features + +- Remove reformat action in favor of LSP reformatter + ## 1.0.0 ### Bug Fixes diff --git a/gradle.properties b/gradle.properties index 60369ed..bb83aaa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ pluginUntilBuild = 243.* # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension platformType = WS -platformVersion = 2024.1.1 +platformVersion = 2024.2.4 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP diff --git a/src/main/kotlin/com/github/biomejs/intellijbiome/actions/ReformatWithBiomeAction.kt b/src/main/kotlin/com/github/biomejs/intellijbiome/actions/ReformatWithBiomeAction.kt deleted file mode 100644 index aa6c43a..0000000 --- a/src/main/kotlin/com/github/biomejs/intellijbiome/actions/ReformatWithBiomeAction.kt +++ /dev/null @@ -1,45 +0,0 @@ -package com.github.biomejs.intellijbiome.actions - -import com.github.biomejs.intellijbiome.settings.BiomeSettings -import com.intellij.openapi.actionSystem.ActionUpdateThread -import com.intellij.openapi.actionSystem.AnAction -import com.intellij.openapi.actionSystem.AnActionEvent -import com.intellij.openapi.actionSystem.CommonDataKeys -import com.intellij.openapi.editor.Editor -import com.intellij.openapi.fileEditor.FileDocumentManager -import com.intellij.openapi.project.DumbAware - - -class ReformatWithBiomeAction : AnAction(), DumbAware { - override fun actionPerformed(actionEvent: AnActionEvent) { - val project = actionEvent.project - if (project == null || project.isDefault) return - - val editor: Editor? = actionEvent.getData(CommonDataKeys.EDITOR) - - if (editor != null) { - val documentManager = FileDocumentManager.getInstance() - // We should save document before running Biome, because Biome will read the file from disk and user changes can be lost - if (documentManager.isDocumentUnsaved(editor.document)) { - documentManager.saveDocument(editor.document) - } - val settings = BiomeSettings.getInstance(project) - BiomeCheckRunner().run(project, settings.getEnabledFeatures(), arrayOf(editor.document)) - } - } - - override fun update(actionEvent: AnActionEvent) { - val project = actionEvent.project - if (project == null || project.isDefault) { - actionEvent.presentation.isEnabledAndVisible = false - return - } - - val settings = BiomeSettings.getInstance(project) - actionEvent.presentation.isEnabledAndVisible = settings.isEnabled() - } - - override fun getActionUpdateThread(): ActionUpdateThread { - return ActionUpdateThread.BGT - } -} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 3dd0bb4..32e58ce 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -57,7 +57,7 @@ instance="com.github.biomejs.intellijbiome.settings.BiomeConfigurable"/> + order="after FormatOnSaveInfoProvider, after EsLintOnSaveInfoProvider, before FileWatcherOnSaveInfoProvider, before UploadOnSaveInfoProvider"/> @@ -67,13 +67,6 @@ topic="com.intellij.openapi.vfs.newvfs.BulkFileListener"/> - - - - - - -