This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-392
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-392 by this push:
new 39ef2fd WIP.
39ef2fd is described below
commit 39ef2fdddedeca68cd4a622a10e09c0ccdfe0475
Author: Sergey Kamov <[email protected]>
AuthorDate: Fri Aug 20 17:25:58 2021 +0300
WIP.
---
.../org/apache/nlpcraft/idl/idea/plugin/NCIdl.bnf | 4 +-
.../idea/plugin/SimpleChooseByNameContributor.java | 37 --------
.../plugin/SimpleCodeStyleSettingsProvider.java | 46 ---------
.../idea/plugin/SimpleDocumentationProvider.java | 96 -------------------
.../idl/idea/plugin/SimpleFindUsagesProvider.java | 68 -------------
.../SimpleLanguageCodeStyleSettingsProvider.java | 45 ---------
.../plugin/SimpleRefactoringSupportProvider.java | 18 ----
.../nlpcraft/idl/idea/plugin/SimpleReference.java | 66 -------------
.../idea/plugin/SimpleReferenceContributor.java | 42 ---------
.../src/main/resources/META-INF/plugin.xml | 105 ++++++++++-----------
10 files changed, 51 insertions(+), 476 deletions(-)
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/NCIdl.bnf
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/NCIdl.bnf
index 661239d..3f9354c 100644
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/NCIdl.bnf
+++
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/NCIdl.bnf
@@ -6,8 +6,8 @@
psiClassPrefix="Simple"
psiImplClassSuffix="Impl"
- psiPackage="org.intellij.sdk.language.psi"
- psiImplPackage="org.intellij.sdk.language.psi.impl"
+ psiPackage="org.apache.nlpcraft.idl.idea.plugin.psi"
+ psiImplPackage="org.apache.nlpcraft.idl.idea.plugin.psi.impl"
elementTypeHolderClass="org.apache.nlpcraft.idl.idea.plugin.psi.SimpleTypes"
elementTypeClass="org.apache.nlpcraft.idl.idea.plugin.psi.SimpleElementType"
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleChooseByNameContributor.java
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleChooseByNameContributor.java
deleted file mode 100644
index d7ebcaf..0000000
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleChooseByNameContributor.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2000-2020 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.
-
-package org.apache.nlpcraft.idl.idea.plugin;
-
-import com.intellij.navigation.ChooseByNameContributor;
-import com.intellij.navigation.NavigationItem;
-import com.intellij.openapi.project.Project;
-import org.apache.nlpcraft.idl.idea.plugin.psi.SimpleProperty;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class SimpleChooseByNameContributor implements ChooseByNameContributor {
-
- @NotNull
- @Override
- public String[] getNames(Project project, boolean includeNonProjectItems) {
- List<SimpleProperty> properties = SimpleUtil.findProperties(project);
- List<String> names = new ArrayList<>(properties.size());
- for (SimpleProperty property : properties) {
- if (property.getKey() != null && property.getKey().length() > 0) {
- names.add(property.getKey());
- }
- }
- return names.toArray(new String[names.size()]);
- }
-
- @NotNull
- @Override
- public NavigationItem[] getItemsByName(String name, String pattern, Project
project, boolean includeNonProjectItems) {
- // TODO: include non project items
- List<SimpleProperty> properties = SimpleUtil.findProperties(project, name);
- return properties.toArray(new NavigationItem[properties.size()]);
- }
-
-}
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleCodeStyleSettingsProvider.java
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleCodeStyleSettingsProvider.java
deleted file mode 100644
index e1fc362..0000000
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleCodeStyleSettingsProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2000-2020 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.
-
-package org.apache.nlpcraft.idl.idea.plugin;
-
-import com.intellij.application.options.CodeStyleAbstractConfigurable;
-import com.intellij.application.options.CodeStyleAbstractPanel;
-import com.intellij.application.options.TabbedLanguageCodeStylePanel;
-import com.intellij.psi.codeStyle.CodeStyleConfigurable;
-import com.intellij.psi.codeStyle.CodeStyleSettings;
-import com.intellij.psi.codeStyle.CodeStyleSettingsProvider;
-import com.intellij.psi.codeStyle.CustomCodeStyleSettings;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-public class SimpleCodeStyleSettingsProvider extends CodeStyleSettingsProvider
{
-
- @Override
- public CustomCodeStyleSettings createCustomSettings(CodeStyleSettings
settings) {
- return new SimpleCodeStyleSettings(settings);
- }
-
- @Nullable
- @Override
- public String getConfigurableDisplayName() {
- return "Simple";
- }
-
- @NotNull
- public CodeStyleConfigurable createConfigurable(@NotNull CodeStyleSettings
settings, @NotNull CodeStyleSettings modelSettings) {
- return new CodeStyleAbstractConfigurable(settings, modelSettings,
this.getConfigurableDisplayName()) {
- @Override
- protected CodeStyleAbstractPanel createPanel(CodeStyleSettings settings)
{
- return new SimpleCodeStyleMainPanel(getCurrentSettings(), settings);
- }
- };
- }
-
- private static class SimpleCodeStyleMainPanel extends
TabbedLanguageCodeStylePanel {
-
- public SimpleCodeStyleMainPanel(CodeStyleSettings currentSettings,
CodeStyleSettings settings) {
- super(NCIdlLanguage.INSTANCE, currentSettings, settings);
- }
-
- }
-
-}
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleDocumentationProvider.java
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleDocumentationProvider.java
deleted file mode 100644
index 25f514a..0000000
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleDocumentationProvider.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.apache.nlpcraft.idl.idea.plugin;
-
-import com.intellij.lang.documentation.AbstractDocumentationProvider;
-import com.intellij.lang.documentation.DocumentationMarkup;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.presentation.java.SymbolPresentationUtil;
-import org.apache.nlpcraft.idl.idea.plugin.psi.SimpleProperty;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.List;
-
-public class SimpleDocumentationProvider extends AbstractDocumentationProvider
{
-
- /**
- * For the Simple Language, we don't have online documentation. However, if
your language provides
- * references pages online, URLs for the element can be returned here.
- */
- @Override
- public @Nullable List<String> getUrlFor(PsiElement element, PsiElement
originalElement) {
- return null;
- }
-
- /**
- * Extracts the key, value, file and documentation comment of a Simple
key/value entry and returns
- * a formatted representation of the information.
- */
- @Override
- public @Nullable String generateDoc(PsiElement element, @Nullable PsiElement
originalElement) {
- if (element instanceof SimpleProperty) {
- final String key = ((SimpleProperty) element).getKey();
- final String value = ((SimpleProperty) element).getValue();
- final String file =
SymbolPresentationUtil.getFilePathPresentation(element.getContainingFile());
- final String docComment =
SimpleUtil.findDocumentationComment((SimpleProperty) element);
-
- return renderFullDoc(key, value, file, docComment);
- }
- return null;
- }
-
- /**
- * Provides the information in which file the Simple language key/value is
defined.
- */
- @Override
- public @Nullable String getQuickNavigateInfo(PsiElement element, PsiElement
originalElement) {
- if (element instanceof SimpleProperty) {
- final String key = ((SimpleProperty) element).getKey();
- final String file =
SymbolPresentationUtil.getFilePathPresentation(element.getContainingFile());
- return "\"" + key + "\" in " + file;
- }
- return null;
- }
-
- /**
- * Provides documentation when a Simple Language element is hovered with the
mouse.
- */
- @Override
- public @Nullable String generateHoverDoc(@NotNull PsiElement element,
@Nullable PsiElement originalElement) {
- return generateDoc(element, originalElement);
- }
-
- /**
- * Creates a key/value row for the rendered documentation.
- */
- private void addKeyValueSection(String key, String value, StringBuilder sb) {
- sb.append(DocumentationMarkup.SECTION_HEADER_START);
- sb.append(key);
- sb.append(DocumentationMarkup.SECTION_SEPARATOR);
- sb.append("<p>");
- sb.append(value);
- sb.append(DocumentationMarkup.SECTION_END);
- }
-
- /**
- * Creates the formatted documentation using {@link DocumentationMarkup}.
See the Java doc of
- * {@link
com.intellij.lang.documentation.DocumentationProvider#generateDoc(PsiElement,
PsiElement)} for more
- * information about building the layout.
- */
- private String renderFullDoc(String key, String value, String file, String
docComment) {
- StringBuilder sb = new StringBuilder();
- sb.append(DocumentationMarkup.DEFINITION_START);
- sb.append("Simple Property");
- sb.append(DocumentationMarkup.DEFINITION_END);
- sb.append(DocumentationMarkup.CONTENT_START);
- sb.append(value);
- sb.append(DocumentationMarkup.CONTENT_END);
- sb.append(DocumentationMarkup.SECTIONS_START);
- addKeyValueSection("Key:", key, sb);
- addKeyValueSection("Value:", value, sb);
- addKeyValueSection("File:", file, sb);
- addKeyValueSection("Comment:", docComment, sb);
- sb.append(DocumentationMarkup.SECTIONS_END);
- return sb.toString();
- }
-
-}
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleFindUsagesProvider.java
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleFindUsagesProvider.java
deleted file mode 100644
index 788be22..0000000
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleFindUsagesProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2000-2020 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.
-
-package org.apache.nlpcraft.idl.idea.plugin;
-
-import com.intellij.lang.cacheBuilder.DefaultWordsScanner;
-import com.intellij.lang.cacheBuilder.WordsScanner;
-import com.intellij.lang.findUsages.FindUsagesProvider;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.PsiNamedElement;
-import com.intellij.psi.tree.TokenSet;
-import org.apache.nlpcraft.idl.idea.plugin.psi.SimpleProperty;
-import org.apache.nlpcraft.idl.idea.plugin.psi.SimpleTypes;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-public class SimpleFindUsagesProvider implements FindUsagesProvider {
-
- @Nullable
- @Override
- public WordsScanner getWordsScanner() {
- return new DefaultWordsScanner(new SimpleLexerAdapter(),
- TokenSet.create(SimpleTypes.KEY),
- TokenSet.create(SimpleTypes.COMMENT),
- TokenSet.EMPTY);
- }
-
- @Override
- public boolean canFindUsagesFor(@NotNull PsiElement psiElement) {
- return psiElement instanceof PsiNamedElement;
- }
-
- @Nullable
- @Override
- public String getHelpId(@NotNull PsiElement psiElement) {
- return null;
- }
-
- @NotNull
- @Override
- public String getType(@NotNull PsiElement element) {
- if (element instanceof SimpleProperty) {
- return "simple property";
- } else {
- return "";
- }
- }
-
- @NotNull
- @Override
- public String getDescriptiveName(@NotNull PsiElement element) {
- if (element instanceof SimpleProperty) {
- return ((SimpleProperty) element).getKey();
- } else {
- return "";
- }
- }
-
- @NotNull
- @Override
- public String getNodeText(@NotNull PsiElement element, boolean useFullName) {
- if (element instanceof SimpleProperty) {
- return ((SimpleProperty) element).getKey() +
SimpleAnnotator.SIMPLE_SEPARATOR_STR + ((SimpleProperty) element).getValue();
- } else {
- return "";
- }
- }
-
-}
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleLanguageCodeStyleSettingsProvider.java
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleLanguageCodeStyleSettingsProvider.java
deleted file mode 100644
index 5986b50..0000000
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleLanguageCodeStyleSettingsProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2000-2020 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.
-
-package org.apache.nlpcraft.idl.idea.plugin;
-
-import com.intellij.lang.Language;
-import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable;
-import com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider;
-import org.jetbrains.annotations.NotNull;
-
-public class SimpleLanguageCodeStyleSettingsProvider extends
LanguageCodeStyleSettingsProvider {
-
- @NotNull
- @Override
- public Language getLanguage() {
- return NCIdlLanguage.INSTANCE;
- }
-
- @Override
- public void customizeSettings(@NotNull CodeStyleSettingsCustomizable
consumer, @NotNull SettingsType settingsType) {
- if (settingsType == SettingsType.SPACING_SETTINGS) {
- consumer.showStandardOptions("SPACE_AROUND_ASSIGNMENT_OPERATORS");
- consumer.renameStandardOption("SPACE_AROUND_ASSIGNMENT_OPERATORS",
"Separator");
- } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) {
- consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE");
- }
- }
-
- @Override
- public String getCodeSample(@NotNull SettingsType settingsType) {
- return "# You are reading the \".properties\" entry.\n" +
- "! The exclamation mark can also mark text as comments.\n" +
- "website = https://en.wikipedia.org/\n" +
- "\n" +
- "language = English\n" +
- "# The backslash below tells the application to continue
reading\n" +
- "# the value onto the next line.\n" +
- "message = Welcome to \\\n" +
- " Wikipedia!\n" +
- "# Add spaces to the key\n" +
- "key\\ with\\ spaces = This is the value that could be looked up
with the key \"key with spaces\".\n" +
- "# Unicode\n" +
- "tab : \\u0009";
- }
-
-}
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleRefactoringSupportProvider.java
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleRefactoringSupportProvider.java
deleted file mode 100644
index 297b307..0000000
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleRefactoringSupportProvider.java
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2000-2020 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.
-
-package org.apache.nlpcraft.idl.idea.plugin;
-
-import com.intellij.lang.refactoring.RefactoringSupportProvider;
-import com.intellij.psi.PsiElement;
-import org.apache.nlpcraft.idl.idea.plugin.psi.SimpleProperty;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-public class SimpleRefactoringSupportProvider extends
RefactoringSupportProvider {
-
- @Override
- public boolean isMemberInplaceRenameAvailable(@NotNull PsiElement
elementToRename, @Nullable PsiElement context) {
- return (elementToRename instanceof SimpleProperty);
- }
-
-}
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleReference.java
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleReference.java
deleted file mode 100644
index 7e7ca74..0000000
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleReference.java
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2000-2020 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.
-
-package org.apache.nlpcraft.idl.idea.plugin;
-
-import com.intellij.codeInsight.lookup.LookupElement;
-import com.intellij.codeInsight.lookup.LookupElementBuilder;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.TextRange;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.PsiElementResolveResult;
-import com.intellij.psi.PsiPolyVariantReference;
-import com.intellij.psi.PsiReferenceBase;
-import com.intellij.psi.ResolveResult;
-import org.apache.nlpcraft.idl.idea.plugin.psi.SimpleProperty;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class SimpleReference extends PsiReferenceBase<PsiElement> implements
PsiPolyVariantReference {
-
- private final String key;
-
- public SimpleReference(@NotNull PsiElement element, TextRange textRange) {
- super(element, textRange);
- key = element.getText().substring(textRange.getStartOffset(),
textRange.getEndOffset());
- }
-
- @NotNull
- @Override
- public ResolveResult[] multiResolve(boolean incompleteCode) {
- Project project = myElement.getProject();
- final List<SimpleProperty> properties = SimpleUtil.findProperties(project,
key);
- List<ResolveResult> results = new ArrayList<>();
- for (SimpleProperty property : properties) {
- results.add(new PsiElementResolveResult(property));
- }
- return results.toArray(new ResolveResult[results.size()]);
- }
-
- @Nullable
- @Override
- public PsiElement resolve() {
- ResolveResult[] resolveResults = multiResolve(false);
- return resolveResults.length == 1 ? resolveResults[0].getElement() : null;
- }
-
- @NotNull
- @Override
- public Object[] getVariants() {
- Project project = myElement.getProject();
- List<SimpleProperty> properties = SimpleUtil.findProperties(project);
- List<LookupElement> variants = new ArrayList<>();
- for (final SimpleProperty property : properties) {
- if (property.getKey() != null && property.getKey().length() > 0) {
- variants.add(LookupElementBuilder
- .create(property).withIcon(NCPluginIcons.FILE)
- .withTypeText(property.getContainingFile().getName())
- );
- }
- }
- return variants.toArray();
- }
-
-}
diff --git
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleReferenceContributor.java
b/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleReferenceContributor.java
deleted file mode 100644
index a6c92e6..0000000
---
a/nlpcraft-idl-idea-plugin/src/main/java/org/apache/nlpcraft/idl/idea/plugin/SimpleReferenceContributor.java
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2000-2020 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.
-
-package org.apache.nlpcraft.idl.idea.plugin;
-
-import com.intellij.openapi.util.TextRange;
-import com.intellij.patterns.PlatformPatterns;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.PsiLiteralExpression;
-import com.intellij.psi.PsiReference;
-import com.intellij.psi.PsiReferenceContributor;
-import com.intellij.psi.PsiReferenceProvider;
-import com.intellij.psi.PsiReferenceRegistrar;
-import com.intellij.util.ProcessingContext;
-import org.jetbrains.annotations.NotNull;
-
-import static
org.apache.nlpcraft.idl.idea.plugin.SimpleAnnotator.SIMPLE_PREFIX_STR;
-import static
org.apache.nlpcraft.idl.idea.plugin.SimpleAnnotator.SIMPLE_SEPARATOR_STR;
-
-public class SimpleReferenceContributor extends PsiReferenceContributor {
-
- @Override
- public void registerReferenceProviders(@NotNull PsiReferenceRegistrar
registrar) {
-
registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiLiteralExpression.class),
- new PsiReferenceProvider() {
- @NotNull
- @Override
- public PsiReference[] getReferencesByElement(@NotNull PsiElement
element,
- @NotNull
ProcessingContext context) {
- PsiLiteralExpression literalExpression =
(PsiLiteralExpression) element;
- String value = literalExpression.getValue() instanceof String ?
- (String) literalExpression.getValue() : null;
- if ((value != null && value.startsWith(SIMPLE_PREFIX_STR +
SIMPLE_SEPARATOR_STR))) {
- TextRange property = new
TextRange(SIMPLE_PREFIX_STR.length() + SIMPLE_SEPARATOR_STR.length() + 1,
- value.length() + 1);
- return new PsiReference[]{new SimpleReference(element,
property)};
- }
- return PsiReference.EMPTY_ARRAY;
- }
- });
- }
-
-}
diff --git a/nlpcraft-idl-idea-plugin/src/main/resources/META-INF/plugin.xml
b/nlpcraft-idl-idea-plugin/src/main/resources/META-INF/plugin.xml
index 0f6b4b5..3a08d9c 100644
--- a/nlpcraft-idl-idea-plugin/src/main/resources/META-INF/plugin.xml
+++ b/nlpcraft-idl-idea-plugin/src/main/resources/META-INF/plugin.xml
@@ -1,20 +1,15 @@
<!-- Copyright 2000-2020 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. -->
-
<idea-plugin>
-
- <!-- Unique id for this plugin. Must stay constant for the life of the
plugin. -->
- <id>org.apache.nlpcraft.idl.idea.plugin</id>
-
- <!-- Text to display as name on Preferences/Settings | Plugin page -->
- <name>NlpCraft IDL</name>
-
- <!-- Product and plugin compatibility requirements -->
- <depends>com.intellij.modules.platform</depends>
- <depends>com.intellij.java</depends>
-
- <!-- Text to display as description on Preferences/Settings | Plugin page -->
- <description>
- <![CDATA[
+ <!-- Unique id for this plugin. Must stay constant for the life of the
plugin. -->
+ <id>org.apache.nlpcraft.idl.idea.plugin</id>
+ <!-- Text to display as name on Preferences/Settings | Plugin page -->
+ <name>NlpCraft IDL</name>
+ <!-- Product and plugin compatibility requirements -->
+ <depends>com.intellij.modules.platform</depends>
+ <depends>com.intellij.java</depends>
+ <!-- Text to display as description on Preferences/Settings | Plugin page
-->
+ <description>
+ <![CDATA[
Demonstrates how to add custom language support to an IntelliJ
Platform-based IDE. <br>Defines a new language,
<i>Simple language</i> with support for syntax highlighting,
annotations, code completion, and other features.
<br>
@@ -22,53 +17,51 @@
<a
href="https://plugins.jetbrains.com/docs/intellij/custom-language-support-tutorial.html">Custom
Language Tutorial</a> for more information.
]]>
- </description>
- <change-notes>
- <![CDATA[
+ </description>
+ <change-notes>
+ <![CDATA[
<ul>
<li><b>2.0.0</b> Convert to Gradle-based plugin.</li>
<li><b>1.0.0</b> Release 2018.3 and earlier.</li>
</ul>
]]>
- </change-notes>
+ </change-notes>
+ <!-- Text to display as company information on Preferences/Settings |
Plugin page -->
+ <vendor url="https://plugins.jetbrains.com">IntelliJ Platform SDK</vendor>
+ <extensions defaultExtensionNs="com.intellij">
+ <fileType name="NlpCraft IDL file"
implementationClass="org.apache.nlpcraft.idl.idea.plugin.NCIdlFileType"
+ fieldName="INSTANCE" language="NlpCraftIdl" extensions="idl"/>
+ <!--
+ Only required for versions of the IntelliJ Platform prior to v2019.2.
+ Use 'com.intellij.fileTypeFactory' extension point INSTEAD of above
'com.intellij.fileType'.
+ <fileTypeFactory
implementation="org.intellij.sdk.language.SimpleFileTypeFactory"/>
+ -->
+ <lang.parserDefinition language="NlpCraftIdl"
+
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleParserDefinition"/>
+
+ <lang.syntaxHighlighterFactory language="NlpCraftIdl"
+
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleSyntaxHighlighterFactory"/>
+
+ <colorSettingsPage
implementation="org.apache.nlpcraft.idl.idea.plugin.SimpleColorSettingsPage"/>
+
+ <annotator language="JAVA"
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleAnnotator"/>
+
+ <codeInsight.lineMarkerProvider language="JAVA"
+
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleLineMarkerProvider"/>
+
+ <completion.contributor language="NlpCraftIdl"
+
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleCompletionContributor"/>
+
+ <lang.foldingBuilder language="JAVA"
+
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleFoldingBuilder"/>
- <!-- Text to display as company information on Preferences/Settings | Plugin
page -->
- <vendor url="https://plugins.jetbrains.com">IntelliJ Platform SDK</vendor>
+ <lang.psiStructureViewFactory language="NlpCraftIdl"
+
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleStructureViewFactory"/>
- <extensions defaultExtensionNs="com.intellij">
- <fileType name="NlpCraft IDL file"
-
implementationClass="org.apache.nlpcraft.idl.idea.plugin.NCIdlFileType"
- fieldName="INSTANCE"
- language="NlpCraftIdl" extensions="idl"/>
- <!--
- Only required for versions of the IntelliJ Platform prior to v2019.2.
- Use 'com.intellij.fileTypeFactory' extension point INSTEAD of above
'com.intellij.fileType'.
- <fileTypeFactory
implementation="org.intellij.sdk.language.SimpleFileTypeFactory"/>
- -->
- <lang.parserDefinition language="NlpCraftIdl"
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleParserDefinition"/>
- <lang.syntaxHighlighterFactory language="NlpCraftIdl"
-
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleSyntaxHighlighterFactory"/>
- <colorSettingsPage
implementation="org.apache.nlpcraft.idl.idea.plugin.SimpleColorSettingsPage"/>
- <annotator language="JAVA"
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleAnnotator"/>
- <codeInsight.lineMarkerProvider language="JAVA"
-
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleLineMarkerProvider"/>
- <completion.contributor language="NlpCraftIdl"
-
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleCompletionContributor"/>
- <psi.referenceContributor language="JAVA"
-
implementation="org.apache.nlpcraft.idl.idea.plugin.SimpleReferenceContributor"/>
- <lang.refactoringSupport language="NlpCraftIdl"
-
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleRefactoringSupportProvider"/>
- <lang.findUsagesProvider language="NlpCraftIdl"
-
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleFindUsagesProvider"/>
- <lang.foldingBuilder language="JAVA"
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleFoldingBuilder"/>
- <gotoSymbolContributor
implementation="org.apache.nlpcraft.idl.idea.plugin.SimpleChooseByNameContributor"/>
- <lang.psiStructureViewFactory language="NlpCraftIdl"
-
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleStructureViewFactory"/>
- <lang.formatter language="NlpCraftIdl"
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleFormattingModelBuilder"/>
- <codeStyleSettingsProvider
implementation="org.apache.nlpcraft.idl.idea.plugin.SimpleCodeStyleSettingsProvider"/>
- <langCodeStyleSettingsProvider
implementation="org.apache.nlpcraft.idl.idea.plugin.SimpleLanguageCodeStyleSettingsProvider"/>
- <lang.commenter language="NlpCraftIdl"
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleCommenter"/>
- <lang.documentationProvider language="NlpCraftIdl"
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleDocumentationProvider"/>
- </extensions>
+ <lang.formatter language="NlpCraftIdl"
+
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleFormattingModelBuilder"/>
+ <lang.commenter language="NlpCraftIdl"
+
implementationClass="org.apache.nlpcraft.idl.idea.plugin.SimpleCommenter"/>
+ </extensions>
</idea-plugin>