Code Monkey home page Code Monkey logo

Comments (11)

hiphoox avatar hiphoox commented on May 29, 2024 1

yeah, I have the same problem with all my use statements.

Example: use Ecto.Repo, adapter: Ecto.Adapters.Postgres

I'm using Yosemite and I opened sublime in the project directory
repo_ex_ peopleware_and_cannot_find_phoenix_router__others_in_new_phoenix_project_ issue__5 _vishnevskiy_elixirsublime

from elixirsublime.

andref avatar andref commented on May 29, 2024 1

I had the same issue and discovered that the linter plugin cannot find the mix project. When elixirc runs, it doesn’t have a proper path where to find the modules.

That happens because find_mix_project uses os.getcwd if no argument is given as a starting point. However, there’s no guarantee that the current directory will be the phoenix project (in my case, it was the Sublime Text package folder or some such). I fixed it by changing elixir_sublime.py and feeding find_mix_project the file the linter is currently handling, self.filename:

  class ElixirLinter(Linter):
      ...
      def cmd(self):
          ...
          for path in find_ebin_folders(find_mix_project(self.filename)):
              command.extend(['-pa', path])

I’m not sure if this will break other stuff since I never wrote a sublime linter plugin (and that’s why I’m not making a PR), but it works for me.

from elixirsublime.

vishnevskiy avatar vishnevskiy commented on May 29, 2024

I will look into but can you attempt instead.

  1. cd /path/to/test
  2. subl .

Then edit the file while the whole tree is open. It worked that way for me.

from elixirsublime.

Havvy avatar Havvy commented on May 29, 2024

Same result.

from elixirsublime.

vishnevskiy avatar vishnevskiy commented on May 29, 2024

What OS are you on? I am able to use this on both my OSX machine and an Ubuntu VM.

from elixirsublime.

Havvy avatar Havvy commented on May 29, 2024

NixOS where both Elixir and SublimeText are installed via nix-env.

Edit: Note that outside of use statements, I do get autocompletion. I can autocomplete Phoenix.R[outer] for instance.

from elixirsublime.

rjsamson avatar rjsamson commented on May 29, 2024

I'm getting this same issue on OSX Yosemite

from elixirsublime.

andreionut avatar andreionut commented on May 29, 2024

That fixed it for me @andref
I think you should put a PR

from elixirsublime.

Havvy avatar Havvy commented on May 29, 2024

Fixed by PR #13

from elixirsublime.

vladra avatar vladra commented on May 29, 2024

I have same problem despite of this PR. With use Something.Web, :router and all other uses of use. Any tips how to solve this?

from elixirsublime.

aawilson avatar aawilson commented on May 29, 2024

To @vladra and others: When I ran into this same issue, it wasn't due to ElixirSublime, but instead from the SublimeLinter elixirc plugin in a Mix context. The appropriate config for a Mix project for that plugin is specified here: https://github.com/smanolloff/SublimeLinter-contrib-elixirc#example

from elixirsublime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.