This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
GravityScore's profile picture

CC Syntax Highlighting/Code Completions v1.2 - Sublime Text 2

Started by GravityScore, 20 February 2013 - 12:59 AM
GravityScore #1
Posted 20 February 2013 - 01:59 AM
Hey all,

I wrote a new ComputerCraft package for the text editor Sublime Text 2, which builds upon the current Lua one and includes colouring and code completions for all of the CC APIs. It also fixes the issue where the re-indent feature wouldn't work (it wouldn't code-fold at elseifs, or at functions defined in the way shown below), so you are able to use re-indent on screwed up code! :D/> It also adds support for declaring functions like this:

func = function(arg1, arg2, ...)
  print(tostring(arg1) .. "  " .. tostring(arg2) .. " " .. table.concat({...}, " "))
end

These functions will now be syntax-highlighted properly, and appear in the functions list when Go To Symbol (command/control+R) is selected :D/>

Features
- Syntax highlighting for every CC API function
- Syntax highlighting for every CC constant (keys.* and colours.*)
- Code completion for all main CC functions
- New default snippets relating to CC (clear screen, center print, BSoD template, proper checking if the computer is an advanced computer)
- Support for declaring functions 2 different ways (described above)
- Fixed the re-indent feature (Edit -> Line -> Reindent)
- Opening .lua files defaults to this syntax
- Multiline commenting using block comments (–[[ and ]]–)
- Fixed functions declared in the way shown above not re-indenting

Download
GitHub Repository: https://github.com/G...erCraft-Package

Installation
1. Download and install Sublime Text 2's Package Control Plugin
2. Open the command palette (Tools -> Command Palette, or Control+Shift+P / Command+Shift+P)
3. Search for Package Control: Install Packages
4. Search for ComputerCraft Package in the listings
5. Hit enter
6. Restart Sublime Text!

Installation for Linux in Sublime Text 3
  1. Open Sublime
  2. Click Preferences > Browse packages
  3. Copy path to this dir
  4. Open Terminal
  5. CD into that dir
  6. run git clone https://github.com/w...age_control.git "Package Control"
  7. CD into Package\ Control
  8. run git checkout python3
  9. Restart ST3
  10. Click Preferences > Package Control > Package Control: Install Package
  11. Choose ComputerCraft Package
  12. Wait fot it to download and install
  13. Done!

Credits
- NeverCast for the idea in his Sublime 2 Plugin for Auto-Lua Syntax (another very useful ST2 plugin)
- ChrisJay for the list of all CC functions used in the code completion :D/>
- TheOriginalBIT for tonnes of suggestions

Usage
To use it after you've installed it, just set the syntax to ComputerCraft (it should appear as an option once you've installed it). You can access the set syntax feature from the command palette (Tools -> Command Palette, or Shift+Control+P), and just look for Set Syntax: ComputerCraft. The syntax is also set as the default syntax for opening Lua files (.lua) when you install it.
Kingdaro #2
Posted 20 February 2013 - 02:24 AM
This is awesome, thanks!

Also, path for windows is %APPDATA%/Sublime Text 2/Packages, and for linux, it's ~/.config/sublime-text-2/Packages.
theoriginalbit #3
Posted 20 February 2013 - 02:27 AM
You broke auto commenting.
GravityScore #4
Posted 20 February 2013 - 02:35 AM
You broke auto commenting.

I'm no where near familiar with all of Sublime Text's features. Auto commenting? :P/>

I think I may know how to fix it. Plus, completions for all of the functions coming soon, as soon as I can work out how :P/>
theoriginalbit #5
Posted 20 February 2013 - 02:37 AM
I'm no where near familiar with all of Sublime Text's features. Auto commenting? :P/>
I think I may know how to fix it. Plus, completions for all of the functions coming soon, as soon as I can work out how :P/>
Yeh, press ⌘ + / and it turns all the selected lines into comments
theoriginalbit #6
Posted 20 February 2013 - 02:51 AM
Second Report. I iterated through _G printing out all the functions and variables. There are a few you missed, take a look at the output in Sublime too see what. :)/>

EDIT: Oh there is a bug in the iteration, the native. functions are obviously term.native … but I assume you would know that :)/>

I also suggest that variables and functions should also highlight when _G. is at the front though, its still a valid function call/variable

The Output
Spoilerhttp://pastebin.com/XLpmeYmR


The Code I Used To Do This (In case you're interested)
Spoiler


local h = fs.open(".dump", "w")
local function iterateTable(t, id)
  print("Iterating table "..tostring(t))
  for k,v in pairs(t) do
	if type(v) == "table" and tostring(k) ~= "_G" then -- this stopped some nasty recursion, why they store _G as a variable in _G gets me!
	  sleep(0)
	  iterateTable(v, k)
	elseif type(v) == "function" then
	  local value = "function: value: "..(id ~= "_G" and id.."." or "")..tostring(k).."()\n"
	  write(value)
	  h.write(value)
	  sleep(0)
	elseif tostring(k) ~= "_G" then -- Stops _G from printing in front, and stops some duplicates, I suggest that variables and functions should also highlight when _G. is at the front though, its still a valid function call
	  local value = "variable: value: "..(id ~= "_G" and id.."." or "")..tostring(k).."\n"
	  write(value)
	  h.write(value)
	  sleep(0)
	end
  end
  return
end
iterateTable(_G, "_G")
h.close()
Edited on 20 February 2013 - 01:54 AM
GravityScore #7
Posted 20 February 2013 - 02:55 AM
Fixed it (the commenting)! Easy fix, just new installation method needed. I also re-added everything from the Lua code completions (for loops, functions, and a new clear terminal one). I'll release it in a sec, just finishing up something else.

EDIT: fixed the ones I missed.
GravityScore #8
Posted 20 February 2013 - 03:26 AM
Updated OP with changes.

- Fixed all the Lua code snippets, and added a few more (clear screen and is advanced computer).
- Added in code completion for the more commonly typed CC API functions (term commands, io, fs, and a few os).
- Fixed auto commenting.
- Added in the colouring for the functions I missed
theoriginalbit #9
Posted 20 February 2013 - 03:35 AM
and added a few more (clear screen and is advanced computer).

- Added in the colouring for the functions I missed (they must not be on the wiki :P/>).
I can tell you that "redstone.getInput()" is :P/> so is "fs.getFreeSpace()" and "read()" is really common…………. but I'll stop there ;)/> :P/>

Still missed term.native too ;)/>
GravityScore #10
Posted 20 February 2013 - 03:42 AM
and added a few more (clear screen and is advanced computer).

- Added in the colouring for the functions I missed (they must not be on the wiki :P/>).
I can tell you that "redstone.getInput()" is :P/> so is "fs.getFreeSpace()" and "read()" is really common…………. but I'll stop there ;)/> :P/>

Still missed term.native too ;)/>

Arggggshsspppspweofijwoeifj034g9w8hgojiwoifjiodklscm…
I missed them then :P/>

- term.native.* is fixed
Sammich Lord #11
Posted 20 February 2013 - 03:43 AM
I am getting a file no found on Jumpshare. Some of Jumpshare's other pages seem to be down as well. I suggest re-uploading to another service such as MEGA or Mediafire.
tesla1889 #12
Posted 20 February 2013 - 03:44 AM
reminds me of something ive been putting off lol

same thing, but for gedit
GravityScore #13
Posted 20 February 2013 - 03:45 AM
I am getting a file no found on Jumpshare. Some of Jumpshare's other pages seem to be down as well. I suggest re-uploading to another service such as MEGA or Mediafire.

Huh. Works for me. I'll re-upload to Mega anyway, I like it more :P/>
theoriginalbit #14
Posted 20 February 2013 - 03:50 AM
Arggggshsspppspweofijwoeifj034g9w8hgojiwoifjiodklscm…
I missed them then :P/>

- term.native.* is fixed
Find keys variables fixed, and a few minor functions you missed. :)/>
http://pastebin.com/YHu5HuYV
Sammich Lord #15
Posted 20 February 2013 - 03:52 AM
I used this for 5 minutes and I love it. I was switching to Sublime for all my website development and I was going to do the same and now since I have the syntax highlighting for CC I can do stuffz 10 times easier. :D/> Thanks Grav.
theoriginalbit #16
Posted 20 February 2013 - 03:53 AM
I used this for 5 minutes and I love it. I was switching to Sublime for all my website development and I was going to do the same and now since I have the syntax highlighting for CC I can do stuffz 10 times easier. :D/> Thanks Grav.
Combine it with this slightly modified and its truly awesome! http://www.computercraft.info/forums2/index.php?/topic/10573-sublime-2-plugin-for-auto-lua-syntax/
Sammich Lord #17
Posted 20 February 2013 - 03:55 AM
I used this for 5 minutes and I love it. I was switching to Sublime for all my website development and I was going to do the same and now since I have the syntax highlighting for CC I can do stuffz 10 times easier. :D/> Thanks Grav.
Combine it with this slightly modified and its truly awesome! http://www.computerc...uto-lua-syntax/
Already downloaded this :P/>
FuuuAInfiniteLoop(F.A.I.L) #18
Posted 20 February 2013 - 03:55 AM
Now make it for notead++
theoriginalbit #19
Posted 20 February 2013 - 03:56 AM
Already downloaded this :P/>
Haha nice ;)/> change it to ComputerCraft instead of Lua then :)/>

Now make it for notead++
Sublime Text 2 is multi-os… so this is the better one to make it for :P/>
Sammich Lord #20
Posted 20 February 2013 - 03:58 AM
Now make it for notead++
IMHO, Sublime Text 2 is far better than Notepad++ for a few reasons.

-Nicer themes(Gotta love the colors) :P/>
-Cross-Platform(Linux, Mac and Windows)
-Auto-Complete(Gotta love it)
-Automatically add functions to auto-complete after defining them
-More languages built in(Shit ton of languages already installed)
-You can use a un-timed trial of it or but the whole thing for $70

I think I made a pretty good case.
theoriginalbit #21
Posted 20 February 2013 - 04:00 AM
-Automatically add functions to auto-complete after defining them
I've been trying to figure that bit out. how the hell do you do it?


EDIT: Oh Grav… can you attempt to figure you the multi line comment. so if you have multiple highlighted it will surround with –[[ ]] instead of putting – at the start of each line.
Edited on 20 February 2013 - 03:01 AM
Sammich Lord #22
Posted 20 February 2013 - 04:01 AM
-Automatically add functions to auto-complete after defining them
I've been trying to figure that bit out. how the hell do you do it?
If I have this code:

function helloWorld()
  print("Hello world")
end
It will automatically add helloWorld as a function. It will also add anything you load. So if I loaded the BIOS.lua and all the lib files I could get auto-complete for all CC files just by loading them. Sublime Text 2 is just awesome.
theoriginalbit #23
Posted 20 February 2013 - 04:03 AM
It will automatically add helloWorld as a function. It will also add anything you load. So if I loaded the BIOS.lua and all the lib files I could get auto-complete for all CC files just by loading them. Sublime Text 2 is just awesome.
Oh i thought you meant if you had like

local function name(param1, param2, param3, ...)
end
then whenever you type name it brought up an auto complete with the parameter names… like eclipse and such… someone told me that it could do it…
Sammich Lord #24
Posted 20 February 2013 - 04:07 AM
It will automatically add helloWorld as a function. It will also add anything you load. So if I loaded the BIOS.lua and all the lib files I could get auto-complete for all CC files just by loading them. Sublime Text 2 is just awesome.
Oh i thought you meant if you had like

local function name(param1, param2, param3, ...)
end
then whenever you type name it brought up an auto complete with the parameter names… like eclipse and such… someone told me that it could do it…
I never got parameters to work with Sublime Text 2. Might be able to make a plugin for it though, not sure though. I really like Visual Studio's way of doing auto-complete. If Sublime Text 2 had the parameters then I would definitely use it for 90% of the coding I do.
theoriginalbit #25
Posted 20 February 2013 - 04:09 AM
I never got parameters to work with Sublime Text 2. Might be able to make a plugin for it though, not sure though. I really like Visual Studio's way of doing auto-complete. If Sublime Text 2 had the parameters then I would definitely use it for 90% of the coding I do.
Indeed that would be nice! :)/>
GravityScore #26
Posted 20 February 2013 - 04:18 AM
EDIT: Oh Grav… can you attempt to figure you the multi line comment. so if you have multiple highlighted it will surround with –[[ ]] instead of putting – at the start of each line.

Easy! Done. I'll upload the updated version now.

EDIT: Uploaded.
theoriginalbit #27
Posted 20 February 2013 - 04:20 AM
Easy! Done. I'll upload the updated version now.
:D/> yay! :D/>
theoriginalbit #28
Posted 20 February 2013 - 04:27 AM
EDIT: Uploaded.
Missing a few keys variables

Spoilervariable: value: keys.numPadSubtract
variable: value: keys.numPadEnter
variable: value: keys.capsLock
variable: value: keys.stop
variable: value: keys.kanji
variable: value: keys.insert
variable: value: keys.numPadAdd
variable: value: keys.scollLock
variable: value: keys.yen
variable: value: keys.ax
variable: value: keys.equals
variable: value: keys.numPadDecimal
variable: value: keys.numLock
variable: value: keys.minus
variable: value: keys.pause
variable: value: keys.numPadComma
variable: value: keys.cimcumflex
variable: value: keys.noconvert
variable: value: keys.grave
variable: value: keys.apostrophe
variable: value: keys.at
variable: value: keys.convert
variable: value: keys.numPadDivide
variable: value: keys.multiply

would be nice to be added to functions list
Spoilerfunction: value: printError()

function: value: emulog.clear()
function: value: emulog.log()
GravityScore #29
Posted 20 February 2013 - 04:44 AM
All of them added. Damn how did I miss them…
theoriginalbit #30
Posted 20 February 2013 - 04:47 AM
All of them added. Damn how did I miss them…
Not sure :P/> Also the multiline comment doesn't seem to work for me.

EDIT: Sorry let me be more clear. Removing multiline comments don't work for me. also about 3 lines of padding are added to top and bottom when multilines are done.
Edited on 20 February 2013 - 03:54 AM
theoriginalbit #31
Posted 20 February 2013 - 05:05 AM
I never got parameters to work with Sublime Text 2. Might be able to make a plugin for it though, not sure though. I really like Visual Studio's way of doing auto-complete. If Sublime Text 2 had the parameters then I would definitely use it for 90% of the coding I do.
I think if the plugin did a search for the functions, and added them into the ComputerCraft/completions.sublime-completions, that might emulate that it does it ;)/>
theoriginalbit #32
Posted 20 February 2013 - 05:27 AM
Grav,

For your consideration:

New Code snippets

Center Write
Spoiler


<snippet>
    <content><![CDATA[local function centerWrite(msg, y, offset)
  local sw,sh = term.getSize()
  term.setCursorPos( sw/2 - #msg/2 + (#msg%2 and 0 or 1), (y or (sh/2)) + (offset or 0))
  write(msg)
end]]></content>
    <tabTrigger>center</tabTrigger>
    <scope>source.computercraft</scope>
    <description>Write text to screen center</description>
</snippet>

Better Clear Screen
Spoiler


<snippet>
    <content><![CDATA[local function clearScreen(backgoundColor, textColor)
  if term.isColor and term.isColor() then
    term.setBackgroundColor(backgoundColor)
    term.setTextColor(textColor)
  end
  term.clear()
  term.setCursorPos(${3:1}, ${4:1})
end]]></content>
    <tabTrigger>term</tabTrigger>
    <scope>source.computercraft</scope>
    <description>Clear the Screen</description>
</snippet>

Just for Fun ;)/> :P/>
Spoiler


<snippet>
    <content><![CDATA[-- program code can go here too, just make sure its called from main

local function main(argc, argv)
  -- argc is runtime argument count
  -- argv is the runtime arguments

  -- main program code here
  -- if you do not want the BSoD to come up, do not forget to use return true

  return true
end

local ok, err = pcall(main, #{...}, {...})

if not ok then
  -- Make a nice BSoD here
  print("Fatal Error:")
  print(err)
end]]></content>
    <tabTrigger>bsod</tabTrigger>
    <scope>source.computercraft</scope>
    <description>Create standard error handling (BSoD)</description>
</snippet>
theoriginalbit #33
Posted 20 February 2013 - 06:27 AM
Finally… if you change the following code in the .tmLanguage

<key>fileTypes</key>
<array>
<string>lua</string>
</array>
to this code


<key>fileTypes</key>
<array>
<string></string>
<string>lua</string>
</array>
it means that .lua files will still be highlighted with the ComputerCraft syntax, but when saving new files it will not add the .lua by default
Sammich Lord #34
Posted 20 February 2013 - 06:32 AM
I can see everybody eventually switching over to Sublime. I set it as my default text editor because I love it so much.
lieudusty #35
Posted 20 February 2013 - 03:59 PM
Nice! I've always been wondering how to add CC syntax to Sublime Text but never tried or found a way.
NeverCast #36
Posted 20 February 2013 - 06:40 PM
This looks awesome Grav.
The filenames annoy me lol, but if that's the only fault I have then it must be great :D/>

Also, .DS_Store and _OSX folders :(/>

I'll reference this plugin from my post, Excellent work.
Also good to see you're using mega.
theoriginalbit #37
Posted 20 February 2013 - 06:44 PM
Also, .DS_Store and _OSX folders :(/>
Not his fault, default OSX you can't see them and don't even know they are there, and when you ⌘+A it selects hidden files too. The only reason I know they are there and try to delete them for you, is because I have hiddens turned on. But its just like Thumbs.db crap from Windows, its so annoying! :P/>
GravityScore #38
Posted 20 February 2013 - 09:01 PM
I added in your scripts BIT (centerPrint, advanced computer support to clear screen, and the BSoD template), but I changed them a bit. So I'll call this 1.1 at the moment. Topic updated!
theoriginalbit #39
Posted 22 February 2013 - 02:17 AM
Credits
- TheOriginalBIT for tonnes of suggestions
Woo :P/>

Just another one. Maybe release the new config to use with NeverCast's Auto Lua Syntax so that ComputerCraft is the default syntax :)/>

How to do it
SpoilerAfter installing and following the instructions on NeverCast's post do the following:

1. Navigate to the 'Default File Type' package in the Sublime Text 2 support folder:
  • Mac: ~/Library/Application Support/Sublime Text 2/Packages/Default File Type/
  • Windows: %APPDATA%\Sublime Text 2\Packages\Default File Type
  • Linux: ~/.config/sublime-text-2/Packages/Default File Type
​2. Open the 'default syntax.sublime-settings' file in Sublime Text 2
3. Replace the line
"defaultsyntax": "Packages/Lua/Lua.tmLanguage"
with
"defaultsyntax": "Packages/ComputerCraft/ComputerCraft.tmLanguage"
4. Save the file
5. Restart Sublime Text 2
6. Done!
Viproz #40
Posted 22 February 2013 - 06:29 AM
Waw i always wanted a real IDE for lua, with that it will be a lot easyer, thanks a lot !
darkroom #41
Posted 22 February 2013 - 11:43 AM
Oh my god…. Gravity I love you more than anyone in the world right now i am making a huge project right now and this is amazing
Jan #42
Posted 05 March 2013 - 04:47 AM
It doesnt work for me, after I installed it, the code snippets were avaible, but not the APIs :(/>
I set the syntax to ComputerCraft
I tried CTRL+space but it didnt want to autocomplete.
my Sublime Text version is 2.0.1
LancerX #43
Posted 05 March 2013 - 05:54 AM
This is really great! I use Sublime for a lot of my projects and love having CC support.

A couple of additional things I do in my workflow: I added a simple build script that copies my source files to a CC computer directory for one button deploy. I also have file based logging/debugging and keep the log open in a Sublime tab (usually it's own window).
MudkipTheEpic #44
Posted 08 March 2013 - 03:07 AM
Bug: Does not re-indent at:


foobar = function()
sjele #45
Posted 08 March 2013 - 03:55 AM
Allways used np++, then said to my selfs when i saw this: Gotta try sub lime text 2 out, loved from the first moment. Thanks :)/>
Tiin57 #46
Posted 08 March 2013 - 06:14 AM
Could you add some mirrors? I can't download from Mega @ school (what a surprise :/)
Jan #47
Posted 08 March 2013 - 07:22 AM
It doesnt work for me, after I installed it, the code snippets were avaible, but not the APIs :(/>
I set the syntax to ComputerCraft
I tried CTRL+space but it didnt want to autocomplete.
my Sublime Text version is 2.0.1
I still havent figured out how to fix code completions, maybe it is because I downloaded version 1.1
Does anyone have a link to the old version?
theoriginalbit #48
Posted 08 March 2013 - 08:11 PM
Got another bug for you grav.

some functions only highlight when a ( is present after the name. this causes problems when doing this


print"Hello World!"
3ydney #49
Posted 09 March 2013 - 01:16 AM
Nice!
ChrisJay #50
Posted 09 March 2013 - 12:29 PM
The file "completions.sublime-completions" is missing a few commas at the end of line 29,31 and 32. Also, the API functions aren't working in autocomplete either. I'm using ST2.0.1 as well.
theoriginalbit #51
Posted 09 March 2013 - 09:22 PM
- TheOriginalBIT for tonnes of suggestions
Here is another….

fix colours.gray … colors.grey …

at the moment
colours.grey and colors.gray will highlight even though they are invalid.
Jan #52
Posted 09 March 2013 - 10:36 PM
The file "completions.sublime-completions" is missing a few commas at the end of line 29,31 and 32. Also, the API functions aren't working in autocomplete either. I'm using ST2.0.1 as well.
Oh ok good to hear I am not the only one having this problem. I'll try to add the missing commas
GravityScore #53
Posted 10 March 2013 - 03:00 AM
Here is another….

fix colours.gray … colors.grey …

at the moment
colours.grey and colors.gray will highlight even though they are invalid.
Fixed

Got another bug for you grav.

some functions only highlight when a ( is present after the name. this causes problems when doing this


print"Hello World!"
Fixed.

Bug: Does not re-indent at:


foobar = function()
Couldn't find out how to fix :/
I'll look deeper into it…

The file "completions.sublime-completions" is missing a few commas at the end of line 29,31 and 32. Also, the API functions aren't working in autocomplete either. I'm using ST2.0.1 as well.
Fixed it! It was due to the missing commas….

Uploading now, with a mirror for you tiin :P/>
ChrisJay #54
Posted 11 March 2013 - 05:34 AM
The file "completions.sublime-completions" is missing a few commas at the end of line 29,31 and 32. Also, the API functions aren't working in autocomplete either. I'm using ST2.0.1 as well.
Fixed it! It was due to the missing commas….

But shouldn't there be a suggestion for, e.g. turtle.dig(), turtle.moveUp(), etc.?

theoriginalbit #55
Posted 11 March 2013 - 11:46 AM
Iirc they weren't in the completions file. Also Sublime Text 2 ISN'T an IDE it's a text editor. If you want all these special features you are going to have to use an IDE, like Eclipse.
ChrisJay #56
Posted 11 March 2013 - 12:00 PM
Iirc they weren't in the completions file. Also Sublime Text 2 ISN'T an IDE it's a text editor. If you want all these special features you are going to have to use an IDE, like Eclipse.

Well, they are present in the language file, and they are beeing highlighted. So I just thought it would make sense to also suggest these function in the autocomplete. ;)/>

Anyway, I created a small list with the CC core functions. It dosn't really support namespaces, but I'm looking into that.

Spoiler
{
    /* This program is free software. It comes without any warranty, to
     * the extent permitted by applicable law. You can redistribute it
     * and/or modify it under the terms of the Do What The Fuck You Want
     * To Public License, Version 2, as published by Sam Hocevar. See
     * http://www.wtfpl.net/ for more details. */

    "scope": "source.computercraft",

    "completions": [
    //The Bit API is for manipulating numbers using bitwise binary operations (2013-03-12)
        "bit.tobits(${0:int n})",
        "bit.blshift(${1:int n}, ${0:bits bits})",
        "bit.brshift(${1:int n}, ${0:bits bits})",
        "bit.bxor(${1:int m}, ${0:int n})",
        "bit.bor(${1:int m}, ${0:int n})",
        "bit.band(${1:int m}, ${0:int n})",
        "bit.bnot(${0:int n})",
        "bot.tonumb(${0:table bit_tbl})",

    //Colors (2013-03-12)
        "colors.combine(${1:color1}, ${2:color2}, ${3:...})",
        "colors.subtract(${1:colors}, ${2:color1}, ${3:color2}, ${4:...})",
        "colors.test(${1:colors}, ${2:color})",

        "colors.white",
        "colors.orange",
        "colors.magenta",
        "colors.lightBlue",
        "colors.yellow",
        "colors.lime",
        "colors.pink",
        "colors.gray",
        "colors.lightGray",
        "colors.cyan",
        "colors.purple",
        "colors.blue",
        "colors.brown",
        "colors.green",
        "colors.red",
        "colors.black",

    //Coroutine (2013-03-12)
        "coroutine.create(${1:function})",
        {"trigger":"coroutine.resume(coroutine, [var1], [var2], ...)" ,"contents":"coroutine.resume(${1:coroutine}, ${2:[var1]}, ${3:[var2]}, ${4:...})"},
        "coroutine.running()",
        "coroutine.status(${1:coroutine})",
        "coroutine.wrap(${1:function})",
        "coroutine.yield(${1:[var1]}, ${2:[var2]}, ${3:...})",

    //Disk (2013-03-12)
        "disk.isPresent(${1:side})",
        "disk.hasData(${1:side})",
        "disk.getMountPath(${1:side})",
        "disk.setLabel(${1:side}, ${2:label})",
        "disk.getLabel(${1:side})",
        "disk.getDiskID(${1:side})",
        "disk.hasAudio(${1:side})",
        "disk.getAudioTitle(${1:side})",
        "disk.playAudio(${1:side})",
        "disk.stopAudio(${1:side})",
        "disk.eject(${1:side})",

    //FS (2013-03-12)
        "fs.list(${1:path})",
        "fs.exists(${1:path})",
        "fs.isDir(${1:path})",
        "fs.isReadOnly(${1:path})",
        "fs.getName(${1:path})",
        "fs.getDrive(${1:path})",
        "fs.getSize(${1:path})",
        "fs.makeDir(${1:path})",
        "fs.move(${1:fromPath}, ${2:toPath})",
        "fs.copy(${1:fromPath}, ${2:toPath})",
        "fs.delete(${1:path})",
        "fs.combine(${1:basePath}, ${2:localPath})",
        "fs.open(${1:path})",

    //GPS (2013-03-12)
        "gps.locate(${1:timeout}, ${2:debug})",

    //Help (2013-03-12)
        "help.path()",
        "help.setPath(${1:path})",
        "help.lookup(${1:topic})",
        "help.topics()",

    //HTTP (2013-03-12)
        "http.request(${1:url}, {2:*postData})",
        "http.get(${1:url})",
        "http.post(${1:url}, {2:postData})",

    //OS (2013-03-12)
        "os.version()",
        "os.getComputerID()",
        "os.getComputerLabel()",
        "os.setComputerLabel(${1:label})",
        "os.run(${1:environment}, {$2:programpath}, {$3:arguments})",
        "os.loadApi(${1:name})",
        "os.unloadApi(${1:name})",
        "os.pullEvent(${1:target-event})",
        "os.pullEventRaw()",
        "os.queueEvent(${1:event}, ${2:param1}, ${3:param1}, {${4:...})",
        "os.clock()",
        "os.startTimer(${1:timeout})",
        "os.sleep(${1:timeout})",
        "os.time()",
        "os.day()",
        "os.setAlarm(${1:time})",
        "os.shutdown()",
        "os.reboot()",

    //Paintutils (2013-03-12)
        "paintutils.loadImage(${1:path})",
        "paintutils.drawImage(${1:image}, ${2:x}, ${3:y})",   
        "paintutils.drawPxel(${1:x}, ${2:y}, ${3:color})",
        "paintutils.drawLine(${1:startX}, ${2:startY}, ${3:endX}, ${4:endY}, ${5:color})",

    //Parallel (2013-03-12)
        "parallel.waitForAny(${1:function1}, ${2:function2}, ${3:...})",
        "parallel.waitForAll(${1:function1}, ${2:function2}, ${3:...})",

    //Peripheral (2013-03-12)
        "peripheral.isPresent(${1:side})",
        "peripheral.getType(${1:side})",
        "peripheral.getMethods(${1:side})",
        "peripheral.call(${1:side}, ${2:methodName}, ${3:param1}, ${4:param2}, ${5:...})",
        "peripheral.wrap(${1:side})",

    //Rednet (2013-03-12)
        "rednet.open(${1:side})",
        "rednet.close(${1:side})",
        "rednet.announce()",
        "rednet.send(${1:receiverID}, ${2:message})",
        "rednet.broadcast(${1:side})",
        "rednet.receive(${1:timeout})",
        "rednet.isOpen(${1:side})",

    //Redstone (2013-03-12)
        "redstone.getSides()",
        "redstone.getInput(${1:side})",
        "redstone.setOutput(${1:side}, ${2:value})",
        "redstone.getOutput(${1:side})",
        "redstone.getBundledInput(${1:side})",
        "redstone.getBundledOutput(${1:side})",
        "redstone.setBundledOutput(${1:side}, ${2:colors})",
        "redstone.testBundledInput(${1:side}, ${2:color})",

    //Shell (2013-03-12)
        "shell.exit()",
        "shell.dir()",
        "shell.setDir(${1:path})",
        "shell.path()",
        "shell.setPath(${1:path})",
        "shell.resolve(${1:localpath})",
        "shell.resolveProgram(${1:name})",
        "shell.aliases()",
        "shell.setAlias(${1:path}, ${2:command})",
        "shell.clearAlias(${1:path}, ${2:command})",
        "shell.programs()",
        "shell.run(${1:program}, ${2:arguments})",
        "shell.getRunningProgram()",

    //Term (2013-03-12)
        "term.write(${1:text})",
        "term.clear()",
        "term.clearLine()",
        "term.getCursorPos()",
        "term.setCursorPos(${1:x}, ${2:y})",
        "term.setCursorBlink(${1:bool})",
        "term.isColor()",
        "term.getSize()",
        "term.scroll(${1:n})",
        "term.redirect(${1:target})",
        "term.restore()",
        "term.setTextColor(${1:color})",
        "term.setBackgroundColor(${1:color})",

    //Textutils (2013-03-12)
        "textutils.slowPrint(${1:text}, ${2:rate})",
        "textutils.slowWrite(${1:text}, ${2:rate})",
        "textutils.formatTime(${1:time}, ${2:TwentyFourHour})",
        "textutils.tabulate(${1:table}, ${2:table2}, ${3:...})",
        "textutils.pagedTabulated(${1:table}, ${2:table2}, ${3:...})",
        "textutils.pagedPrint(${1:string}, ${2:confirmation_lines})",
        "textutils.serialize(${1:table})",
        "textutils.unserialize(${1:text})",
        "textutils.urlEncode(${1:text})",

    //Tuerle (2013-03-12)
        "turtle.craft(${1:quantity})",
        "turtle.forward()",
        "turtle.back()",
        "turtle.up()",
        "turtle.down()",
        "turtle.turnLeft()",
        "turtle.turnRight()",
        "turtle.select(${1:slotNum})",
        "turtle.getItemCount(${1:slotNum})",
        "turtle.getItemSpace(${1:slotNum})",
        "turtle.attack()",
        "turtle.attackUp()",
        "turtle.attackDown()",
        "turtle.dig()",
        "turtle.digUp()",
        "turtle.digDown()",
        "turtle.place(${1:signText})",
        "turtle.placeUp()",
        "turtle.placeDown()",
        "turtle.detect()",
        "turtle.detectUp()",
        "turtle.detectDown()",
        "turtle.compare()",
        "turtle.compareUp()",
        "turtle.compareDown()",
        "turtle.compareTo(${1:slot})",
        "turtle.drop(${1:count})",
        "turtle.dropUp(${1:count})",
        "turtle.dropDown(${1:count})",
        "turtle.suck()",
        "turtle.suckUp()",
        "turtle.suckDown()",
        "turtle.refuel(${1:quantity})",
        "turtle.getFuelLevel()",
        "turtle.transferTo(${1:slot}, ${2:quantity})",

        //Core Function (2013-03-12)
        "print(${1:string})",
        "tonumber(${1:string})",
        "tostring(${1:object})",
        "write(${1:string})"
    ]
}
MudkipTheEpic #57
Posted 24 March 2013 - 11:54 AM
Elseifs seem to be broken again!
GravityScore #58
Posted 24 March 2013 - 02:54 PM
Elseifs seem to be broken again!
Fixed in a new version I'll release in a minute!

Anyway, I created a small list with the CC core functions. It dosn't really support namespaces, but I'm looking into that.

THANK YOU!! :D/> That list was very helpful. I just used a bit of regex and turned all of them into proper triggers, and now we have completions for all main CC functions! Coming in the soon-to-be-released version!

EDIT: Also fixed the bug where functions defined like:

a = function(hello)
  print(hello)
end
Wouldn't indent properly when using re-indent, or just when typing them :D/>

EDIT 2: Version 1.2 released!
superaxander #59
Posted 24 March 2013 - 07:34 PM
Wooh
theoriginalbit #60
Posted 24 March 2013 - 07:39 PM
EDIT: Also fixed the bug where functions defined like:

a = function(hello)
  print(hello)
end
Wouldn't indent properly when using re-indent, or just when typing them :D/>
FINALLY! :D/>
can you fix the bad indenting with

if <some-condition> then <do something> end
  <next-instruction-is-indented>

EDIT: Really the problem is just, anything that has an end on the same line its declared indents the next line.
FuuuAInfiniteLoop(F.A.I.L) #61
Posted 25 March 2013 - 02:34 AM
bug: if you try to put end it will be remplaced with term.setTextColor
GravityScore #62
Posted 25 March 2013 - 02:35 AM
bug: if you try to put end it will be remplaced with term.setTextColor

That's not my fault, that's just the huge list of completions that could be filled with end. I could try and stop code completions for Lua keywords… I'll see what I can do…
diegodan1893 #63
Posted 25 March 2013 - 04:28 AM
I just tried this and it's awesome. Thanks Grav!

can you fix the bad indenting with

if <some-condition> then <do something> end
  <next-instruction-is-indented>

EDIT: Really the problem is just, anything that has an end on the same line its declared indents the next line.
This is working well for me
theoriginalbit #64
Posted 25 March 2013 - 04:34 AM
I just tried this and it's awesome. Thanks Grav!

can you fix the bad indenting with

if <some-condition> then <do something> end
  <next-instruction-is-indented>

EDIT: Really the problem is just, anything that has an end on the same line its declared indents the next line.
This is working well for me
Hmmm ok so ifs, are working for me again, but when typing the functions and not using the auto complete the end doesn't move back.
MysticT #65
Posted 25 March 2013 - 09:39 AM
Could you make a github repo so we can use Package Control to download/update? That would be so helpfull :D/>
Sammich Lord #66
Posted 25 March 2013 - 09:45 AM
Could you make a github repo so we can use Package Control to download/update? That would be so helpfull :D/>
I would love this too. Manually having to download updates is a pain. Just having some bot do it for me is easy :P/>
Shnupbups #67
Posted 25 March 2013 - 09:50 AM
When I type 'do' for loops, it auto-changes to turtle.digDown()… -_-/>
GravityScore #68
Posted 25 March 2013 - 08:51 PM
Ok, added GitHub repo! :D/> Gosh this is gonna be so much easier for me now… Thanks for the idea! (why did I not think of it :P/>)

Found here: https://github.com/GravityScore/ST2-ComputerCraft-Package

I've also submitted a request to have it included under the listings for the ST2 Package Control Plugin, so hopefully that will come through soon!
theoriginalbit #69
Posted 26 March 2013 - 04:05 AM
Hey Grav,

Can you please make this change to the main computercraft.xml


<key>fileTypes</key>
<array>
  <string></string>
  <string>lua</string>
</array>

this way when we create new files it doesn't put the .lua on the end and we have to save and then rename to remove the extension and it means it will still be able to detect lua files as computercraft syntax. small change, but one I have to do everytime I download a new version :P/> … the reason for not having the extension is because os.loadAPI does not like . or - or anything of that nature in the file names, as when it loads it into _G we have no way off accessing it without doing _G['some-file.lua'].func() as the . and - and + etc are all seen as operators not the string when doing some-file.lua.func()
Sammich Lord #70
Posted 26 March 2013 - 04:17 AM
Just a FYI to noobies out there. Once you have package control installed you need to add the repo then install the package. The package won't install after you add the repo.
MudkipTheEpic #71
Posted 26 March 2013 - 04:18 AM
When I type 'do' for loops, it auto-changes to turtle.digDown()… -_-/>

End is rednet.send… XD
GravityScore #72
Posted 26 March 2013 - 04:41 AM
Hey Grav,

Can you please make this change to the main computercraft.xml


<key>fileTypes</key>
<array>
  <string></string>
  <string>lua</string>
</array>

this way when we create new files it doesn't put the .lua on the end and we have to save and then rename to remove the extension and it means it will still be able to detect lua files as computercraft syntax. small change, but one I have to do everytime I download a new version :P/> … the reason for not having the extension is because os.loadAPI does not like . or - or anything of that nature in the file names, as when it loads it into _G we have no way off accessing it without doing _G['some-file.lua'].func() as the . and - and + etc are all seen as operators not the string when doing some-file.lua.func()

Good Idea! I'll update the GitHub repo. Not sure how this sort of updating system works through Package Control. Do I have to re-install the package?
Sammich Lord #73
Posted 26 March 2013 - 04:43 AM
Hey Grav,

Can you please make this change to the main computercraft.xml


<key>fileTypes</key>
<array>
  <string></string>
  <string>lua</string>
</array>

this way when we create new files it doesn't put the .lua on the end and we have to save and then rename to remove the extension and it means it will still be able to detect lua files as computercraft syntax. small change, but one I have to do everytime I download a new version :P/> … the reason for not having the extension is because os.loadAPI does not like . or - or anything of that nature in the file names, as when it loads it into _G we have no way off accessing it without doing _G['some-file.lua'].func() as the . and - and + etc are all seen as operators not the string when doing some-file.lua.func()

Good Idea! I'll update the GitHub repo. Not sure how this sort of updating system works through Package Control. Do I have to re-install the package?
It should update by itself. But you can run "Package Control: Upgrade Package" if it doesn't. It is a pretty cool plugin.
theoriginalbit #74
Posted 26 March 2013 - 04:44 AM
When I type 'do' for loops, it auto-changes to turtle.digDown()… -_-/>
End is rednet.send… XD
true is turtle.refuel :P/>
GravityScore #75
Posted 26 March 2013 - 04:56 AM
When I type 'do' for loops, it auto-changes to turtle.digDown()… -_-/>
End is rednet.send… XD
true is turtle.refuel :P/>

Fixed it! Basically just added completions for all the keywords in Lua :P/>

Updated GitHub…
theoriginalbit #76
Posted 26 March 2013 - 04:59 AM
add this to the repo, making the appropriate changes… its details for package control

File >>>> package-metadata.json


{
"version": "1.6.3",
"url": "http://wbond.net/sublime_packages/package_control",
"description": "A full-featured package manager"
}
diegodan1893 #77
Posted 26 March 2013 - 06:56 AM
There is a bug with indenting with elseif
GravityScore #78
Posted 26 March 2013 - 11:59 AM
There is a bug with indenting with elseif

It only detects else ifs with the proper syntax, so elseif blah then. It won't detect just plain elseif on a line.
Engineer #79
Posted 26 March 2013 - 02:22 PM
Grav thanks for the plugin!
Only one thing that annoys me that end and then enter is term.setBackgroundcolor(colors)

I dont know if this is fixable otherwise I should get used to hitting space after end! :P/>
diegodan1893 #80
Posted 27 March 2013 - 01:50 AM
Grav thanks for the plugin!
Only one thing that annoys me that end and then enter is term.setBackgroundcolor(colors)

I dont know if this is fixable otherwise I should get used to hitting space after end! :P/>

That was fixed in the last update
GravityScore #81
Posted 27 March 2013 - 01:54 AM
Grav thanks for the plugin!
Only one thing that annoys me that end and then enter is term.setBackgroundcolor(colors)

I dont know if this is fixable otherwise I should get used to hitting space after end! :P/>

That was fixed in the last update

I couldn't be bothered updating the Mega or Dropbox Zips, so if he didn't use the Package control method, then the update wouldn't be installed.

I should really update those zips….
Engineer #82
Posted 27 March 2013 - 02:33 AM
Grav thanks for the plugin!
Only one thing that annoys me that end and then enter is term.setBackgroundcolor(colors)

I dont know if this is fixable otherwise I should get used to hitting space after end! :P/>

That was fixed in the last update

I couldn't be bothered updating the Mega or Dropbox Zips, so if he didn't use the Package control method, then the update wouldn't be installed.

I should really update those zips….
Yup that was the problem, Im using the github now :)/>
Thanks for the awesome plugin
MudkipTheEpic #83
Posted 27 March 2013 - 03:11 AM
in is redstone.getInput(side)

(Should we post bugs on the Github repository, or on this thread)
theoriginalbit #84
Posted 27 March 2013 - 03:14 AM
Just remove the zips grav.make people use package control
GravityScore #85
Posted 27 March 2013 - 03:36 AM
Just remove the zips grav.make people use package control

Good idea :P/>
MudkipTheEpic #86
Posted 01 April 2013 - 05:08 PM
[left]Is there any way to make ALL files open in this mode ALL the time?[/left]

[left]And the centerprint function is bugged, first line second argument should be ny not y.[/left]
theoriginalbit #87
Posted 01 April 2013 - 05:25 PM
[left]Is there any way to make ALL files open in this mode ALL the time?[/left]
modify this package made by NeverCast
http://www.computercraft.info/forums2/index.php?/topic/10573-sublime-2-plugin-for-auto-lua-syntax/
superaxander #88
Posted 01 April 2013 - 08:50 PM
Second Report. I iterated through _G printing out all the functions and variables. There are a few you missed, take a look at the output in Sublime too see what. :)/>/>

EDIT: Oh there is a bug in the iteration, the native. functions are obviously term.native … but I assume you would know that :)/>/>

I also suggest that variables and functions should also highlight when _G. is at the front though, its still a valid function call/variable

The Output
Spoilerhttp://pastebin.com/XLpmeYmR


The Code I Used To Do This (In case you're interested)
Spoiler


local h = fs.open(".dump", "w")
local function iterateTable(t, id)
  print("Iterating table "..tostring(t))
  for k,v in pairs(t) do
	if type(v) == "table" and tostring(k) ~= "_G" then -- this stopped some nasty recursion, why they store _G as a variable in _G gets me!
	  sleep(0)
	  iterateTable(v, k)
	elseif type(v) == "function" then
	  local value = "function: value: "..(id ~= "_G" and id.."." or "")..tostring(k).."()\n"
	  write(value)
	  h.write(value)
	  sleep(0)
	elseif tostring(k) ~= "_G" then -- Stops _G from printing in front, and stops some duplicates, I suggest that variables and functions should also highlight when _G. is at the front though, its still a valid function call
	  local value = "variable: value: "..(id ~= "_G" and id.."." or "")..tostring(k).."\n"
	  write(value)
	  h.write(value)
	  sleep(0)
	end
  end
  return
end
iterateTable(_G, "_G")
h.close()
In your script k is always a string so you won't need tostring
theoriginalbit #89
Posted 01 April 2013 - 08:54 PM
In your script k is always a string so you won't need tostring
when it is a string tostring just returns it. but its just habit for me to do it that way from peripheral.getMethods(<side>) not always returning it correctly with some 3rd party peripherals, some the method name is in k and others its in v… so I'm used to doing
print( tostring(k)..' : '..tostring(v) )

In any case the code didn't overly matter… I was iterating the globals to get the function and variable listings.
GravityScore #90
Posted 01 April 2013 - 08:59 PM
And the centerprint function is bugged, first line second argument should be ny not y.

Fixed on GitHub. Thanks!
MudkipTheEpic #91
Posted 02 April 2013 - 04:13 AM
And the centerprint function is bugged, first line second argument should be ny not y.

Fixed on GitHub. Thanks!

NP. And, I don't really get how to use that plugin… :/
theoriginalbit #92
Posted 02 April 2013 - 04:18 AM
And, I don't really get how to use that plugin… :/
Which? NeverCasts?
MudkipTheEpic #93
Posted 02 April 2013 - 04:19 AM
Yes.
theoriginalbit #94
Posted 02 April 2013 - 04:41 AM
Yes.
Did you follow his basic instructions? and change the property from "Lua" to "ComputerCraft"
Engineer #95
Posted 02 April 2013 - 07:34 AM
I have found a bug:

os.loadApi(name)
os.unloadApi(name)

--Should be:
os.loadAPI(name)
os.unloadAPI(name)

Thanks for the great add-on :)/>
Molinko #96
Posted 02 April 2013 - 05:24 PM
I, I Love you.. *vomits rainbow *wafted away by unicorns
GravityScore #97
Posted 02 April 2013 - 09:40 PM
I have found a bug:

os.loadApi(name)
os.unloadApi(name)

--Should be:
os.loadAPI(name)
os.unloadAPI(name)

Thanks for the great add-on :)/>

Thanks! Fixed on GitHub.
grand_mind1 #98
Posted 06 April 2013 - 02:29 PM
This looks amazing but unfortunately I can't seem to install it. On step seven it says to search for ST2-ComputerCraft-Package. When I try to search for this nothing comes up. This looks really good and I want to use it. If someone could help me with the installation that would be great!
Thanks! :D/>
Sammich Lord #99
Posted 06 April 2013 - 02:34 PM
This looks amazing but unfortunately I can't seem to install it. On step seven it says to search for ST2-ComputerCraft-Package. When I try to search for this nothing comes up. This looks really good and I want to use it. If someone could help me with the installation that would be great!
Thanks! :D/>
Package Control: http://wbond.net/sublime_packages/package_control

What you need to do is after installing Package Control add the repo by doing: CTRL+SHIFT+P then typing "Package Control: Add Repository" then type in the URL of the Github repository.
After that type "Package Control: Install Package" and search for "ComputerCraft". It should show up then.
grand_mind1 #100
Posted 06 April 2013 - 02:47 PM
This looks amazing but unfortunately I can't seem to install it. On step seven it says to search for ST2-ComputerCraft-Package. When I try to search for this nothing comes up. This looks really good and I want to use it. If someone could help me with the installation that would be great!
Thanks! :D/>
Package Control: http://wbond.net/sub...package_control

What you need to do is after installing Package Control add the repo by doing: CTRL+SHIFT+P then typing "Package Control: Add Repository" then type in the URL of the Github repository.
After that type "Package Control: Install Package" and search for "ComputerCraft". It should show up then.
Hmmm. I tried all of this but it still didn't work. On my third try I accidentally left the console open. After clicking "Pack Control: Install Package" this error is logged to the console:

Package Control: Error downloading repository. HTTP error 404 downloading https://api.github.com/users/G...erCraft-Package/repos?per_page=100.
I don't know if this is something I've done wrong.
grand_mind1 #101
Posted 06 April 2013 - 02:50 PM
*Facepalms through face and into the back wall* Sorry, if I'm correct that is not the correct URL. I will try the actual one now…
Sammich Lord #102
Posted 06 April 2013 - 02:52 PM
*Facepalms though face and into the back wall* Sorry, if I'm correct that is not the correct URL. I will try the actual one now…
Haha. I was just going to ask you if you typed in "https://github.com/GravityScore/ST2-ComputerCraft-Package". :P/>
grand_mind1 #103
Posted 06 April 2013 - 02:55 PM
Well, I think I've spread enough derp today. Thanks for the awesome syntax addon gravityscore!
angellus #104
Posted 09 April 2013 - 11:49 AM
Holy shit, I love you. I just recently switch to Sublime Text 2.
fun #105
Posted 13 April 2013 - 03:50 PM
Epic, thanks for introducing me to sublime text and and putting all this work into it!

BTW: is there a way to get a color on the functions that are being called in the code?
GravityScore #106
Posted 13 April 2013 - 06:48 PM
BTW: is there a way to get a color on the functions that are being called in the code?

No, sorry, that's not possible to my knowledge. Glad you like it.
superaxander #107
Posted 14 April 2013 - 11:28 PM
ctrl-shift-p all the way!
Got newest version it's awesome! ;)/>
Engineer #108
Posted 20 April 2013 - 09:23 AM
Is it me or is there no colours API support?

Nothing big, but I think some people will get annoyed eventually by it. Just a FYI :)/>
superaxander #109
Posted 20 April 2013 - 09:26 AM
Is it me or is there no colours API support?

Nothing big, but I think some people will get annoyed eventually by it. Just a FYI :)/>/>
Actually there should be cause he read the whole _G table hmm…
Engineer #110
Posted 20 April 2013 - 09:28 AM
Hmm.. its weird, it does highlight but it does not pop up in that selection screen. I can only see color.x
superaxander #111
Posted 20 April 2013 - 09:38 AM
Maybe he didn't want multiple of the same color in the list?
Espen #112
Posted 20 April 2013 - 10:55 AM
@GravityScore:
Nice work, I can't believe you haven't received a [+1] yet. I find this pretty handy, thx for taking the time to put this together.
GravityScore #113
Posted 20 April 2013 - 09:54 PM
Is it me or is there no colours API support?

Nothing big, but I think some people will get annoyed eventually by it. Just a FYI :)/>

Thanks for pointing that out! Can't believe I forgot to add this to the completions list, considering I'm an Auzzie :P/> Silly Obj-C, teaching me to use the American spelling for everything.

Added to the package on GitHub.
Engineer #114
Posted 20 April 2013 - 10:39 PM
Thanks a lot :D/>
Engineer #115
Posted 21 April 2013 - 12:30 AM
I also noticed another thing that could be.. well.. annoying I guess.

You have term.setBackgroundcolour but it should be term.setBackgrounColour. Its the same for term.setTextColour.

I love this plugin :D/>
GravityScore #116
Posted 21 April 2013 - 01:51 AM
I also noticed another thing that could be.. well.. annoying I guess.

You have term.setBackgroundcolour but it should be term.setBackgrounColour. Its the same for term.setTextColour.

I love this plugin :D/>

Thanks again. I noticed that too, and thought I fixed it. Forgot about the background color :P/>
GravityScore #117
Posted 23 April 2013 - 01:27 AM
Good news everyone!

My pull request to the Sublime Text Package Control project was accepted, meaning that this is now available in the listings for Package Control in Sublime Text :D/> :D/> :D/>

I'll update the download tutorial in the OP.
theoriginalbit #118
Posted 23 April 2013 - 01:42 AM
Installation
1. Download and install Sublime Text 2's Package Control Plugin
2. Open the command palette (Tools -> Command Palette, or Control+Shift+P)
3. Search for Package Control: List Packages
4. Search for ST2-ComputerCraft-Package in the listings
5. Hit enter
6. Restart Sublime Text!
Not quite…
2. What about Mac? :(/> :P/> (⌘+⇧+P)
3. Search for "Package Control: Install Packages" … list packages lists the already installed ones.
4. There was no ST2- in the front, it was "ComputerCraft Package"
theoriginalbit #119
Posted 05 May 2013 - 12:31 AM
Bug…

repeat
  -- code
until <condition>
each time enter is pressed after until the text is indented.
jesusthekiller #120
Posted 29 July 2013 - 12:10 PM
Tutorial how to get it working for Sublime 3 (On Linux):
  1. Open Sublime
  2. Click Preferences > Browse packages
  3. Copy path to this dir
  4. Open Terminal
  5. CD into that dir
  6. run git clone https://github.com/wbond/sublime_package_control.git "Package Control"
  7. CD into Package\ Control
  8. run git checkout python3
  9. Restart sublime
  10. Click Preferences > Package Control > Package Control: Install Package
  11. Choose ComputerCraft Package
  12. Wait fot it to download and install
  13. Done!
GravityScore #121
Posted 30 July 2013 - 08:46 AM
Tutorial how to get it working for Sublime 3 (On Linux):

Thanks for that! I'll add it to the OP. I should look more into Sublime 3 :P/>
jesusthekiller #122
Posted 30 July 2013 - 04:52 PM
It was pleasure :P/>
UselessFlaw #123
Posted 31 July 2013 - 09:37 AM
O.o now I can go into my dark corner and code even better, thank you!
AtomicCockroach #124
Posted 12 August 2013 - 11:12 AM
This is awesome, thank you very much! I made an account for these forums just to say this is great! :D/>
theoriginalbit #125
Posted 16 August 2013 - 07:13 PM
New function to add: peripheral.getNames()
M4sh3dP0t4t03 #126
Posted 26 August 2013 - 10:15 AM
It disapeared one day from my computer and I couldn't redownload it because I couln't find it using Package control search anymore.
TechMasterGeneral #127
Posted 26 April 2014 - 01:56 AM
Are you still maintaining this? It is really awesome.. I updated it and i'm gonna put it up for you to merge… but I was going to ask if I could take it over… I really like making Sublime Text packages
GravityScore #128
Posted 26 April 2014 - 03:55 AM
Are you still maintaining this? It is really awesome.. I updated it and i'm gonna put it up for you to merge… but I was going to ask if I could take it over… I really like making Sublime Text packages

What else would you like to see? If you want to contribute, feel free to submit pull requests on GitHub, but I don't really wish to hand this project over to anyone else just yet.
TechMasterGeneral #129
Posted 26 April 2014 - 07:42 PM
Are you still maintaining this? It is really awesome.. I updated it and i'm gonna put it up for you to merge… but I was going to ask if I could take it over… I really like making Sublime Text packages

What else would you like to see? If you want to contribute, feel free to submit pull requests on GitHub, but I don't really wish to hand this project over to anyone else just yet.
kk.. I made the pull request with updated CC API fuctions a couple snippets and modem API functions
RoD #130
Posted 02 June 2014 - 08:57 PM
Can i open files with no extension with this Syntax Highlighting automaticaly?

Edit: Nevermind, i installed default file type plugin :P/>
Edited on 02 June 2014 - 07:17 PM
Admicos #131
Posted 09 January 2016 - 07:53 PM
Sorry for the necro, but i just ported this to Atom.

You can find the topic here: http://www.computercraft.info/forums2/index.php?/topic/25608-atom-computercraft-syntax/

I didn't ask for permission (sorry) but if you are GravityScore and you want me to remove this, just message me about it.
Creator #132
Posted 09 January 2016 - 09:04 PM
Sorry for the necro, but i just ported this to Atom.

You can find the topic here: http://www.computerc...ercraft-syntax/

I didn't ask for permission (sorry) but if you are GravityScore and you want me to remove this, just message me about it.


Now this is an official apology. By the way, thanks, will try it out ASAP.
1wsx10 #133
Posted 03 February 2016 - 06:43 AM
ik its like this in the normal lua but it annoys me so please change it

functions do not get consistent highlighting.. example:


function helloWorld()
  print("Hello World!")
end
helloWorld()

function helloWorld() <— this becomes green

but

helloWorld() <– this stays white!!
michthom #134
Posted 11 March 2016 - 08:46 PM
Necro again - I asked for an update to Cyb3rWarri0r8's fork of the original Github repository to fix a couple of issues with endif and curly brace blocks