You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is recommended to install the [Crystal programming language](https://crystal-lang.org/) (platform dependendant). No other dependencies are required.
12
+
For debugging support, it's recommended to follow the guide [here](https://dev.to/bcardiff/debug-crystal-in-vscode-via-codelldb-3lf).
13
+
14
+
## Features
15
+
16
+
- Syntax highlighting:
17
+
- Syntax highlighting support for Crystal, [Slang](https://github.com/jeromegn/slang), and [ECR](https://crystal-lang.org/api/latest/ECR.html) (contributions for other Crystal templating languages welcome)
18
+
- Auto indentation:
19
+
- Automatically indent while coding (after `do`, `if`, etc.)
20
+
- Snippets:
21
+
- Helpful code completions for common use-cases
22
+
- Formatting
23
+
- Allows for "format on save" and manual formatting, and works even if the editor isn't saved to disk
24
+
- Problems finder
25
+
- When enabled, on opening or saving a file the project will be compiled to find any problems with the code, and these problems are reported in the editor. Depending on the project this can be slow and memory intensive, so there is an option to disable it.
26
+
- Document symbols
27
+
- Allows for easier code navigation through breadcrumbs at the top of the file, as well as being able to view and jump to the documents symbols
28
+
- Peek / go to definition
29
+
- When enabled, this allows for quickly jumping to the definition(s) for a method using the `crystal tool implementations` command
30
+
- Show type on hover
31
+
- When enabled, this allows for viewing the type of a variable or return type of a method on hover, using the `crystal tool context` command
32
+
- Tasks
33
+
- Enables executing various `crystal`/`shards` commands directly from VSCode
34
+
35
+
## Settings
36
+
37
+
-`compiler` - set a custom absolute path for the Crystal compiler
-`dependencies` - use the dependencies tool to determine the main for each file, required if there's multiple entrypoints to the project, can be slow
40
+
-`flags` - flags to pass to the compiler
41
+
-`hover` - show type information on hover (reload required)
42
+
-`main` - set a main executable to use for the current project (`${workspaceRoot}/src/main.cr`)
43
+
-`problems` - runs the compiler on save and reports any issues (reload required)
44
+
-`server` - absolute path to an LSP executable to use instead of the custom features provided by this extension, like [Crystalline](https://github.com/elbywan/crystalline) (reload required)
45
+
-`shards` - set a custom absolute path for the shards executable
46
+
-`spec-explorer` - enable the built-in testing UI for specs, recommended for Crystal >= 1.11 due to `--dry-run` flag (reload required)
47
+
-`spec-tags` - specific tags to pass to the spec runner
48
+
49
+
By default, the problems runner, hover provider, and definitions provider are turned on. This may not be ideal for larger projects due to compile times and memory usage, so it is recommended to turn them off in the vscode settings. That can be done per-project by creating a `.vscode/settings.json` file with:
50
+
51
+
```json
52
+
// .vscode/settings.json
53
+
{
54
+
// Turn off slow/memory-intensive features for larger projects
55
+
"crystal-lang.definitions": false,
56
+
"crystal-lang.dependencies": false,
57
+
"crystal-lang.hover": false,
58
+
"crystal-lang.problems": false,
59
+
"crystal-lang.spec-explorer": false,
60
+
}
61
+
```
62
+
63
+
## Supported Platforms
64
+
65
+
This extension has been tested on / should work on the following platforms:
66
+
67
+
- Linux (Arch / Ubuntu / Fedora)
68
+
- MacOS (Intel / Apple Silicon)
69
+
- Windows (10 Native / 10 WSL2 / 11)
70
+
- GitHub Codespaces
71
+
72
+
## Roadmap
73
+
74
+
These are some features that are planned or would be nice for the future of this project or others:
0 commit comments