cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Cursive does not understand dot (.) and double-dot (..) forms

Open favila opened this issue 10 years ago • 6 comments

Cursive does not understand how to resolve symbols inside dot (. o method arg) and double-dot (.. o (method arg) (method arg)) special-forms. Contrived example:

 ; "put" is not highlighted as a method
 ; and is marked as an unresolved symbol
(. (HashMap.) put "key" "value")

; "put" will be marked as unresolved symbol
(.. (HashMap.) (put "key" "value")

; But this is ok:
(.put (HashMap.) "key" "value")

; So is this:
(-> (HashMap.) (.put "key" "value")

favila avatar Mar 21 '14 15:03 favila

Right - this is a little unfortunate. This relies on knowing the types of variables, which is not done yet but should be soon. Your third and fourth forms are marked as resolved but it's still pretty primitive - they just resolve to any method called put in any imported class.

cursive-ide avatar Mar 21 '14 20:03 cursive-ide

+1 This applies to all macros, not just . and ..

pkozikow avatar Aug 07 '14 22:08 pkozikow

Even though Cursive now understands the types of the variables (I think?) .. forms are still not resolved properly AFAICT.

danielcompton avatar May 23 '16 09:05 danielcompton

Hello! I've started using Cursive more of late and this one thing that I keep on running into.

sattvik avatar Nov 20 '18 17:11 sattvik

.. still gives errors:

image

imrekoszo avatar Mar 07 '22 11:03 imrekoszo

+1

This occurs even when type hints seem to give all necessary type info.

See my question in StackOverflow

JoshuaFox avatar Jun 15 '22 17:06 JoshuaFox