CoralSnake Language Support for VS Code
Provides syntax highlighting for the CoralSnake language (.dust
files), a domain-specific language designed for scripting Redstone logic in Minecraft.
What is CoralSnake?
CoralSnake is a simple scripting language created to make designing and implementing complex Redstone contraptions in Minecraft more manageable and structured. It allows users to define logic using familiar programming concepts, which can then be interpreted or compiled into Minecraft commands or structures.
Features
- Syntax Highlighting: Clear and distinct highlighting for keywords, functions, variables, numbers, and comments in
.dust
files.
- Language Recognition: Automatically recognizes files with the
.dust
extension as CoralSnake scripts.
(Future features may include snippets, linting, and more!)
Installation
- Open Visual Studio Code.
- Go to the Extensions view (
Ctrl+Shift+X
or Cmd+Shift+X
).
- Search for "CoralSnake Language Support".
- Click "Install".
Alternatively, you can install it from the VS Code Marketplace website.
How to Use
Simply open any file with the .dust
extension, and the syntax highlighting will be automatically applied.
Example .dust
Code
# Define a simple blinking light function
def blink_light(target_block, interval)
# Variables to store state
var light_state = false
var timer = 0
# Loop indefinitely
loop
wait interval
timer = timer + interval # This syntax might change based on actual language spec
if light_state == false
activate target_block # Turn the light on
light_state = true
else
deactivate target_block # Turn the light off
light_state = false
end
end
end
# Call the function for a Redstone lamp at coordinates 10, 64, -20
# Assuming 'block(x,y,z)' is a way to reference blocks (adjust as per language spec)
call blink_light(block(10, 64, -20), 10) # Blink every 10 ticks (0.5 seconds)
# Example of direct commands
output "Starting main sequence"
pulse redstone_wire_segment_1 5 # Pulse a wire for 5 ticks
(Note: This is a conceptual example. Adapt it based on the actual CoralSnake language specification.)
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page (link to be updated).
License
MIT