Skip to content

838: Fixed java.lang.NoClassDefFoundError for com.intellij.lang.jsgraphql.GraphQLIcons #850

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

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
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ intellij {
'properties',
'CSS',
'JavaScriptLanguage',
'com.intellij.lang.jsgraphql:3.0.0',
'com.intellij.lang.jsgraphql:3.1.2',
'platform-images',
'copyright'
]
Expand Down Expand Up @@ -69,7 +69,7 @@ sourceSets {
publishPlugin {
token = System.getenv("MAGENTO_PHPSTORM_intellijPublishToken")
if (Boolean.valueOf(System.getenv("MAGENTO_PHPSTORM_isAlpha"))) {
channels 'alpha'
channels = ['alpha']
version = version + "-alpha-" + getDate()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,51 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.linemarker.php;

import com.intellij.codeInsight.daemon.LineMarkerInfo;
import com.intellij.codeInsight.daemon.LineMarkerProvider;
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder;
import com.intellij.lang.jsgraphql.GraphQLIcons;
import com.intellij.lang.jsgraphql.icons.GraphQLIcons;
import com.intellij.psi.PsiElement;
import com.intellij.psi.util.PsiTreeUtil;
import com.jetbrains.php.lang.psi.elements.PhpClass;
import com.magento.idea.magento2plugin.project.Settings;
import com.magento.idea.magento2plugin.util.magento.graphql.GraphQlUsagesCollector;
import com.magento.idea.magento2plugin.util.magento.graphql.GraphQlUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class GraphQlResolverUsageLineMarkerProvider implements LineMarkerProvider {
@Nullable

@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement psiElement) {
public @Nullable LineMarkerInfo<?> getLineMarkerInfo(final @NotNull PsiElement psiElement) {
return null;
}

@Override
public void collectSlowLineMarkers(@NotNull List<? extends PsiElement> psiElements, @NotNull Collection<? super LineMarkerInfo<?>> collection) {
if (psiElements.size() > 0) {
if (!Settings.isEnabled(psiElements.get(0).getProject())) {
return;
}
public void collectSlowLineMarkers(
final @NotNull List<? extends PsiElement> psiElements,
final @NotNull Collection<? super LineMarkerInfo<?>> collection
) {
if (!psiElements.isEmpty() && !Settings.isEnabled(psiElements.get(0).getProject())) {
return;
}

for (PsiElement psiElement : psiElements) {
for (final PsiElement psiElement : psiElements) {
if (psiElement instanceof PhpClass) {
List<? extends PsiElement> results;

if (!GraphQlUtil.isResolver((PhpClass) psiElement)) {
return;
}
GraphQlUsagesCollector collector = new GraphQlUsagesCollector();
results = collector.getGraphQLUsages((PhpClass) psiElement);
final GraphQlUsagesCollector collector = new GraphQlUsagesCollector();//NOPMD
final List<? extends PsiElement> results = collector.getGraphQLUsages(
(PhpClass) psiElement
);

if (results.size() > 0 ) {
if (!results.isEmpty()) {
collection.add(NavigationGutterIconBuilder
.create(GraphQLIcons.FILE)
.setTargets(results)
Expand Down