Sublime Forum

Completions by Directory

#1

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

0 Likes

#2

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.

0 Likes

#3

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!

0 Likes

#4

There are on_project_(unload|load) callbacks. You could use them to do symbolic (un)?linking?

0 Likes