hylang / hy-mode

Hy mode for Emacs
GNU General Public License v3.0
189 stars 48 forks source link

auto-completion does not seem to work #70

Closed NOBLES5E closed 6 years ago

NOBLES5E commented 6 years ago

Only sys.<tab> works (even without (import sys) in the script). Any other packages I imported does not show any completion.

I clone the repo and use

(require 'hy-mode)
(require 'spacemacs-hy)

to enable hy-mode.

ekaschalk commented 6 years ago

By default imports are not collected and execute automatically (yet).

However, you can send the imports/requires in the current file via hy--shell-update-imports

It isn't bound by default, I personally have:

(spacemacs/set-leader-keys-for-major-mode 'hy-mode "ei" 'hy--shell-update-imports)

The reason it's not done by default is I'm not sure good practice around how to do it yet. See if that helps, it also catches forms with sys.path.extend for path extensions.

NOBLES5E commented 6 years ago

Thanks! It works now :)