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

Cursive throws an exception when entering {:12345 :abc} #1010

Closed
danielcompton opened this issue Aug 12, 2015 · 2 comments
Closed

Cursive throws an exception when entering {:12345 :abc} #1010

danielcompton opened this issue Aug 12, 2015 · 2 comments
Labels
released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@danielcompton
Copy link
Collaborator

I think this exists in the grey regions of undefined Clojure Reader behaviour.

Typing {:12345 :abc} at the REPL throws this exception in the editor window error box

String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1937)
    at clojure.core$subs.invoke(core.clj:4781)
    at cursive.filters$fold_line_QMARK_.invoke(filters.clj:146)
    at cursive.filters$stacktrace_folder$fn__8366.invoke(filters.clj:156)
    at cursive.repl.StyledOutputBuffer.addFolding(StyledOutputBuffer.java:456)
    at cursive.repl.StyledOutputBuffer.updateFoldings(StyledOutputBuffer.java:388)
    at cursive.repl.StyledOutputBuffer.access$2700(StyledOutputBuffer.java:40)
    at cursive.repl.StyledOutputBuffer$Text.execute(StyledOutputBuffer.java:338)
    at cursive.repl.StyledOutputBuffer$1.run(StyledOutputBuffer.java:92)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:332)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    at java.awt.EventQueue.access$400(EventQueue.java:82)

and the repl returns

=> {:12345 :abc}

I'm not really sure what the right behaviour is here. Clojure explicitly says that keywords (all symbols really) must start with a non numeric character, but it goes right ahead and allows it anyway.

This works fine though:

{:12345-12 :abc}
=> {:12345-12 :abc}
@cursive-ide
Copy link
Owner

Actually, this is a different error due to the regexps used for Cursive's stacktrace folding erroneously matching that line. I'll fix that.

@cursive-ide cursive-ide added this to the 0.1.61 milestone Aug 12, 2015
@cursive-ide cursive-ide reopened this Aug 28, 2015
@cursive-ide
Copy link
Owner

Reopening this since the fix causes IntelliJ to freeze on some REPL output, presumably because of exponential regular expression matching (#1041).

@cursive-ide cursive-ide removed this from the 0.1.61 milestone Aug 28, 2015
@cursive-ide cursive-ide added this to the 1.4.0-eap1 milestone Jul 28, 2016
@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

2 participants