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

Code reformat with Parinfer breaks code: def with metadata #2044

Closed
luontola opened this issue Sep 7, 2018 · 4 comments
Closed

Code reformat with Parinfer breaks code: def with metadata #2044

luontola opened this issue Sep 7, 2018 · 4 comments
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@luontola
Copy link

luontola commented Sep 7, 2018

The following code breaks when the code is reformatted when Parinfer is enabled.

Before:

(def ^:dynamic
  *foo*)

After:

(def ^:dynamic)
*foo*

Cursive version: 1.8.0-eap6-2018.2

@luontola
Copy link
Author

luontola commented Apr 4, 2019

Same with these:

(def ^:private 
  foo "bar")

becomes

(def ^:private)
foo "bar"

and

(defn ^:whatever 
  foo []
  "bar")

becomes

(defn ^:whatever)
foo []
  "bar"

Cursive version: v1.8.1-2019.1

@luontola
Copy link
Author

This is most problematic when the metadata is long enough that the variable name needs to be wrapped to the next line:

(def ^{:private true
       :doc "Lorem ipsum dolor sit amet, consectetur adipiscing elit.
             Ut non diam vel erat dapibus facilisis vel vitae nunc.
             Curabitur at fermentum lorem. Cras et bibendum ante."}
  some-long-and-descriptive-variable-name "stuff")

becomes

(def ^{:private true
       :doc "Lorem ipsum dolor sit amet, consectetur adipiscing elit.
             Ut non diam vel erat dapibus facilisis vel vitae nunc.
             Curabitur at fermentum lorem. Cras et bibendum ante."})
some-long-and-descriptive-variable-name "stuff"

@cursive-ide
Copy link
Owner

Hmm, that is definitely problematic. I'll fix this for the next build.

@cursive-ide cursive-ide added this to the 1.8.2 milestone Apr 11, 2019
@cursive-ide
Copy link
Owner

Actually, this is exactly the same as #796. I'll fix against that ticket.

@cursive-ide cursive-ide modified the milestones: 1.8.2, 1.8.2-eap1 Apr 25, 2019
@cursive-ide cursive-ide added the bug Marks issues describing bugs label Sep 22, 2020
@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
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

2 participants