vishnevskiy / ElixirSublime

Elixir plugin for SublimeText 3 providing code completion and linting.
MIT License
364 stars 25 forks source link

How to fix use error #34

Open sger opened 7 years ago

sger commented 7 years ago

Hello,

Any idea how to fix this

Error: module MyApp.Web is not loaded and could not be found

also the instructions here https://github.com/vishnevskiy/ElixirSublime/issues/5 not working

thanks

lATAl commented 7 years ago

Same.

lilactown commented 7 years ago

I'm still seeing this issue.

Ultimately defeats the purpose of the plugin if I can't trust linting errors as someone new to the language. :(

auxbuss commented 7 years ago

The package downloaded by Package Control in Sublime is out of date. Most issues go away if you overwrite the installed version of this file: https://github.com/vishnevskiy/ElixirSublime/blob/master/elixir_sublime.py

Note that this script only looks through _build/dev/, so modules defined in, say, test/support/ will be reported as not load/found.

I hacked that last with the following:

def find_ebin_folders(mix_project):
    paths = []
    if mix_project is not None:
        lib_path = os.path.join(mix_project, '_build/dev/lib')
        for lib in os.listdir(lib_path):
            paths.append(os.path.join(lib_path, lib, 'ebin'))
        lib_path = os.path.join(mix_project, '_build/test/lib')
        for lib in os.listdir(lib_path):
            paths.append(os.path.join(lib_path, lib, 'ebin'))
    return paths
coffee-cup commented 7 years ago

Thank you @auxbuss! Your fix worked for me 😄 . A lot of frustration and googling on this.

NoxHarmonium commented 6 years ago

Another way to get the latest version is to:

  1. Open the command palette, select "Package Control: Remove Package" and then select "ElixirSublime".
  2. Open the command palette, select "Package Control: Add Repository" and enter this repo ("https://github.com/vishnevskiy/ElixirSublime.git")
  3. Open the command palette, select "Package Control: Install Package" and then select "ElixirSublime".
  4. Restart Sublime.

Then you should be tracking the git repo rather than the official package repo.