Fork me on GitHub
#cursive
<
2023-07-04
>
onetom08:07:10

no issues so far. there are no exceptions at all during a fresh ide start! nice and clean (and fast too!) 🙂

cfleming08:07:03

That’s a nice change 🙂

cfleming08:07:24

I think it’s getting there, next thing is to fix the transitive tests problem.

onetom09:07:57

intellij eap is throwing errors like this regularly, but probably it's not cursive induced:

com.intellij.diagnostic.PluginException: PSI element is provided on EDT by com.intellij.ide.actions.searcheverywhere.SearchEverywhereUI.getData("selectedItems"). Please move that to a BGT data provider using PlatformCoreDataKeys.BGT_DATA_PROVIDER

onetom09:07:57

i do have some symbol resolution issues, but it's probably not new, i just don't usually look at this part of the code. the underlined part has this issue:

checkout-session-params cannot be resolved
the protocol is defined in another ns like so:
(ns ginoco.stripe
  (:require
    [gini.common :refer :all]
    [clojure.string :as str]
    [ :as io]
    [medley.core :as medley]
    [tick.core :as t]))

(defprotocol Client
  "Stripe client, with only operations needed to handle subscriptions."

  (create-checkout-session! [_ params]
    "Expects a checkout session object as described here:
...
and the reify is in this NS:
(ns ginoco.stripe.fake
  (:require
    [ginoco.api :as api]
    [ginoco.stripe :as stripe]
    [medley.core :as medley]
    [tick.core :as t])
  (:import
    (clojure.lang IDeref)
    (ginoco.stripe Client)))
im both :importing & :requireing the ginoco.stripe NS, which has the protocol definition. could that be the problem?

onetom09:07:42

i changed Client to ginoco.stripe/Client then the resolution issues are gone, but i got this Cursive exception:

java.lang.Throwable: Invalid state of lookup. Selected item [exists: false], but items list is empty.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:370)
	at com.intellij.stats.completion.tracker.CompletionFileLogger.itemSelectedByTyping(CompletionLoggerImpl.kt:107)
	at com.intellij.stats.completion.tracker.CompletionActionsTracker.lookupCanceled(CompletionActionsTracker.kt:39)
	at com.intellij.stats.completion.tracker.LoggerPerformanceTracker.lookupCanceled(LoggerPerformanceTracker.kt:68)
	at com.intellij.codeInsight.lookup.impl.LookupImpl.fireLookupCanceled(LookupImpl.java:978)
	at com.intellij.codeInsight.lookup.impl.LookupImpl.doHide(LookupImpl.java:1155)
	at com.intellij.codeInsight.lookup.impl.LookupImpl.hideLookup(LookupImpl.java:1129)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.hideAutopopupIfMeaningless(CompletionProgressIndicator.java:641)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.scheduleRestart(CompletionProgressIndicator.java:767)
	at com.intellij.codeInsight.lookup.impl.LookupTypedHandler.beforeCharTyped(LookupTypedHandler.java:110)
	at com.intellij.codeInsight.lookup.impl.LookupTypedHandler.execute(LookupTypedHandler.java:68)
	at com.intellij.codeInsight.template.emmet.EmmetPreviewTypedHandler.execute(EmmetPreviewTypedHandler.java:43)
	at cursive.editor.ClojureTypedHandler.execute(ClojureTypedHandler.java:75)
	at com.intellij.execution.impl.ConsoleViewImpl$MyTypedHandler.execute(ConsoleViewImpl.java:1170)

onetom09:07:25

which also snowballed into a Completion Stats Collector exception too:

java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
	at java.base/java.util.Objects.checkIndex(Objects.java:361)
	at java.base/java.util.ArrayList.get(ArrayList.java:427)
	at com.intellij.stats.validation.CompletionValidationState.visit(CompletionValidationState.kt:158)
...

onetom09:07:03

Actually, I don't know when do I need to import a protocol's class and when is it enough to just require it...

onetom09:07:25

i can't navigate from a method implementation (eg create-checkout-session!) within the reify to its declaration in the protocol definition though. is that just a missing feature or a newly broken one?

cfleming19:07:46

The Invalid state of lookup error actually has Emmet after Cursive in the stacktrace - that extension point delegates from one to the other, which messes up the plugin identification on errors.

cfleming20:07:16

> i can’t navigate from a method implementation (eg create-checkout-session!) within the reify to its declaration in the protocol definition though. .. is that just a missing feature or a newly broken one? That’s missing, I’m planning to add that soon.

👍 2