cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Add `"declaration"` scope type

Open wenkokke opened this issue 1 year ago • 2 comments

Add a scope type for top-level declarations, e.g., functions, classes, types, interfaces, etc.

wenkokke avatar Jan 22 '24 19:01 wenkokke

Here's all the top-level declarations for Haskell, together with the scope types that (might) fit them:

  • adt declaration ("type")
  • class declaration ("class")
  • data family declaration ("type"? "funk"?)
  • data instance declaration ("type"? "funk"?)
  • default declaration (-)
  • deriving declaration (-)
  • fixity declaration (-)
  • foreign export declaration ("funk"?)
  • foreign import declaration ("funk"?)
  • function declaration ("funk")
  • import declaration (-)
  • instance declaration ("class"?)
  • newtype declaration ("type")
  • pattern synonym declaration (-)
  • role annotation declaration (-)
  • type alias declaration ("type")
  • type family declaration ("type"? "funk"?)
  • type instance declaration ("type"? "funk"?)

It'd be great to capture all these as "declaration" rather than not targeting them or adding separate scope types for each.

wenkokke avatar Jan 22 '24 20:01 wenkokke

I'm guessing this is a swear word in the Haskell world, but we would call those "state" in other languages. Considering talon commands and scm patterns are also called "state", I don't think this is more of an abuse than those

pokey avatar Jan 22 '24 21:01 pokey