Skip to content
Margret Riegert edited this page Dec 6, 2023 · 16 revisions

Some VS Code extensions useful for Crystal development:

Native Debug

Native Debug provides debugging for compiled languages like Crystal.

Remember to compile using --debug flag

debugging

Endwise

Endwise adds ends automatically to blocks as you type.

Auto Comment Blocks

Auto Comment Blocks provides auto comments block using Shift+Enter.

{
  "auto-comment-blocks.hashStyleBlocks": [
    "crystal"
  ]
}

auto-comments

Code Runner

Code Runner runs selected code snippets per click or keyboard shortcut.

CodeRunner

VS Code on Windows may actually need the following settings:

  • "terminal.integrated.shell.windows": "C:\\Windows\\System32\\bash.exe" -> similar to your bash.exe
  • "code-runner.runInTerminal": true

(due to this you do not need to run it with "crystal.bat" instead of "crystal" for this tool)

You can modify your Crystal-Command (standard run, run --release, ...) in settings ("code-runner.executorMapByFileExtension" and/or "code-runner.executorMap")

Note: be aware of type inference rules in your snippet, its morely useful for viewing correct output / text-generation of simple methods for example!

Clone this wiki locally