Home Download Buy Blog Forum Support

BuildParts (execute or build part of your code)

BuildParts (execute or build part of your code)

Postby erinata on Wed Apr 11, 2012 11:31 pm

A new package which allow you to execute or build part of your code.

https://github.com/erinata/BuildParts

This package has only one command "BuildParts: Build(or execute) the selected code"

When you run this command, it will build the code that you have selected using the build system selected by Sublime Text. If you have selected nothing, it will build the whole file.

BuildParts default keybindings are "ctrl+b" (for Windows and Linux) and "super+b" (for Mac). It's the same as the default keybinding for building your code. If you want to invoke the build system for the whole file. Just select nothing and press "ctrl+b".

Example:

Suppose you have a document named "testing.rb"

Code: Select all
Puts("Hello")
Puts("World")
Puts("Everyone")


If you select nothing and press "ctrl+b", Sublime Text will build the whole file and the build output console will show:

Code: Select all
Hello
World
Everyone


Suppose you select the first 2 lines, and press "ctrl+b", Sublime Text will only build the current selected parts and the build output console will show:

Code: Select all
Hello
World


As BuildPart utilizes the build system in Sublime Text, it supports any language the Sublime Text can build. It also work with custom build systems that are install via packages.
Last edited by erinata on Wed Apr 11, 2012 11:57 pm, edited 1 time in total.
erinata
 
Posts: 29
Joined: Wed Jan 25, 2012 12:19 pm

Re: BuildParts

Postby erinata on Wed Apr 11, 2012 11:55 pm

Now BuildParts is limited to using the build system chosen by Sublime text automatically.

It would be super helpful if someone can tell me

1. how to get the "currently chosen build system" via API , and also
2. how to specify a build system when using run_command("build")

so that I can allow the user to choose whatever build systems to build the code.
erinata
 
Posts: 29
Joined: Wed Jan 25, 2012 12:19 pm

Re: BuildParts (execute or build part of your code)

Postby knitatoms on Sat Jun 02, 2012 8:50 am

Thanks for making this package - just what I was looking for!

Unfortunately it crashes Sublime for me. I'm running Linux (Kubuntu 12.04) with the latest stable Sublime Text 2. I'm not sure what useful debug output there might be.

Behaviour to reproduce is: Create a Ruby file with .rb extension. Select some text and press Ctrl+b - Sublime instantly crashes and either freezes or closes down completely.
knitatoms
 
Posts: 22
Joined: Sat Feb 06, 2010 9:01 am


Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests