mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 08:47:50 +08:00
2024.1 Release: update pages, extension point lists, code samples, etc. (#1265)
This commit is contained in:
parent
5efa9a2a86
commit
3e9f33b1cb
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
plugins.set(listOf("com.intellij.java"))
|
plugins.set(listOf("com.intellij.java"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
plugins.set(listOf("com.intellij.java"))
|
plugins.set(listOf("com.intellij.java"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
package org.intellij.sdk.facet;
|
||||||
|
|
||||||
@ -9,7 +9,6 @@ import com.intellij.openapi.module.Module;
|
|||||||
import com.intellij.openapi.module.ModuleType;
|
import com.intellij.openapi.module.ModuleType;
|
||||||
import icons.SdkIcons;
|
import icons.SdkIcons;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
@ -46,7 +45,6 @@ final class DemoFacetType extends FacetType<DemoFacet, DemoFacetConfiguration> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public Icon getIcon() {
|
public Icon getIcon() {
|
||||||
return SdkIcons.Sdk_default_icon;
|
return SdkIcons.Sdk_default_icon;
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
plugins.set(listOf("com.intellij.java"))
|
plugins.set(listOf("com.intellij.java"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -29,8 +29,8 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
package org.intellij.sdk.liveTemplates;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ final class TitleCaseMacro extends MacroBase {
|
|||||||
if (text == null) {
|
if (text == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (text.length() > 0) {
|
if (!text.isEmpty()) {
|
||||||
// Capitalize the start of every word
|
// Capitalize the start of every word
|
||||||
text = StringUtil.toTitleCase(text);
|
text = StringUtil.toTitleCase(text);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("java")
|
id("java")
|
||||||
id("org.jetbrains.intellij") version "1.17.3"
|
id("org.jetbrains.intellij") version "1.17.3"
|
||||||
|
id("org.jetbrains.kotlin.jvm") version "1.9.23"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.intellij.sdk"
|
group = "org.intellij.sdk"
|
||||||
@ -18,7 +19,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +29,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
package org.intellij.sdk.maxOpenProjects;
|
||||||
|
|
||||||
@ -14,11 +14,6 @@ public class ProjectCloseListener implements ProjectManagerListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void projectClosed(@NotNull Project project) {
|
public void projectClosed(@NotNull Project project) {
|
||||||
// Ensure this isn't part of testing
|
|
||||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the counting service
|
// Get the counting service
|
||||||
ProjectCountingService projectCountingService =
|
ProjectCountingService projectCountingService =
|
||||||
ApplicationManager.getApplication().getService(ProjectCountingService.class);
|
ApplicationManager.getApplication().getService(ProjectCountingService.class);
|
||||||
|
@ -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 = "<br>The number of open projects exceeds the SDK plugin max_opened_projects limit.<br><br>";
|
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater(() ->
|
|
||||||
Messages.showMessageDialog(project, message, title, Messages.getInformationIcon())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -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()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
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.ModuleWizardStep;
|
||||||
import com.intellij.ide.util.projectWizard.WizardContext;
|
import com.intellij.ide.util.projectWizard.WizardContext;
|
||||||
import com.intellij.openapi.Disposable;
|
import com.intellij.openapi.Disposable;
|
||||||
|
import com.intellij.openapi.module.ModuleType;
|
||||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@ -17,7 +18,7 @@ public class DemoModuleBuilder extends ModuleBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DemoModuleType getModuleType() {
|
public ModuleType<DemoModuleBuilder> getModuleType() {
|
||||||
return DemoModuleType.getInstance();
|
return DemoModuleType.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
plugins.set(listOf("com.intellij.java"))
|
plugins.set(listOf("com.intellij.java"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
package org.intellij.sdk.project.model;
|
||||||
|
|
||||||
@ -62,8 +62,7 @@ public class LibrariesAction extends AnAction {
|
|||||||
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
|
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
|
||||||
StringBuilder jars = new StringBuilder();
|
StringBuilder jars = new StringBuilder();
|
||||||
for (OrderEntry orderEntry : fileIndex.getOrderEntriesForFile(virtualFile)) {
|
for (OrderEntry orderEntry : fileIndex.getOrderEntriesForFile(virtualFile)) {
|
||||||
if (orderEntry instanceof LibraryOrderEntry) {
|
if (orderEntry instanceof LibraryOrderEntry libraryEntry) {
|
||||||
final LibraryOrderEntry libraryEntry = (LibraryOrderEntry) orderEntry;
|
|
||||||
final Library library = libraryEntry.getLibrary();
|
final Library library = libraryEntry.getLibrary();
|
||||||
if (library == null) {
|
if (library == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -79,7 +78,7 @@ public class LibrariesAction extends AnAction {
|
|||||||
}
|
}
|
||||||
String fileAndLibs;
|
String fileAndLibs;
|
||||||
if (jars.length() > 0) {
|
if (jars.length() > 0) {
|
||||||
fileAndLibs = virtualFile.getName() + ": " + jars.toString();
|
fileAndLibs = virtualFile.getName() + ": " + jars;
|
||||||
} else {
|
} else {
|
||||||
fileAndLibs = "None";
|
fileAndLibs = "None";
|
||||||
}
|
}
|
||||||
|
@ -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;
|
package org.intellij.sdk.project.model;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class ShowSourceRootsActions extends AnAction {
|
|||||||
sourceRootsList.append(file.getUrl()).append("\n");
|
sourceRootsList.append(file.getUrl()).append("\n");
|
||||||
}
|
}
|
||||||
Messages.showInfoMessage(
|
Messages.showInfoMessage(
|
||||||
"Source roots for the " + projectName + " plugin:\n" + sourceRootsList.toString(),
|
"Source roots for the " + projectName + " plugin:\n" + sourceRootsList,
|
||||||
"Project Properties"
|
"Project Properties"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
plugins.set(listOf("com.intellij.java"))
|
plugins.set(listOf("com.intellij.java"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
package org.intellij.sdk.settings;
|
||||||
|
|
||||||
@ -8,7 +8,6 @@ import com.intellij.openapi.components.State;
|
|||||||
import com.intellij.openapi.components.Storage;
|
import com.intellij.openapi.components.Storage;
|
||||||
import com.intellij.util.xmlb.XmlSerializerUtil;
|
import com.intellij.util.xmlb.XmlSerializerUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Supports storing the application settings in a persistent way.
|
* Supports storing the application settings in a persistent way.
|
||||||
@ -28,7 +27,6 @@ final class AppSettingsState implements PersistentStateComponent<AppSettingsStat
|
|||||||
return ApplicationManager.getApplication().getService(AppSettingsState.class);
|
return ApplicationManager.getApplication().getService(AppSettingsState.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public AppSettingsState getState() {
|
public AppSettingsState getState() {
|
||||||
return this;
|
return this;
|
||||||
|
@ -31,7 +31,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
plugins.set(listOf("com.intellij.java"))
|
plugins.set(listOf("com.intellij.java"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -10,7 +10,6 @@ import com.intellij.psi.codeStyle.CodeStyleSettings;
|
|||||||
import com.intellij.psi.codeStyle.CodeStyleSettingsProvider;
|
import com.intellij.psi.codeStyle.CodeStyleSettingsProvider;
|
||||||
import com.intellij.psi.codeStyle.CustomCodeStyleSettings;
|
import com.intellij.psi.codeStyle.CustomCodeStyleSettings;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
final class SimpleCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
|
final class SimpleCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
|
||||||
|
|
||||||
@ -19,7 +18,6 @@ final class SimpleCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
|
|||||||
return new SimpleCodeStyleSettings(settings);
|
return new SimpleCodeStyleSettings(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public String getConfigurableDisplayName() {
|
public String getConfigurableDisplayName() {
|
||||||
return "Simple";
|
return "Simple";
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -22,7 +22,6 @@ final class SimpleColorSettingsPage implements ColorSettingsPage {
|
|||||||
new AttributesDescriptor("Bad value", SimpleSyntaxHighlighter.BAD_CHARACTER)
|
new AttributesDescriptor("Bad value", SimpleSyntaxHighlighter.BAD_CHARACTER)
|
||||||
};
|
};
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public Icon getIcon() {
|
public Icon getIcon() {
|
||||||
return SimpleIcons.FILE;
|
return SimpleIcons.FILE;
|
||||||
@ -37,18 +36,19 @@ final class SimpleColorSettingsPage implements ColorSettingsPage {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getDemoText() {
|
public String getDemoText() {
|
||||||
return "# You are reading the \".properties\" entry.\n" +
|
return """
|
||||||
"! The exclamation mark can also mark text as comments.\n" +
|
# You are reading the ".properties" entry.
|
||||||
"website = https://en.wikipedia.org/\n" +
|
! The exclamation mark can also mark text as comments.
|
||||||
"language = English\n" +
|
website = https://en.wikipedia.org/
|
||||||
"# The backslash below tells the application to continue reading\n" +
|
language = English
|
||||||
"# the value onto the next line.\n" +
|
# The backslash below tells the application to continue reading
|
||||||
"message = Welcome to \\\n" +
|
# the value onto the next line.
|
||||||
" Wikipedia!\n" +
|
message = Welcome to \\
|
||||||
"# Add spaces to the key\n" +
|
Wikipedia!
|
||||||
"key\\ with\\ spaces = This is the value that could be looked up with the key \"key with spaces\".\n" +
|
# Add spaces to the key
|
||||||
"# Unicode\n" +
|
key\\ with\\ spaces = This is the value that could be looked up with the key "key with spaces".
|
||||||
"tab : \\u0009";
|
# Unicode
|
||||||
|
tab : \\u0009""";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -7,13 +7,11 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
final class SimpleCommenter implements Commenter {
|
final class SimpleCommenter implements Commenter {
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public String getLineCommentPrefix() {
|
public String getLineCommentPrefix() {
|
||||||
return "#";
|
return "#";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public String getBlockCommentPrefix() {
|
public String getBlockCommentPrefix() {
|
||||||
return "";
|
return "";
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
// 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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
@ -34,7 +33,6 @@ public final class SimpleFileType extends LanguageFileType {
|
|||||||
return "simple";
|
return "simple";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public Icon getIcon() {
|
public Icon getIcon() {
|
||||||
return SimpleIcons.FILE;
|
return SimpleIcons.FILE;
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -15,7 +15,6 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
final class SimpleFindUsagesProvider implements FindUsagesProvider {
|
final class SimpleFindUsagesProvider implements FindUsagesProvider {
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public WordsScanner getWordsScanner() {
|
public WordsScanner getWordsScanner() {
|
||||||
return new DefaultWordsScanner(new SimpleLexerAdapter(),
|
return new DefaultWordsScanner(new SimpleLexerAdapter(),
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -27,7 +27,9 @@ import java.util.List;
|
|||||||
final class SimpleFoldingBuilder extends FoldingBuilderEx implements DumbAware {
|
final class SimpleFoldingBuilder extends FoldingBuilderEx implements DumbAware {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FoldingDescriptor @NotNull [] buildFoldRegions(@NotNull PsiElement root, @NotNull Document document, boolean quick) {
|
public FoldingDescriptor @NotNull [] buildFoldRegions(@NotNull PsiElement root,
|
||||||
|
@NotNull Document document,
|
||||||
|
boolean quick) {
|
||||||
// Initialize the group of folding regions that will expand/collapse together.
|
// Initialize the group of folding regions that will expand/collapse together.
|
||||||
FoldingGroup group = FoldingGroup.newGroup(SimpleAnnotator.SIMPLE_PREFIX_STR);
|
FoldingGroup group = FoldingGroup.newGroup(SimpleAnnotator.SIMPLE_PREFIX_STR);
|
||||||
// Initialize the list of folding regions
|
// Initialize the list of folding regions
|
||||||
@ -40,7 +42,8 @@ final class SimpleFoldingBuilder extends FoldingBuilderEx implements DumbAware {
|
|||||||
super.visitLiteralExpression(literalExpression);
|
super.visitLiteralExpression(literalExpression);
|
||||||
|
|
||||||
String value = PsiLiteralUtil.getStringLiteralContent(literalExpression);
|
String value = PsiLiteralUtil.getStringLiteralContent(literalExpression);
|
||||||
if (value != null && value.startsWith(SimpleAnnotator.SIMPLE_PREFIX_STR + SimpleAnnotator.SIMPLE_SEPARATOR_STR)) {
|
if (value != null &&
|
||||||
|
value.startsWith(SimpleAnnotator.SIMPLE_PREFIX_STR + SimpleAnnotator.SIMPLE_SEPARATOR_STR)) {
|
||||||
Project project = literalExpression.getProject();
|
Project project = literalExpression.getProject();
|
||||||
String key = value.substring(
|
String key = value.substring(
|
||||||
SimpleAnnotator.SIMPLE_PREFIX_STR.length() + SimpleAnnotator.SIMPLE_SEPARATOR_STR.length()
|
SimpleAnnotator.SIMPLE_PREFIX_STR.length() + SimpleAnnotator.SIMPLE_SEPARATOR_STR.length()
|
||||||
@ -58,7 +61,7 @@ final class SimpleFoldingBuilder extends FoldingBuilderEx implements DumbAware {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return descriptors.toArray(FoldingDescriptor.EMPTY);
|
return descriptors.toArray(FoldingDescriptor.EMPTY_ARRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -95,7 +98,9 @@ final class SimpleFoldingBuilder extends FoldingBuilderEx implements DumbAware {
|
|||||||
return StringUtil.THREE_DOTS;
|
return StringUtil.THREE_DOTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return propertyValue.replaceAll("\n", "\\n").replaceAll("\"", "\\\\\"");
|
return propertyValue
|
||||||
|
.replaceAll("\n", "\\n")
|
||||||
|
.replaceAll("\"", "\\\\\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -27,19 +27,20 @@ final class SimpleLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSet
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCodeSample(@NotNull SettingsType settingsType) {
|
public String getCodeSample(@NotNull SettingsType settingsType) {
|
||||||
return "# You are reading the \".properties\" entry.\n" +
|
return """
|
||||||
"! The exclamation mark can also mark text as comments.\n" +
|
# You are reading the ".properties" entry.
|
||||||
"website = https://en.wikipedia.org/\n" +
|
! The exclamation mark can also mark text as comments.
|
||||||
"\n" +
|
website = https://en.wikipedia.org/
|
||||||
"language = English\n" +
|
|
||||||
"# The backslash below tells the application to continue reading\n" +
|
language = English
|
||||||
"# the value onto the next line.\n" +
|
# The backslash below tells the application to continue reading
|
||||||
"message = Welcome to \\\n" +
|
# the value onto the next line.
|
||||||
" Wikipedia!\n" +
|
message = Welcome to \\
|
||||||
"# Add spaces to the key\n" +
|
Wikipedia!
|
||||||
"key\\ with\\ spaces = This is the value that could be looked up with the key \"key with spaces\".\n" +
|
# Add spaces to the key
|
||||||
"# Unicode\n" +
|
key\\ with\\ spaces = This is the value that could be looked up with the key "key with spaces".
|
||||||
"tab : \\u0009";
|
# Unicode
|
||||||
|
tab : \\u0009""";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -21,12 +21,11 @@ final class SimpleLineMarkerProvider extends RelatedItemLineMarkerProvider {
|
|||||||
protected void collectNavigationMarkers(@NotNull PsiElement element,
|
protected void collectNavigationMarkers(@NotNull PsiElement element,
|
||||||
@NotNull Collection<? super RelatedItemLineMarkerInfo<?>> result) {
|
@NotNull Collection<? super RelatedItemLineMarkerInfo<?>> result) {
|
||||||
// This must be an element with a literal expression as a parent
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The literal expression must start with the Simple language literal expression
|
// 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;
|
String value = literalExpression.getValue() instanceof String ? (String) literalExpression.getValue() : null;
|
||||||
if ((value == null) ||
|
if ((value == null) ||
|
||||||
!value.startsWith(SimpleAnnotator.SIMPLE_PREFIX_STR + SimpleAnnotator.SIMPLE_SEPARATOR_STR)) {
|
!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()
|
SimpleAnnotator.SIMPLE_PREFIX_STR.length() + SimpleAnnotator.SIMPLE_SEPARATOR_STR.length()
|
||||||
);
|
);
|
||||||
final List<SimpleProperty> properties = SimpleUtil.findProperties(project, possibleProperties);
|
final List<SimpleProperty> properties = SimpleUtil.findProperties(project, possibleProperties);
|
||||||
if (properties.size() > 0) {
|
if (!properties.isEmpty()) {
|
||||||
// Add the property to a collection of line marker info
|
// Add the property to a collection of line marker info
|
||||||
NavigationGutterIconBuilder<PsiElement> builder =
|
NavigationGutterIconBuilder<PsiElement> builder =
|
||||||
NavigationGutterIconBuilder.create(SimpleIcons.FILE)
|
NavigationGutterIconBuilder.create(SimpleIcons.FILE)
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ final class SimpleReference extends PsiReferenceBase<PsiElement> implements PsiP
|
|||||||
List<SimpleProperty> properties = SimpleUtil.findProperties(project);
|
List<SimpleProperty> properties = SimpleUtil.findProperties(project);
|
||||||
List<LookupElement> variants = new ArrayList<>();
|
List<LookupElement> variants = new ArrayList<>();
|
||||||
for (final SimpleProperty property : properties) {
|
for (final SimpleProperty property : properties) {
|
||||||
if (property.getKey() != null && property.getKey().length() > 0) {
|
if (property.getKey() != null && !property.getKey().isEmpty()) {
|
||||||
variants.add(LookupElementBuilder
|
variants.add(LookupElementBuilder
|
||||||
.create(property).withIcon(SimpleIcons.FILE)
|
.create(property).withIcon(SimpleIcons.FILE)
|
||||||
.withTypeText(property.getContainingFile().getName())
|
.withTypeText(property.getContainingFile().getName())
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ final class SimpleSpellcheckingStrategy extends SpellcheckingStrategy {
|
|||||||
private static class SimpleCommentTokenizer extends Tokenizer<PsiComment> {
|
private static class SimpleCommentTokenizer extends Tokenizer<PsiComment> {
|
||||||
|
|
||||||
@Override
|
@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
|
// Exclude the start of the comment with its # characters from spell checking
|
||||||
int startIndex = 0;
|
int startIndex = 0;
|
||||||
for (char c : element.textToCharArray()) {
|
for (char c : element.textToCharArray()) {
|
||||||
@ -53,7 +53,7 @@ final class SimpleSpellcheckingStrategy extends SpellcheckingStrategy {
|
|||||||
|
|
||||||
private static class SimplePropertyTokenizer extends Tokenizer<SimpleProperty> {
|
private static class SimplePropertyTokenizer extends Tokenizer<SimpleProperty> {
|
||||||
|
|
||||||
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
|
//Spell check the keys and values of properties with different splitters
|
||||||
final ASTNode key = element.getNode().findChildByType(SimpleTypes.KEY);
|
final ASTNode key = element.getNode().findChildByType(SimpleTypes.KEY);
|
||||||
if (key != null && key.getTextLength() > 0) {
|
if (key != null && key.getTextLength() > 0) {
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -13,7 +13,6 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
final class SimpleStructureViewFactory implements PsiStructureViewFactory {
|
final class SimpleStructureViewFactory implements PsiStructureViewFactory {
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public StructureViewBuilder getStructureViewBuilder(@NotNull final PsiFile psiFile) {
|
public StructureViewBuilder getStructureViewBuilder(@NotNull final PsiFile psiFile) {
|
||||||
return new TreeBasedStructureViewBuilder() {
|
return new TreeBasedStructureViewBuilder() {
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -13,7 +13,6 @@ import com.intellij.psi.PsiReference;
|
|||||||
import com.intellij.psi.codeStyle.CodeStyleManager;
|
import com.intellij.psi.codeStyle.CodeStyleManager;
|
||||||
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
|
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
|
||||||
import com.intellij.usageView.UsageInfo;
|
import com.intellij.usageView.UsageInfo;
|
||||||
import com.intellij.util.containers.ContainerUtil;
|
|
||||||
import org.intellij.sdk.language.psi.SimpleProperty;
|
import org.intellij.sdk.language.psi.SimpleProperty;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -49,7 +48,7 @@ public class SimpleCodeInsightTest extends LightJavaCodeInsightFixtureTestCase {
|
|||||||
WriteCommandAction.writeCommandAction(getProject()).run(() ->
|
WriteCommandAction.writeCommandAction(getProject()).run(() ->
|
||||||
CodeStyleManager.getInstance(getProject()).reformatText(
|
CodeStyleManager.getInstance(getProject()).reformatText(
|
||||||
myFixture.getFile(),
|
myFixture.getFile(),
|
||||||
ContainerUtil.newArrayList(myFixture.getFile().getTextRange())
|
List.of(myFixture.getFile().getTextRange())
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
myFixture.checkResultByFile("DefaultTestData.simple");
|
myFixture.checkResultByFile("DefaultTestData.simple");
|
||||||
|
@ -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;
|
package org.intellij.sdk.language;
|
||||||
|
|
||||||
@ -22,11 +22,6 @@ public class SimpleParsingTest extends ParsingTestCase {
|
|||||||
return "src/test/testData";
|
return "src/test/testData";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean skipSpaces() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean includeRanges() {
|
protected boolean includeRanges() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ java {
|
|||||||
|
|
||||||
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
// See https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
|
||||||
intellij {
|
intellij {
|
||||||
version.set("2023.1.5")
|
version.set("2023.2.6")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -28,7 +28,7 @@ tasks {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
version.set("${project.version}")
|
version.set("${project.version}")
|
||||||
sinceBuild.set("231")
|
sinceBuild.set("232")
|
||||||
untilBuild.set("233.*")
|
untilBuild.set("241.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user