diff --git a/.idea/icon.svg b/.idea/icon.svg
new file mode 100644
index 0000000..ac688d8
--- /dev/null
+++ b/.idea/icon.svg
@@ -0,0 +1,15 @@
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 07d55e0..7c96c2d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,16 +2,12 @@
# idea-clang-format Changelog
-[Unreleased]
-
-## [1.0.0] - 2024-11-02
+## [Unreleased]
### Added
+- Initial scaffold created from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)
- Language support for `.clang-format` files
- Detect indentation style and column limit from `.clang-format` file
- Format code using `clang-format` binary
- Settings page to configure `clang-format` binary path
- Format on save option
-
-[Unreleased]: https://github.com/aarcangeli/idea-clang-format/compare/v1.0.0...HEAD
-[1.0.0]: https://github.com/aarcangeli/idea-clang-format/commits/v1.0.0
diff --git a/gradle.properties b/gradle.properties
index a5c7b92..cab46a8 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,7 +4,7 @@ pluginGroup = com.github.aarcangeli.idea-clang-format
pluginName = idea-clang-format
pluginRepositoryUrl = https://github.com/aarcangeli/idea-clang-format
# SemVer format -> https://semver.org
-pluginVersion = 0.0.2-beta
+pluginVersion = 1.0.0
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 233
diff --git a/src/main/kotlin/com/github/aarcangeli/ideaclangformat/experimental/ClangFormatStyleSettingsModifier.kt b/src/main/kotlin/com/github/aarcangeli/ideaclangformat/experimental/ClangFormatStyleSettingsModifier.kt
index e712441..8fc48d4 100644
--- a/src/main/kotlin/com/github/aarcangeli/ideaclangformat/experimental/ClangFormatStyleSettingsModifier.kt
+++ b/src/main/kotlin/com/github/aarcangeli/ideaclangformat/experimental/ClangFormatStyleSettingsModifier.kt
@@ -2,12 +2,11 @@ package com.github.aarcangeli.ideaclangformat.experimental
import com.github.aarcangeli.ideaclangformat.ClangFormatConfig
import com.github.aarcangeli.ideaclangformat.MyBundle
-import com.github.aarcangeli.ideaclangformat.exceptions.ClangValidationError
import com.github.aarcangeli.ideaclangformat.exceptions.ClangFormatError
+import com.github.aarcangeli.ideaclangformat.exceptions.ClangValidationError
import com.github.aarcangeli.ideaclangformat.services.ClangFormatService
import com.github.aarcangeli.ideaclangformat.services.ClangFormatStyleService
import com.github.aarcangeli.ideaclangformat.utils.ClangFormatCommons
-import com.intellij.CodeStyleBundle
import com.intellij.icons.AllIcons
import com.intellij.ide.actions.ShowSettingsUtilImpl
import com.intellij.ide.util.PsiNavigationSupport
@@ -56,7 +55,7 @@ class ClangFormatStyleSettingsModifier : CodeStyleSettingsModifier {
if (!formatService.mayBeFormatted(file, true)) {
// clang format disabled for this file
file.putUserData(LAST_PROVIDED_SETTINGS, null)
- return true
+ return false
}
try {
@@ -88,12 +87,10 @@ class ClangFormatStyleSettingsModifier : CodeStyleSettingsModifier {
return object : IndentStatusBarUIContributor(settings.indentOptions) {
override fun getTooltip(): String {
val builder = HtmlBuilder()
- builder.append(
- HtmlChunk.span("color:" + ColorUtil.toHtmlColor(JBColor.GRAY))
- .addText(MyBundle.message("error.clang-format.status.hint"))
- )
+ builder.append(MyBundle.message("error.clang-format.status.hint"))
+ .br()
builder
- .append(CodeStyleBundle.message("indent.status.bar.indent.tooltip"))
+ .append("Indent:")
.append(" ")
.append(
HtmlChunk.tag("b").addText(
diff --git a/src/main/kotlin/com/github/aarcangeli/ideaclangformat/services/ClangFormatStyleServiceImpl.kt b/src/main/kotlin/com/github/aarcangeli/ideaclangformat/services/ClangFormatStyleServiceImpl.kt
index d5ec295..e10e10f 100644
--- a/src/main/kotlin/com/github/aarcangeli/ideaclangformat/services/ClangFormatStyleServiceImpl.kt
+++ b/src/main/kotlin/com/github/aarcangeli/ideaclangformat/services/ClangFormatStyleServiceImpl.kt
@@ -63,8 +63,6 @@ class ClangFormatStyleServiceImpl : ClangFormatStyleService, Disposable {
}
override fun getRawFormatStyle(psiFile: PsiFile): Map {
- // save changed documents
- saveUnsavedClangFormatFiles()
val result = CachedValuesManager.getCachedValue(psiFile, CLANG_STYLE, FormatStyleProvider(this, psiFile))
if (result.second != null) {
throw result.second!!
@@ -120,19 +118,6 @@ class ClangFormatStyleServiceImpl : ClangFormatStyleService, Disposable {
return getClangFormatFiles(virtualFile).isNotEmpty()
}
- private fun saveUnsavedClangFormatFiles() {
- // save changed documents
- if (ClangFormatCommons.getUnsavedClangFormats().isNotEmpty()) {
- ApplicationManager.getApplication().invokeLater {
- WriteAction.run {
- for (document in ClangFormatCommons.getUnsavedClangFormats()) {
- FileDocumentManager.getInstance().saveDocument(document)
- }
- }
- }
- }
- }
-
override fun dispose() {}
private fun dropCaches() {