codex
codex copied to clipboard
Support tag generation for stack scripts
Stack can be used as a script interpreter. We can specify packages being used by a script. For example:
#!/usr/bin/env stack
{- stack runghc
--package getopt-generics
--package path
--package path-io
-}
It will be nice is codex can support tag generation for the scripts as well by using the packages specified in the stack interpreter comment. It will make writing and navigating scripts a better experience. We will be able to navigate to any library functions being used in the script.
The parser for this comment line can be found here: https://github.com/commercialhaskell/stack/blob/master/src/Data/Attoparsec/Interpreter.hs
Instead of codex parsing it though, maybe stack can provide a command to parse and print the command line or packages being used when it executes the script.