GithubHelp home page GithubHelp logo

antonirokitnicki / advancedexpressionfolding Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cheptsov/advancedexpressionfolding

5.0 5.0 2.0 1.63 MB

Advanced Java Folding 2 ​(Fork)​

Home Page: https://plugins.jetbrains.com/plugin/23659-advanced-java-folding-2-fork-

License: Apache License 2.0

Java 85.73% HTML 0.04% Kotlin 13.85% Python 0.38%
folding intellij-plugin java javascript kotlin scala typescript

advancedexpressionfolding's People

Contributors

actions-user avatar alshain avatar amaembo avatar antonirokitnicki avatar cheptsov avatar dependabot[bot] avatar github-actions[bot] avatar jfcabral avatar peterschmidt85 avatar stokito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

advancedexpressionfolding's Issues

Incorrect CachedValue use: same CV with different captured context, this can cause unstable results and invalid PSI access.

com.intellij.diagnostic.PluginException: Incorrect CachedValue use: same CV with different captured context, this can cause unstable results and invalid PSI access. Field arg$2 in class com.intellij.advancedExpressionFolding.AdvancedExpressionFoldingBuilder$$Lambda$3514/0x0000000801865610 has non-equivalent values: DocumentImpl[file:///Users/ant/IdeaProjects/untitled/src/ElvisTestData.java] (com.intellij.openapi.editor.impl.DocumentImpl) and DocumentImpl[file:///Users/ant/IdeaProjects/untitled/src/SimpleOptionalTestData.java] (com.intellij.openapi.editor.impl.DocumentImpl) Either make equals()` hold for these values, or avoid this dependency, e.g. by extracting CV provider into a static method. [Plugin: com.intellij.bigdecimal-folding2]
at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:83)
at com.intellij.diagnostic.PluginException.logPluginError(PluginException.java:100)
at com.intellij.util.CachedValueStabilityChecker.complain(CachedValueStabilityChecker.java:164)
at com.intellij.util.CachedValueStabilityChecker.checkFieldEquivalence(CachedValueStabilityChecker.java:131)
at com.intellij.util.CachedValueStabilityChecker.checkFieldEquivalence(CachedValueStabilityChecker.java:127)
at com.intellij.util.CachedValueStabilityChecker.checkProvidersEquivalent(CachedValueStabilityChecker.java:83)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:67)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
at com.intellij.advancedExpressionFolding.AdvancedExpressionFoldingBuilder.getExpression(AdvancedExpressionFoldingBuilder.java:353)
at com.intellij.advancedExpressionFolding.AdvancedExpressionFoldingBuilder.getNonSyntheticExpression(AdvancedExpressionFoldingBuilder.java:372)
at com.intellij.advancedExpressionFolding.AdvancedExpressionFoldingHighlightingComponent.findHighlightingExpression(AdvancedExpressionFoldingHighlightingComponent.java:168)
at com.intellij.advancedExpressionFolding.AdvancedExpressionFoldingHighlightingComponent.mouseMoved(AdvancedExpressionFoldingHighlightingComponent.java:262)
at jdk.internal.reflect.GeneratedMethodAccessor130.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:120)
at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:85)
at jdk.proxy2/jdk.proxy2.$Proxy95.mouseMoved(Unknown Source)
at com.intellij.openapi.editor.impl.EditorImpl$MyMouseMotionListener.mouseMoved(EditorImpl.java:4495)
at java.desktop/java.awt.Component.processMouseMotionEvent(Component.java:6702)
at java.desktop/javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3403)
at java.desktop/java.awt.Component.processEvent(Component.java:6426)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4969)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4596)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4524)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2809)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:831)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:753)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:838)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

`

Folding settings state is not in sync and not changeable

Hi,

First, let me thank you for continuing support of this extension while JetBrains stopped supporting it.
I'm trying your extension as it comes handy on the new project I am working on at my company, as they are using "raw" Java 8 with all the boilerplate code I used to not see anymore while working with Lombok and also Java 17.
Specifically seeing again explicit getters and setters taking up a good part of the code.

I wanted to only enable some of the folding and especially not the variable declaration as I' not familiar with the project yet and having var everywhere does not help me much for the time being.
However I noticed a buggy behaviour on the settings section (located in Editor > General > Code Folding).
Initially, I was on version 1.0.3 where I could notcie that even when deslecting some settings, it was not applying to the code (typically "Variable declarations" were still shown as var even when reopening files -- reopening the IDE helped it I think).
After upgrading yesterday to 1.0.6 though, I noticed that I couldn't persist unselecting settings.

Reproduction:

  • Go to Editor > General > Code Folding
  • Unselect Variable declarations
    • Apply becomes selectable and the settings section is highlighted blue
  • Click Apply
    • Apply stays selectable and the settings section is still highlighted blue
    • No crash or an y log seems to occur in idea.log
  • Exit and open again the settings
    • The settings were not persisted

Interestingly enough the Variable declarations are not folded, so it seems like it could just be an issue with the IDE settings part not showing what is enabled or not (which is a problem as you can neither enable or disable those that were already set when installing the plugin).

Let me know if I can provide you with any details so I can help you identify the issue if you manage to reproduce it.
Or let me know how I can identify it with you cannot reproduce.
I would be happy to help improve the plugin as I rely on it.
There is some alternative folding suggestions I already thought of regarding getter/setter and strings that could be added and controlled by settings. Plus other things not folded yet.

Note: It would be nice also to put the plugin's settings in its own section of the same folding section to see easily what is not built-in.


IntelliJ IDEA 2023.3.2 (Community Edition)
Build #IC-233.13135.103, built on December 20, 2023
Runtime version: 17.0.9+7-b1087.9 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.2.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Registry:
ide.tree.horizontal.default.autoscrolling=false
project.tree.structure.show.url=false
ide.experimental.ui=true
Non-Bundled Plugins:
Docker (233.13135.108)
gherkin (233.11799.165)
com.github.bigdecimal-folding2 (1.0.6)
cucumber-java (233.11799.196)
GrepConsole (12.22.1-IJ2021.1)
Kotlin: 233.13135.103-IJ

  • New UI enabled
  • Plugin version 1.0.6 as published in the extra repository

Not compatible with IDEA 2023.3.3

I just switched to IDEA 2023.3.3 and got this error. It appears as a separate small window when I start the IDE.

Internal error. Please refer to https://jb.gg/ide/critical-startup-errors

java.lang.NullPointerException: Cannot invoke "com.intellij.openapi.application.Application.getService(java.lang.Class)" because the return value of "com.intellij.openapi.application.ApplicationManager.getApplication()" is null
    at com.intellij.internal.statistic.eventLog.StatisticsEventLogProviderUtil.getEventLogProvider(StatisticsEventLogProviderUtil.kt:15)
    at com.intellij.internal.statistic.eventLog.events.BaseEventId.getLogger$intellij_platform_statistics(EventId.kt:14)
    at com.intellij.internal.statistic.eventLog.events.EventId1.log(EventId.kt:46)
    at com.intellij.ide.E.E.O.P(O.java:202)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.intellij.idea.X.invokeSuspend(X.java:59)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.intellij.idea.X.P(X.java)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.intellij.idea.X.invoke(X.java)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
    at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
    at com.intellij.idea.MainImpl.start(MainImpl.kt:58)
    at com.intellij.platform.ide.bootstrap.StartupUtil$startApplication$8$2.invokeSuspend(main.kt:346)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at com.intellij.idea.Main.mainImpl(Main.kt:63)
    at com.intellij.idea.Main.mainImpl$default(Main.kt:49)
    at com.intellij.idea.Main.main(Main.kt:46)
    Suppressed: com.intellij.diagnostic.PluginException: com.intellij.advancedExpressionFolding.AdvancedExpressionFoldingSettings [Plugin: com.github.advanced-java-folding2]
        at com.intellij.serviceContainer.ComponentManagerImpl.registerServices2(ComponentManagerImpl.kt:854)
        at com.intellij.serviceContainer.ComponentManagerImpl.registerServices(ComponentManagerImpl.kt:806)
        at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:403)
        at com.intellij.openapi.client.ClientAwareComponentManager.registerComponents(ClientAwareComponentManager.kt:58)
        at com.intellij.platform.ide.bootstrap.ApplicationLoader$initServiceContainer$2.invokeSuspend(ApplicationLoader.kt:197)
        at com.intellij.platform.ide.bootstrap.ApplicationLoader$initServiceContainer$2.invoke(ApplicationLoader.kt)
        at com.intellij.platform.ide.bootstrap.ApplicationLoader$initServiceContainer$2.invoke(ApplicationLoader.kt)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
        at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
        at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
        at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
        at com.intellij.platform.ide.bootstrap.ApplicationLoader.initServiceContainer(ApplicationLoader.kt:196)
        at com.intellij.platform.ide.bootstrap.ApplicationLoader.access$initServiceContainer(ApplicationLoader.kt:1)
        at com.intellij.platform.ide.bootstrap.ApplicationLoader$initServiceContainer$1.invokeSuspend(ApplicationLoader.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:270)
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    Caused by: com.intellij.platform.instanceContainer.internal.InstanceAlreadyRegisteredException: com.intellij.advancedExpressionFolding.AdvancedExpressionFoldingSettings
        at com.intellij.platform.instanceContainer.internal.InstanceRegistrarImpl.registerInitializer(InstanceRegistrarImpl.kt:32)
        at com.intellij.serviceContainer.ComponentManagerImpl.registerServices2Inner(ComponentManagerImpl.kt:910)
        at com.intellij.serviceContainer.ComponentManagerImpl.registerServices2(ComponentManagerImpl.kt:847)
        ... 23 more

-----
Your JRE: 17.0.9+7-b1087.11 amd64 (JetBrains s.r.o.)
C:\Users\Semyon_Levin\AppData\Local\Programs\IntelliJ IDEA Ultimate\jbr

Could you please take a look?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.