core.typed

Light Table Plugin

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Should be similar to the vim and emacs plugins.

Should type check the current namespace with this code and match up the line/col/source positions in the actual Light Table window, and display the type error message above/below it (whatever is more common in LT).

Also "check-form" should be a command, that type checks the current form with clojure.core.typed/check-form-info.

2 refactorings should be included:

ann-form - wrap current form in an clojure.core.typed/ann-form (which could be qualified by an alias) and leave the cursor on the second argument. If it's possible to add a default to the second argument, it should be `Any`.

eg. my-form
-> (t/ann-form my-form |Any)
; where | is the current cursor

ann-var - bring out the var on the current cursor into an `ann` into the top-level form above the current form.

  • if the var is from another namespace than the current, it should be fully qualified and prefixed with ^:no-check
    eg. n/another-var => (t/ann ^:no-check long-another-ns/another-var Any)
  • otherwise the second argument to `ann` should be unqualified

eg. my-var
-> (t/ann my-var |Any)

Activity

Ambrose Bonnaire-Sergeant made changes -
Field Original Value New Value
Description Should be similar to the [vim|https://github.com/typedclojure/vim-typedclojure] and [emacs|https://github.com/typedclojure/typed-clojure-mode] plugins.

Should type check the current namespace with [this code|https://github.com/typedclojure/vim-typedclojure/blob/master/plugin/typedclojure.vim#L53] and match up the line/col/source positions in the actual Light Table window, and display the type error message above/below it (whatever is more common in LT).

Also "check-form" should be a command, that type checks the current form with clojure.core.typed/check-form-info.

2 refactorings should be included:

ann-form - wrap current form in an clojure.core.typed/ann-form (which could be qualified by an alias) and leave the cursor on the second argument. If it's possible to add a default to the second argument, it should be `Any`.

eg. my-form
 -> (t/ann-form my-form |Any)
; where | is the current cursor

ann-var - bring out the var on the current cursor into an `ann` into the top-level form *above* the current form.
  - if the var is from another namespace than the current, it should be fully qualified and prefixed with ^:no-check
    eg. n/another-var => (t/ann ^:no-check long-another-ns/another-var Any)
  - otherwise the second argument to `ann` should be unqualified

eg. my-var
  -> (t/ann my-var |Any)
Hide
Marco Munizaga added a comment -

I'll tackle this problem this week

Show
Marco Munizaga added a comment - I'll tackle this problem this week
Ambrose Bonnaire-Sergeant made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Ambrose Bonnaire-Sergeant made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: