Project dir #12

Closed
tdx opened this Issue Apr 25, 2012 · 21 comments

Projects

None yet

2 participants

@tdx

How about support for more complicated project dir structure?
Something like in riak project.

proj 
  |- apps
    |- app1
      |- ebin
    |- app2
      |- ebin
  |- deps
    |- app1
      |- ebin
    |- app2
      |- ebin
.... 
@tdx

For such projects rebar.config in root dir contains:

...
{sub_dirs, [
            "apps/app1",
            "apps/app2
           ]}.
...
@tdx

And for deps:

{deps_dir, ["deps"]}.
@ostinelli
Owner

hello @tdx, support for this is planned.

thank you,

r.

@ostinelli
Owner

@tdx can you please point me to a github project structure like the one you are describing or that you'd like to be supported?

r.

@tdx

https://github.com/basho/riak

This project has deps, but no apps subdir.

@ostinelli
Owner

Hi @tdx, can you please see if latest 64a78a9 implements this as you would expect?

thank you,

r.

@tdx

Hi @ostinelli,
Unfortunately check of existence of rebar.config in the current directory is insufficient. Because each app in apps and in deps can have own rebar.config

@ostinelli
Owner

any suggestions?

@tdx

I think we need to get list of Sublim Folders (which we added from Project - Add Folder To Project) and go down into project subdirs.
1. For each Folder add completion from ebin dir.
2. If rebar.config exist -> parse and lookup directories from lib_dirs, sub_dirs and may be other.
3. Enter into subdir -> go to 1.

@ostinelli
Owner

SublimErl just parses all subdirs of what it believes its the root of the project, except the .eunit and test directories, thus there's no need to identify which are the specific directories defined within rebar.

that said, your method implies that you have to have all folders open before this can work, i believe this not to be particularly useful.

i have considered asking for a specific sublimerl file to be inserted in the root of a directory, and look for that one as a reference point. if not found, then do the detection as is right now.

what would you think of this approach?

@tdx

What will this file contain?
As for me this file already exists. This is rebar.config.

The current problem for me in that when I opening file from other app subdir SumlibErl updates contents of Current-Project* files.
So may be simple to structure contents of completion subdir accoording to project structure?
For example (for project in 1 comment):

completion/
    Proj/
       app1/
         app.disasm
         app.sublime-completions
       app2/
         app.disasm
         app.sublime-completions
    NextProj/
       ...
@ostinelli
Owner

that could be an interesting approach, but when would you delete these files? and why should you have autocompletion of projects that are not related?

@tdx

https://github.com/tdx/se_demo

See this demo project.

@ostinelli
Owner

thank you for this input. as said though, i don't think i want to force developers to open folders. plus, Current* files are to be considered temporary cache.

this issue is very specific:

  1. you need to have an /app structure
  2. every app under /apps has its own rebar.config file
  3. when you open a file in app1, you want autocomplete info from app2.

i am thinking to refactor the finding of project root anyway, and will try to find a way to cover this case too.

thank you,

r.

@ostinelli
Owner

working on it, should probably have a solution within days.

@tdx

may be store Current-Project files in project root not in plugin dir ?

@ostinelli
Owner

Hi @tdx, can you check if latest push fixes it?

thanks,

r.

@ostinelli
Owner

it'd be nice if you could also check #15 since these are related, and give me feedback there if you feel so.

thank you,

r.

@tdx

HI @ostinelli, its work for me on se_demo. Great. Thanks!

I will check on my big projects.

@ostinelli
Owner

Great. Thank you,

r.

@ostinelli ostinelli closed this Apr 30, 2012
@ostinelli ostinelli added a commit that referenced this issue May 10, 2012
@ostinelli Fixes issue #12 abab98a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment