diff --git a/action_basics/build.gradle.kts b/action_basics/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/action_basics/build.gradle.kts +++ b/action_basics/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/comparing_string_references_inspection/build.gradle.kts b/comparing_string_references_inspection/build.gradle.kts index 519b3d06b..6fec0f363 100644 --- a/comparing_string_references_inspection/build.gradle.kts +++ b/comparing_string_references_inspection/build.gradle.kts @@ -22,7 +22,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") plugins.set(listOf("com.intellij.java")) } @@ -33,7 +33,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/conditional_operator_intention/build.gradle.kts b/conditional_operator_intention/build.gradle.kts index 519b3d06b..6fec0f363 100644 --- a/conditional_operator_intention/build.gradle.kts +++ b/conditional_operator_intention/build.gradle.kts @@ -22,7 +22,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") plugins.set(listOf("com.intellij.java")) } @@ -33,7 +33,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/editor_basics/build.gradle.kts b/editor_basics/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/editor_basics/build.gradle.kts +++ b/editor_basics/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/facet_basics/build.gradle.kts b/facet_basics/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/facet_basics/build.gradle.kts +++ b/facet_basics/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetType.java b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetType.java index 73178fdcc..82686bb7d 100644 --- a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetType.java +++ b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetType.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.facet; @@ -9,7 +9,6 @@ import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleType; import icons.SdkIcons; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -46,7 +45,6 @@ final class DemoFacetType extends FacetType { return true; } - @Nullable @Override public Icon getIcon() { return SdkIcons.Sdk_default_icon; diff --git a/framework_basics/build.gradle.kts b/framework_basics/build.gradle.kts index 172b40562..2adad0c1f 100644 --- a/framework_basics/build.gradle.kts +++ b/framework_basics/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") plugins.set(listOf("com.intellij.java")) } @@ -29,7 +29,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/kotlin_demo/build.gradle.kts b/kotlin_demo/build.gradle.kts index 3918d91b7..5afd3d0a2 100644 --- a/kotlin_demo/build.gradle.kts +++ b/kotlin_demo/build.gradle.kts @@ -19,7 +19,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -29,8 +29,8 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } compileKotlin { diff --git a/live_templates/build.gradle.kts b/live_templates/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/live_templates/build.gradle.kts +++ b/live_templates/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/live_templates/src/main/java/org/intellij/sdk/liveTemplates/TitleCaseMacro.java b/live_templates/src/main/java/org/intellij/sdk/liveTemplates/TitleCaseMacro.java index 266dd361a..b4ff3ac4e 100644 --- a/live_templates/src/main/java/org/intellij/sdk/liveTemplates/TitleCaseMacro.java +++ b/live_templates/src/main/java/org/intellij/sdk/liveTemplates/TitleCaseMacro.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.liveTemplates; @@ -27,7 +27,7 @@ final class TitleCaseMacro extends MacroBase { if (text == null) { return null; } - if (text.length() > 0) { + if (!text.isEmpty()) { // Capitalize the start of every word text = StringUtil.toTitleCase(text); } diff --git a/max_opened_projects/build.gradle.kts b/max_opened_projects/build.gradle.kts index fb92ab629..be710eb94 100644 --- a/max_opened_projects/build.gradle.kts +++ b/max_opened_projects/build.gradle.kts @@ -3,6 +3,7 @@ plugins { id("java") id("org.jetbrains.intellij") version "1.17.3" + id("org.jetbrains.kotlin.jvm") version "1.9.23" } group = "org.intellij.sdk" @@ -18,7 +19,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +29,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectCloseListener.java b/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectCloseListener.java index 925ed621b..f5907233b 100644 --- a/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectCloseListener.java +++ b/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectCloseListener.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.maxOpenProjects; @@ -14,11 +14,6 @@ public class ProjectCloseListener implements ProjectManagerListener { @Override public void projectClosed(@NotNull Project project) { - // Ensure this isn't part of testing - if (ApplicationManager.getApplication().isUnitTestMode()) { - return; - } - // Get the counting service ProjectCountingService projectCountingService = ApplicationManager.getApplication().getService(ProjectCountingService.class); diff --git a/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectOpenStartupActivity.java b/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectOpenStartupActivity.java deleted file mode 100644 index d305d3717..000000000 --- a/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectOpenStartupActivity.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.intellij.sdk.maxOpenProjects; - -import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.startup.StartupActivity; -import com.intellij.openapi.ui.Messages; -import org.jetbrains.annotations.NotNull; - -/** - * Invoked on opening a project. - */ -final class ProjectOpenStartupActivity implements StartupActivity.DumbAware { - - @Override - public void runActivity(@NotNull Project project) { - // Ensure this isn't part of testing - if (ApplicationManager.getApplication().isUnitTestMode()) { - return; - } - - // Get the counting service - ProjectCountingService projectCountingService = - ApplicationManager.getApplication().getService(ProjectCountingService.class); - // Increment the project count - projectCountingService.increaseOpenProjectCount(); - - // See if the total # of projects violates the limit. - if (projectCountingService.isOpenProjectsLimitExceeded()) { - // Transitioned to outside the limit - String title = String.format("Opening Project \"%s\"", project.getName()); - String message = "
The number of open projects exceeds the SDK plugin max_opened_projects limit.

"; - - ApplicationManager.getApplication().invokeLater(() -> - Messages.showMessageDialog(project, message, title, Messages.getInformationIcon()) - ); - } - } - -} diff --git a/max_opened_projects/src/main/kotlin/org/intellij/sdk/maxOpenProjects/ProjectOpenStartupActivity.kt b/max_opened_projects/src/main/kotlin/org/intellij/sdk/maxOpenProjects/ProjectOpenStartupActivity.kt new file mode 100644 index 000000000..8254da6f3 --- /dev/null +++ b/max_opened_projects/src/main/kotlin/org/intellij/sdk/maxOpenProjects/ProjectOpenStartupActivity.kt @@ -0,0 +1,29 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package org.intellij.sdk.maxOpenProjects + +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.project.DumbAware +import com.intellij.openapi.project.Project +import com.intellij.openapi.startup.ProjectActivity +import com.intellij.openapi.ui.Messages + +/** + * Invoked on opening a project. + */ +internal class ProjectOpenStartupActivity : ProjectActivity, DumbAware { + override suspend fun execute(project: Project) { + val application = ApplicationManager.getApplication() + val projectCountingService = application.getService(ProjectCountingService::class.java) + projectCountingService.increaseOpenProjectCount() + if (projectCountingService.isOpenProjectsLimitExceeded) { + application.invokeLater { + Messages.showMessageDialog( + project, + "The number of open projects exceeded the limit while opening the '${project.name}' project.", + "Open Projects Limit Exceeded", + Messages.getInformationIcon() + ) + } + } + } +} diff --git a/module/build.gradle.kts b/module/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/module/build.gradle.kts +++ b/module/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/module/src/main/java/org/intellij/sdk/module/DemoModuleBuilder.java b/module/src/main/java/org/intellij/sdk/module/DemoModuleBuilder.java index 80d381dfb..cba5b107f 100644 --- a/module/src/main/java/org/intellij/sdk/module/DemoModuleBuilder.java +++ b/module/src/main/java/org/intellij/sdk/module/DemoModuleBuilder.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.module; @@ -6,6 +6,7 @@ import com.intellij.ide.util.projectWizard.ModuleBuilder; import com.intellij.ide.util.projectWizard.ModuleWizardStep; import com.intellij.ide.util.projectWizard.WizardContext; import com.intellij.openapi.Disposable; +import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.roots.ModifiableRootModel; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -17,7 +18,7 @@ public class DemoModuleBuilder extends ModuleBuilder { } @Override - public DemoModuleType getModuleType() { + public ModuleType getModuleType() { return DemoModuleType.getInstance(); } diff --git a/product_specific/pycharm_basics/build.gradle.kts b/product_specific/pycharm_basics/build.gradle.kts index f210a6787..e6f754d40 100644 --- a/product_specific/pycharm_basics/build.gradle.kts +++ b/product_specific/pycharm_basics/build.gradle.kts @@ -31,7 +31,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/project_model/build.gradle.kts b/project_model/build.gradle.kts index 172b40562..2adad0c1f 100644 --- a/project_model/build.gradle.kts +++ b/project_model/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") plugins.set(listOf("com.intellij.java")) } @@ -29,7 +29,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/project_model/src/main/java/org/intellij/sdk/project/model/LibrariesAction.java b/project_model/src/main/java/org/intellij/sdk/project/model/LibrariesAction.java index d224f473a..026f4c53d 100644 --- a/project_model/src/main/java/org/intellij/sdk/project/model/LibrariesAction.java +++ b/project_model/src/main/java/org/intellij/sdk/project/model/LibrariesAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.project.model; @@ -62,8 +62,7 @@ public class LibrariesAction extends AnAction { final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex(); StringBuilder jars = new StringBuilder(); for (OrderEntry orderEntry : fileIndex.getOrderEntriesForFile(virtualFile)) { - if (orderEntry instanceof LibraryOrderEntry) { - final LibraryOrderEntry libraryEntry = (LibraryOrderEntry) orderEntry; + if (orderEntry instanceof LibraryOrderEntry libraryEntry) { final Library library = libraryEntry.getLibrary(); if (library == null) { continue; @@ -79,7 +78,7 @@ public class LibrariesAction extends AnAction { } String fileAndLibs; if (jars.length() > 0) { - fileAndLibs = virtualFile.getName() + ": " + jars.toString(); + fileAndLibs = virtualFile.getName() + ": " + jars; } else { fileAndLibs = "None"; } diff --git a/project_model/src/main/java/org/intellij/sdk/project/model/ShowSourceRootsActions.java b/project_model/src/main/java/org/intellij/sdk/project/model/ShowSourceRootsActions.java index 6e717396f..ebd1d6d02 100644 --- a/project_model/src/main/java/org/intellij/sdk/project/model/ShowSourceRootsActions.java +++ b/project_model/src/main/java/org/intellij/sdk/project/model/ShowSourceRootsActions.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.project.model; @@ -32,7 +32,7 @@ public class ShowSourceRootsActions extends AnAction { sourceRootsList.append(file.getUrl()).append("\n"); } Messages.showInfoMessage( - "Source roots for the " + projectName + " plugin:\n" + sourceRootsList.toString(), + "Source roots for the " + projectName + " plugin:\n" + sourceRootsList, "Project Properties" ); } diff --git a/project_view_pane/build.gradle.kts b/project_view_pane/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/project_view_pane/build.gradle.kts +++ b/project_view_pane/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/project_wizard/build.gradle.kts b/project_wizard/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/project_wizard/build.gradle.kts +++ b/project_wizard/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/psi_demo/build.gradle.kts b/psi_demo/build.gradle.kts index 172b40562..2adad0c1f 100644 --- a/psi_demo/build.gradle.kts +++ b/psi_demo/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") plugins.set(listOf("com.intellij.java")) } @@ -29,7 +29,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/run_configuration/build.gradle.kts b/run_configuration/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/run_configuration/build.gradle.kts +++ b/run_configuration/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/settings/build.gradle.kts b/settings/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/settings/build.gradle.kts +++ b/settings/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/settings/src/main/java/org/intellij/sdk/settings/AppSettingsState.java b/settings/src/main/java/org/intellij/sdk/settings/AppSettingsState.java index 890b5e15c..665cc58de 100644 --- a/settings/src/main/java/org/intellij/sdk/settings/AppSettingsState.java +++ b/settings/src/main/java/org/intellij/sdk/settings/AppSettingsState.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.settings; @@ -8,7 +8,6 @@ import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.util.xmlb.XmlSerializerUtil; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * Supports storing the application settings in a persistent way. @@ -28,7 +27,6 @@ final class AppSettingsState implements PersistentStateComponent> result) { // This must be an element with a literal expression as a parent - if (!(element instanceof PsiJavaTokenImpl) || !(element.getParent() instanceof PsiLiteralExpression)) { + if (!(element instanceof PsiJavaTokenImpl) || !(element.getParent() instanceof PsiLiteralExpression literalExpression)) { return; } // The literal expression must start with the Simple language literal expression - PsiLiteralExpression literalExpression = (PsiLiteralExpression) element.getParent(); String value = literalExpression.getValue() instanceof String ? (String) literalExpression.getValue() : null; if ((value == null) || !value.startsWith(SimpleAnnotator.SIMPLE_PREFIX_STR + SimpleAnnotator.SIMPLE_SEPARATOR_STR)) { @@ -39,7 +38,7 @@ final class SimpleLineMarkerProvider extends RelatedItemLineMarkerProvider { SimpleAnnotator.SIMPLE_PREFIX_STR.length() + SimpleAnnotator.SIMPLE_SEPARATOR_STR.length() ); final List properties = SimpleUtil.findProperties(project, possibleProperties); - if (properties.size() > 0) { + if (!properties.isEmpty()) { // Add the property to a collection of line marker info NavigationGutterIconBuilder builder = NavigationGutterIconBuilder.create(SimpleIcons.FILE) diff --git a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleReference.java b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleReference.java index f6170e037..ec49b96e6 100644 --- a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleReference.java +++ b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleReference.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.language; @@ -47,7 +47,7 @@ final class SimpleReference extends PsiReferenceBase implements PsiP List properties = SimpleUtil.findProperties(project); List variants = new ArrayList<>(); for (final SimpleProperty property : properties) { - if (property.getKey() != null && property.getKey().length() > 0) { + if (property.getKey() != null && !property.getKey().isEmpty()) { variants.add(LookupElementBuilder .create(property).withIcon(SimpleIcons.FILE) .withTypeText(property.getContainingFile().getName()) diff --git a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleSpellcheckingStrategy.java b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleSpellcheckingStrategy.java index c14609cf9..6c96d71a9 100644 --- a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleSpellcheckingStrategy.java +++ b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleSpellcheckingStrategy.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.language; @@ -34,7 +34,7 @@ final class SimpleSpellcheckingStrategy extends SpellcheckingStrategy { private static class SimpleCommentTokenizer extends Tokenizer { @Override - public void tokenize(@NotNull PsiComment element, TokenConsumer consumer) { + public void tokenize(@NotNull PsiComment element, @NotNull TokenConsumer consumer) { // Exclude the start of the comment with its # characters from spell checking int startIndex = 0; for (char c : element.textToCharArray()) { @@ -53,7 +53,7 @@ final class SimpleSpellcheckingStrategy extends SpellcheckingStrategy { private static class SimplePropertyTokenizer extends Tokenizer { - public void tokenize(@NotNull SimpleProperty element, TokenConsumer consumer) { + public void tokenize(@NotNull SimpleProperty element, @NotNull TokenConsumer consumer) { //Spell check the keys and values of properties with different splitters final ASTNode key = element.getNode().findChildByType(SimpleTypes.KEY); if (key != null && key.getTextLength() > 0) { diff --git a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleStructureViewFactory.java b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleStructureViewFactory.java index 6d916bfb4..437e71548 100644 --- a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleStructureViewFactory.java +++ b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleStructureViewFactory.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.language; @@ -13,7 +13,6 @@ import org.jetbrains.annotations.Nullable; final class SimpleStructureViewFactory implements PsiStructureViewFactory { - @Nullable @Override public StructureViewBuilder getStructureViewBuilder(@NotNull final PsiFile psiFile) { return new TreeBasedStructureViewBuilder() { diff --git a/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java b/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java index 904451512..91e5844b4 100644 --- a/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java +++ b/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.language; @@ -13,7 +13,6 @@ import com.intellij.psi.PsiReference; import com.intellij.psi.codeStyle.CodeStyleManager; import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; import com.intellij.usageView.UsageInfo; -import com.intellij.util.containers.ContainerUtil; import org.intellij.sdk.language.psi.SimpleProperty; import java.util.Collection; @@ -49,7 +48,7 @@ public class SimpleCodeInsightTest extends LightJavaCodeInsightFixtureTestCase { WriteCommandAction.writeCommandAction(getProject()).run(() -> CodeStyleManager.getInstance(getProject()).reformatText( myFixture.getFile(), - ContainerUtil.newArrayList(myFixture.getFile().getTextRange()) + List.of(myFixture.getFile().getTextRange()) ) ); myFixture.checkResultByFile("DefaultTestData.simple"); diff --git a/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java b/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java index 91f56446f..cc4b9f248 100644 --- a/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java +++ b/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.sdk.language; @@ -22,11 +22,6 @@ public class SimpleParsingTest extends ParsingTestCase { return "src/test/testData"; } - @Override - protected boolean skipSpaces() { - return false; - } - @Override protected boolean includeRanges() { return true; diff --git a/tool_window/build.gradle.kts b/tool_window/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/tool_window/build.gradle.kts +++ b/tool_window/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } } diff --git a/tree_structure_provider/build.gradle.kts b/tree_structure_provider/build.gradle.kts index fb92ab629..65d73304c 100644 --- a/tree_structure_provider/build.gradle.kts +++ b/tree_structure_provider/build.gradle.kts @@ -18,7 +18,7 @@ java { // See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - version.set("2023.1.5") + version.set("2023.2.6") } tasks { @@ -28,7 +28,7 @@ tasks { patchPluginXml { version.set("${project.version}") - sinceBuild.set("231") - untilBuild.set("233.*") + sinceBuild.set("232") + untilBuild.set("241.*") } }