Home Download Buy Blog Forum Support

Completions by Directory

Completions by Directory

Postby ravenlife on Fri Jan 13, 2012 1:12 pm

HI All,

Pretty sure this isnt possible, but is there a way to have completions only work if the file is under a specific directory?

The reason I ask is that some of my completions are only specific to certain files (Model, View, Controller ect) which are always in the same place, models/ views/ controllers/

would be a good addition if possible

Cheers

Rl
ravenlife
 
Posts: 1
Joined: Fri Sep 02, 2011 10:52 am

Re: Completions by Directory

Postby C0D312 on Fri Jan 13, 2012 5:56 pm

When you say completions, do you mean SOME_FILE.sublime-completions? Or are you making a plugin that uses autocomplete? If you make a plugin for your completions, checking the directory is fairly simple.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Completions by Directory

Postby tanc on Fri Feb 17, 2012 11:41 pm

hi COD312, are you able to start me off on making a plugin to reference a sublime-completions file stored alongside a sublime project file? My situation is similar in that I'm able to auto generate a nice big sublime-completions file from a project (Drupal PHP project) but the only way I can get it to work is by putting it under Packages/User/ which makes it universal to all projects. What I'm after is a way of injecting a custom sublime-completions file on a per project basis and my understanding is the only way to do this currently is to use a plugin to push to EventListener. My concern is the lag in loading an external file each time (~3MB), it would be good if this could be held in memory. Any ideas or pointers greatly appreciated!
tanc
 
Posts: 5
Joined: Tue Apr 19, 2011 8:11 am

Re: Completions by Directory

Postby sublimator on Sat Feb 18, 2012 6:03 am

There are on_project_(unload|load) callbacks. You could use them to do symbolic (un)?linking?
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 648
Joined: Thu Mar 20, 2008 5:41 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 2 guests