Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code completion and navigation for Cockpitng 'widgets' #186

Merged
merged 1 commit into from
Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions resources/META-INF/optional-lang-dependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.codeInsight.completion.provider.CngItemAttributeCodeCompletionProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.codeInsight.completion.provider.CngFlowItemAttributeCodeCompletionProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.codeInsight.completion.provider.CngEditorDefinitionCodeCompletionProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.codeInsight.completion.provider.CngActionDefinitionCompletionProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.codeInsight.completion.provider.CngWidgetDefinitionCompletionProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.codeInsight.completion.provider.CngWidgetIdCompletionProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.codeInsight.completion.provider.CngWidgetSettingCompletionProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.codeInsight.completion.provider.CngWidgetConnectionWidgetIdCompletionProvider"/>

<projectService serviceInterface="com.intellij.idea.plugin.hybris.system.cockpitng.meta.CngMetaModelAccess"
serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.meta.impl.CngMetaModelAccessImpl"/>
Expand Down Expand Up @@ -296,6 +301,7 @@
<postStartupActivity implementation="com.intellij.idea.plugin.hybris.startup.HybrisPluginUpdateCheckerStartupActivity"/>
<postStartupActivity implementation="com.intellij.idea.plugin.hybris.startup.ItemsXmlFileOpenStartupActivity"/>
<postStartupActivity implementation="com.intellij.idea.plugin.hybris.startup.ImpexHeaderHighlighterStartupActivity"/>
<postStartupActivity implementation="com.intellij.idea.plugin.hybris.startup.PreLoadSystemsStartupActivity"/>

<editorFactoryListener implementation="com.intellij.idea.plugin.hybris.impex.assistance.event.ImpexEditorFactoryListener"/>
</extensions>
Expand Down
15 changes: 10 additions & 5 deletions resources/META-INF/plugin-internal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.provider.CngTSItemAttributeReferenceProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.provider.CngFlowTSItemAttributeReferenceProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.provider.CngEditorDefinitionReferenceProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.provider.CngActionDefinitionReferenceProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.provider.CngWidgetDefinitionReferenceProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.provider.CngWidgetReferenceProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.provider.CngWidgetSettingReferenceProvider"/>
<applicationService serviceImplementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.provider.CngWidgetConnectionWidgetIdReferenceProvider"/>
<psi.referenceContributor language="XML" implementation="com.intellij.idea.plugin.hybris.system.cockpitng.psi.contributor.CngReferenceContributor"/>
<psi.referenceContributor language="XML" implementation="com.intellij.idea.plugin.hybris.psi.reference.contributor.HybrisItemsXmlReferenceContributor"/>

Expand Down Expand Up @@ -83,11 +88,11 @@
class="com.intellij.idea.plugin.hybris.actions.HybrisToolsActionGroup">
<add-to-group group-id="ToolsMenu" anchor="last"/>
</group>
<!-- <action id="GenerateDomModel"-->
<!-- class="com.intellij.idea.plugin.hybris.system.type.model.generator.GenerateDomModelAction"-->
<!-- text="Generate DOM Model...">-->
<!-- <add-to-group group-id="ToolsMenu" anchor="last"/>-->
<!-- </action>-->
<action id="GenerateDomModel"
class="com.intellij.idea.plugin.hybris.system.type.model.generator.GenerateDomModelAction"
text="Generate DOM Model...">
<add-to-group group-id="ToolsMenu" anchor="last"/>
</action>
<action id="Console.Execute.Immediately"
class="com.intellij.openapi.actionSystem.EmptyAction"
text="Execute Current Statement">
Expand Down
33 changes: 16 additions & 17 deletions resources/META-INF/plugin-release-info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,22 @@
<li><i>Feature:</i> Added <code>extensioninfo.xml</code> DOM model and custom Icon (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/147" target="_blank" rel="nofollow">#147</a>)</li>
<li><i>Feature:</i> Added <code>process.xml</code> DOM model and custom Icon (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/148" target="_blank" rel="nofollow">#148</a>)</li>
<li><i>Feature:</i> Decreases cognitive complexity for Code Completion and custom Icons (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/152" target="_blank" rel="nofollow">#152</a>)</li>
<li><i>Feature:</i> Added code completion and navigation for Cockpitng elements
<ul>
<li><code>context -> type</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/165" target="_blank" rel="nofollow">#165</a>)</li>
<li><code>context -> parent</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/174" target="_blank" rel="nofollow">#174</a>)</li>
<li><code>context -> component</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/169" target="_blank" rel="nofollow">#169</a>)</li>
<li><code>actions -> action-id</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/172" target="_blank" rel="nofollow">#172</a>)</li>
<li><code>widgets -> widgetDefinitionId</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/173" target="_blank" rel="nofollow">#173</a>)</li>
<li><code>list-view -> qualifier</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/175" target="_blank" rel="nofollow">#175</a>)</li>
<li><code>explorer-tree -> type-node -> code</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/176" target="_blank" rel="nofollow">#176</a>)</li>
<li><code>editorArea -> attribute -> qualifier</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/177" target="_blank" rel="nofollow">#177</a>)</li>
<li><code>editorArea -> attribute -> editor</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/182" target="_blank" rel="nofollow">#182</a>)</li>
<li><code>advanced-search -> field -> name</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/178" target="_blank" rel="nofollow">#178</a>)</li>
<li><code>simple-search -> field -> name</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/179" target="_blank" rel="nofollow">#179</a>)</li>
<li><code>flow -> property-list -> property -> qualifier</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/180" target="_blank" rel="nofollow">#180</a>)</li>
<li><code>flow -> initialize -> type</code> (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/181" target="_blank" rel="nofollow">#181</a>)</li>
<li><code>type</code> and other <code>spring-bean</code>, improved performance (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/185" target="_blank" rel="nofollow">#185</a>)</li>
</ul>
<li><i>Feature:</i> Added Cockpitng files (widgets, config, definition) support, Model, completion and navigation
(<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/165" target="_blank" rel="nofollow">#165</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/174" target="_blank" rel="nofollow">#174</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/169" target="_blank" rel="nofollow">#169</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/172" target="_blank" rel="nofollow">#172</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/173" target="_blank" rel="nofollow">#173</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/175" target="_blank" rel="nofollow">#175</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/176" target="_blank" rel="nofollow">#176</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/177" target="_blank" rel="nofollow">#177</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/182" target="_blank" rel="nofollow">#182</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/178" target="_blank" rel="nofollow">#178</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/179" target="_blank" rel="nofollow">#179</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/180" target="_blank" rel="nofollow">#180</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/181" target="_blank" rel="nofollow">#181</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/185" target="_blank" rel="nofollow">#185</a>,
<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/186" target="_blank" rel="nofollow">#186</a>)
</li>
<li><i>Bug Fix:</i> FlexibleSearch code completion should not be case-sensitive for attributes (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/167" target="_blank" rel="nofollow">#167</a>)</li>
<li><i>Bug Fix:</i> [y] Tool Window Logo too dark for New UI (<a href="https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/95" target="_blank" rel="nofollow">#95</a>)</li>
Expand Down
11 changes: 11 additions & 0 deletions resources/icons/cockpitng_widget.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions resources/icons/cockpitng_widget_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ object HybrisConstants {

const val COCKPIT_NG_NAMESPACE_KEY = "COCKPIT_NG_NAMESPACE"
const val COCKPIT_NG_INITIALIZE_CONTEXT_TYPE = "ctx.TYPE_CODE"
const val COCKPIT_NG_WIDGET_ID_STUB = "STUB_"

private const val SRC_DIRECTORY = "src"
private const val SCALA_SRC_DIRECTORY = "scalasrc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ private HybrisIcons() {
public static final Icon EXTENSION_INFO = getIcon("/icons/extensionInfo.svg");
public static final Icon COCKPIT_NG_CONFIG = getIcon("/icons/cockpitng_config.svg");
public static final Icon COCKPIT_NG_WIDGETS = getIcon("/icons/cockpitng_widgets.svg");
public static final Icon COCKPIT_NG_WIDGET = getIcon("/icons/cockpitng_widget.svg");
public static final Icon COCKPIT_NG_WIDGET_DEFINITION = getIcon("/icons/cockpitng_widget_definition.svg");
public static final Icon COCKPIT_NG_ACTION_DEFINITION = getIcon("/icons/cockpitng_action_definition.svg");
public static final Icon COCKPIT_NG_EDITOR_DEFINITION = getIcon("/icons/cockpitng_editor_definition.svg");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA.
* Copyright (C) 2019 EPAM Systems <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.intellij.idea.plugin.hybris.startup

import com.intellij.idea.plugin.hybris.system.bean.meta.BSMetaModelAccess
import com.intellij.idea.plugin.hybris.system.cockpitng.meta.CngMetaModelAccess
import com.intellij.idea.plugin.hybris.system.type.meta.TSMetaModelAccess
import com.intellij.openapi.project.DumbService
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity

class PreLoadSystemsStartupActivity : StartupActivity {

override fun runActivity(project: Project) {
DumbService.getInstance(project).runReadActionInSmartMode {
TSMetaModelAccess.getInstance(project).getMetaModel()
BSMetaModelAccess.getInstance(project).getMetaModel()
CngMetaModelAccess.getInstance(project).getMetaModel()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,13 @@ class BSMetaModelAccessImpl(private val myProject: Project) : BSMetaModelAccess
)

override fun getMetaModel(): BSGlobalMetaModel {
return DumbService.getInstance(myProject).tryRunReadActionInSmartMode(
return DumbService.getInstance(myProject).runReadActionInSmartMode(
Computable {
if (myGlobalMetaModel.hasUpToDateValue() || lock.isWriteLocked || writeLock.isHeldByCurrentThread) {
return@Computable readMetaModelWithLock()
}
return@Computable writeMetaModelWithLock()
},
"Computing Bean System"
}
) ?: throw ProcessCanceledException()
}

Expand Down
Loading