Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 15, 2018. It is now read-only.
This repository was archived by the owner on Jan 15, 2018. It is now read-only.

Easy to create a file which cannot be built, hard to delete #12

@alexbbrown

Description

@alexbbrown

Flush with the knowledge that Clojure symbols can have '-' in them, I find myself creating file like this:

test-svg.clj

or worse

test-svg

However, Clojure's build system expects that a namespace such as:

(ns test-svg)

Will be built as test_svg.class

I suggest the following:

  1. The new filename should be taken to be the classpath class element, and the actual filename be calculated from that.

Create:
/myproj/src/views/test-svg.clj
Actually creates:
/myproj/src/views/test_svg.clj

  1. The (ns ) declaration be automatically placed at the start of the file. It's boilerplate that I don't really need to type.

Injects:
(ns myproj.src.views.test-svg)

  1. Some support of rename is added for idiots like me (so I don't have to drop to bash and then reload, losing catnip context)

Such as

3.1) Clicking on the filename in the top left corner switches to edit mode, can change filename. Auto update ns?

3.2) If a ns-declaration conflicts with the filename, the filename be changed.

For example, if I already created my file as above, and now I find I'm happy with my scribbling, I can type:

(ns myproj.src.views.test-svg)^H^H^H^H^H^H^H^H^Hsvg-view)
^S
Renames the file and builds the new class.

I know it's sugar, but I keep creating duff files. :-) Perhaps I should be the change I want to see.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions