Home Download Buy Blog Forum Support

Build System based on Language

Build System based on Language

Postby Phrogz on Fri Mar 19, 2010 8:58 pm

Is there a way to associate a build system with a language? I save a file with a .rb extension and Sublime knows to use the Ruby syntax: yay! But then I press F7 and it's trying to use a Makefile on it: bummer. Is there a way to automatically have the build system picked based on the language of the current file? If not, I humbly submit this as a feature request.
Posts: 18
Joined: Tue Mar 02, 2010 4:21 pm

Re: Build System based on Language

Postby tgkeul on Mon Mar 22, 2010 9:11 pm

I have a not too simple workaround using the keymap and options for a file type, in my case PLSQL.

In my PLSQL package directory the Default.sublime-keymap contains this
Code: Select all
  <binding key="f7" command="compilePackage">
    <context name="option" value="useCompilePackage"/>

"compilePackage" is a plugin which lets me select a database before compiling.
Using the context allows to restrict the key binding to this file type. It is necessary as ST loads all keymaps found in alphabetical order- and the last is the winner. In my case
  • Packages\Default/Default.sublime-keymap
  • Packages\HTML/Default.sublime-keymap
  • Packages\StickySearch/Default.sublime-keymap
  • Packages\User/Default.sublime-keymap
  • Packages\XML/Default.sublime-keymap
  • Packages\aaaloadfirstextensions/Default.sublime-keymap
  • Packages\ctags/Default.sublime-keymap
  • Packages\plSQL/Default.sublime-keymap
  • Packages\quickhg/Default.sublime-keymap

For this reason only in my PLSQL.sublime-options the above mentioned option ist set true.
Code: Select all
# sql*plus support
useCompilePackage true

Maybe someone can simplify this?
Posts: 144
Joined: Tue Dec 02, 2008 9:35 pm

Re: Build System based on Language

Postby EJ12N on Tue Mar 23, 2010 3:10 pm

Not possible right now but I want that too, define build files in file types options... +1 :)

For now is only possible to define it per project...

project.buildFile Packages/C++/Make.sublime-build
Posts: 281
Joined: Tue Apr 21, 2009 5:23 pm

Re: Build System based on Language

Postby FalconNL on Wed Jun 09, 2010 8:30 am

Add me to the list of people who would like this. I don't even think it's necessary to make an option for it, just default to the .sublime-build file in the same folder as the .tmLanguage file being used. That should handle 99% of all cases.
Posts: 65
Joined: Thu May 29, 2008 8:17 pm

Re: Build System based on Language

Postby willi297 on Wed Jun 16, 2010 2:22 pm

I agree this feature would be VERY helpful. Most of my projects have Ruby, C, Perl and even Python. I don't see how adding this ability would get in the way. It would be nice to extend the build specification so that it can specify builders for specific extensions, since various builders may be available for a given file extension.
Greg Williams
Atomic Embedded, USA
Posts: 121
Joined: Wed Nov 18, 2009 8:29 pm
Location: Grand Rapids, MI, USA

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 6 guests