Main Menu

IDE integration

Started by zfl4, Dec 11, 2020, 09:22 PM

Previous topic - Next topic

zfl4

I have just rediscovered computer craft, after my first attempt with it many years ago in a mod pack. I'm still not great at programming, but I have a lot better of an understanding now.

I've been able to set up an ide to run along side Minecraft (just by finding the lua files in the world directory) and it works just fine if I save everything. However, the frustration of the clunky terminal, is replaced with the a text editor that doesn't understand the apis I want to use.

So the question is this: how can I integrate the computer craft code so that when I type turtle, for example, the ide knows I'm saying access the turtle api table.

SquidDev

#1
There's no "universal" way to do it, as it'll vary from editor to editor. If you're using VS Code, there's an extension pack for ComputerCraft, which adds auto-complete for the built-in APIs.

Otherwise, you might be able to copy the rom directory of the mod into a local folder and try to get your IDE to index it.
GitHub | CC:Tweaked: A ComputerCraft fork | Plethora: A peripheral mod

Lupus590

Personally, I use and would recommend Visual Studio Code with this extension: https://marketplace.visualstudio.com/items?itemName=lemmmy.computercraft-extension-pack

It includes the Lua extension that SquidDev recommended plus another written for computercraft that tells it all about the APIs that you want.

SquidDev

Quote from: Lupus590 on Dec 11, 2020, 11:49 PMPersonally, I use and would recommend Visual Studio Code with this extension: https://marketplace.visualstudio.com/items?itemName=lemmmy.computercraft-extension-pack
Ah woops, that's what I meant to copy, and then got distracted by the language server. Thanks!
GitHub | CC:Tweaked: A ComputerCraft fork | Plethora: A peripheral mod

QuickMuffin8782

Quote from: SquidDev on Dec 12, 2020, 08:19 AM
Quote from: Lupus590 on Dec 11, 2020, 11:49 PM
Quote from: zfl4 on Dec 11, 2020, 09:22 PMI have just rediscovered computer craft, after my first attempt with it many years ago in a mod pack. I'm still not great at programming, but I have a lot better of an understanding now.

I've been able to set up an ide to run along side Minecraft (just by finding the lua files in the world directory) and it works just fine if I save everything. However, the frustration of the clunky terminal, is replaced with the a text editor that doesn't understand the apis I want to use.

So the question is this: how can I integrate the computer craft code so that when I type turtle, for example, the ide knows I'm saying access the turtle api table.
Personally, I use and would recommend Visual Studio Code with this extension: https://marketplace.visualstudio.com/items?itemName=lemmmy.computercraft-extension-pack
Ah woops, that's what I meant to copy, and then got distracted by the language server. Thanks!

I'd suggest to also find a local ComputerCraft editor that can wrap in Lua 5.1 and detect any mistakes in your code. I use a editor that uses java. The link that Microsoft Visual Studio should help with the plugin. (can't access and I have to use a editor with java because my PC uses Windows Vista.)
"The Blue Blur" - Working on Net Star OS, a new frontier for Red Star OS 3.0
linktr.ee/quickmuffin8782