Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Support namespace-qualified forms for smart indent#19

Merged
ibdknox merged 1 commit intoLightTable:masterfrom
glenjamin:namespace-indent
Apr 28, 2014
Merged

Support namespace-qualified forms for smart indent#19
ibdknox merged 1 commit intoLightTable:masterfrom
glenjamin:namespace-indent

Conversation

@glenjamin
Copy link
Copy Markdown

The current smart indent behaviour for def and with style forms does not handle namespaces correctly.

Before:

(with-open [a b]
  (dothing a))

(with-namespace/open [a b]
  (dothing a))

(namespace/with-open [a b]
                     (dothing a))

After:

(with-open [a b]
  (dothing a))

(with-namespace/open [a b]
                     (dothing a))

(namespace/with-open [a b]
  (dothing a))

@ibdknox
Copy link
Copy Markdown
Member

ibdknox commented Apr 28, 2014

looks good, thanks.

ibdknox added a commit that referenced this pull request Apr 28, 2014
Support namespace-qualified forms for smart indent
@ibdknox ibdknox merged commit a6ecc7b into LightTable:master Apr 28, 2014
@cldwalker
Copy link
Copy Markdown
Member

@glenjamin Are the above examples supposed to be function invocations? If so, could you explain why we want with-namespace/open indented but not the others? Without understanding this fix I won't be able to send it upstream once #26 lands

@glenjamin
Copy link
Copy Markdown
Author

The idea is to identify any form which accepts additional forms to execute.

These are usually macros in practice, but the main defining feature is that they either begin with def or with-.

The namespace portion of the var name should be ignored, and only the name itself considered - this is why with-namespace/open should be left alone.

@glenjamin glenjamin deleted the namespace-indent branch January 17, 2016 16:10
@cldwalker
Copy link
Copy Markdown
Member

Gotcha. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants