Closed TatriX closed 3 years ago
Yes, it would probably be possible, at least for completion + auto-import of symbols in third-party libraries. company-mode
, which we use for completion, supports a post-completion
command, which we could use to auto-insert an import.
However, our candidates right now come from elm-oracle
(which only supports symbols found in third-party packages, not the current project's source code), and we explicitly limit the completion candidates to symbols imported by the current file. To get a list of absolutely all symbols in all the third-party libraries listed as dependencies in the current project one can run elm-oracle elm-package.json ""
. We'd need to change our completion caching strategy in order to cache completions project-wide rather than per-buffer.
Overall this is a bit of work, and I'm unlikely to tackle it myself, but happy to help provide direction if someone else wants to dig in.
purescript-mode
doesn't have it, it's psc-ide-emacs. All the logic resides inside the PureScript compilers IDE server though, so there's not a lot of inspiration to draw from the Elisp, unless you get one of those servers yourself^^
I think this is something that would now get supported via LSP if it happens at all.
Is it possible to achieve something like this?
I know that purescript-mode has this feature. Probably it may be used as a source of inspiration.