Skip to content

Commit

Permalink
Merge pull request #43 from dmeybohm/fix-phpstorm-2020.3
Browse files Browse the repository at this point in the history
Fix PHPStorm 2020.3
  • Loading branch information
dmeybohm authored Dec 18, 2020
2 parents dd7852d + 4ec258e commit 50db97e
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 21 deletions.
33 changes: 20 additions & 13 deletions src/main/java/com/daveme/chocolateCakePHP/ConfigForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,29 @@ public void apply() {
private void createUIComponents() {
FullyQualifiedNameInsertHandler insertHandler = new FullyQualifiedNameInsertHandler();
try {
SwingUtilities.invokeAndWait(() -> {
PhpCompletionUtil.PhpFullyQualifiedNameTextFieldCompletionProvider completionProvider =
new FullyQualifiedNameTextFieldCompletionProvider(project, insertHandler);
appNamespaceTextField = new TextFieldWithCompletion(
project,
completionProvider,
"",
true,
true,
true,
true
);
});
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeAndWait(() -> {
setupHandler(insertHandler);
});
} else {
setupHandler(insertHandler);
}
} catch (InterruptedException | InvocationTargetException e) {
e.printStackTrace();
}
}

private void setupHandler(FullyQualifiedNameInsertHandler insertHandler) {
PhpCompletionUtil.PhpFullyQualifiedNameTextFieldCompletionProvider completionProvider =
new FullyQualifiedNameTextFieldCompletionProvider(project, insertHandler);
appNamespaceTextField = new TextFieldWithCompletion(
project,
completionProvider,
"",
true,
true,
true,
true
);
}
}
3 changes: 2 additions & 1 deletion src/main/kotlin/CakeIcons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ package com.daveme.chocolateCakePHP
import com.intellij.openapi.util.IconLoader

object CakeIcons {
val LOGO = IconLoader.getIcon("../../../../cake.icon.png")
@JvmField
val LOGO = IconLoader.getIcon("/icon/cake.icon.png", CakeIcons::class.java)
}
2 changes: 1 addition & 1 deletion src/main/kotlin/controller/ControllerFieldTypeProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.jetbrains.php.lang.psi.resolve.types.PhpTypeProvider4
class ControllerFieldTypeProvider : PhpTypeProvider4 {

override fun getKey(): Char {
return 0.toChar()
return '\u8312'
}

override fun complete(str: String?, project: Project?): PhpType? = null
Expand Down
10 changes: 7 additions & 3 deletions src/main/kotlin/controller/ControllerMethodLineMarker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ class ControllerMethodLineMarker : LineMarkerProvider {
.createLineMarkerInfo(nameIdentifier)
}

private fun addLineMarkerUnique(collection: MutableCollection<LineMarkerInfo<*>>, newMarker: LineMarkerInfo<*>?) {
private fun addLineMarkerUnique(collection: MutableCollection<in LineMarkerInfo<*>>, newMarker: LineMarkerInfo<*>?) {
if (newMarker == null) {
return
}
for (lineMarkerInfo in collection) {
val element = lineMarkerInfo.element ?: return
val markerElement = lineMarkerInfo as? LineMarkerInfo<*> ?: continue
val element = markerElement.element ?: return
val otherElement = newMarker.element
if (element == otherElement) {
return
Expand All @@ -50,7 +51,10 @@ class ControllerMethodLineMarker : LineMarkerProvider {
collection.add(newMarker)
}

override fun collectSlowLineMarkers(list: List<PsiElement>, collection: MutableCollection<LineMarkerInfo<*>>) {
override fun collectSlowLineMarkers(
list: MutableList<out PsiElement>,
collection: MutableCollection<in LineMarkerInfo<*>>
) {
for (element in list) {
val settings = Settings.getInstance(element.project)
if (!settings.enabled) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/view/ThisVariableInViewTypeProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.jetbrains.php.lang.psi.resolve.types.PhpTypeProvider4
class ThisVariableInViewTypeProvider : PhpTypeProvider4 {

override fun getKey(): Char {
return 0.toChar()
return '\u8313'
}

override fun complete(p0: String?, p1: Project?): PhpType? = null
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/view/ViewHelperInViewHelperTypeProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.jetbrains.php.lang.psi.resolve.types.PhpTypeProvider4
class ViewHelperInViewHelperTypeProvider : PhpTypeProvider4 {

override fun getKey(): Char {
return 0.toChar()
return '\u8314'
}

override fun complete(p0: String?, p1: Project?): PhpType? = null
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/view/ViewHelperInViewTypeProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.jetbrains.php.lang.psi.resolve.types.PhpTypeProvider4
class ViewHelperInViewTypeProvider : PhpTypeProvider4 {

override fun getKey(): Char {
return 0.toChar()
return '\u8315'
}

override fun complete(p0: String?, p1: Project?): PhpType? = null
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 50db97e

Please sign in to comment.