vscode-crystal-lang v0.9.6
VSCode Extension for Crystal Language
This extension provides support for the Crystal programming language.
Requirements
It is recommended to install the Crystal programming language (platform dependendant). No other dependencies are required. For debugging support, it's recommended to follow the guide here.
Features
- Syntax highlighting:
- Auto indentation:
- Automatically indent while coding (after
do
,if
, etc.)
- Automatically indent while coding (after
- Snippets:
- Helpful code completions for common use-cases
- Formatting
- Allows for "format on save" and manual formatting, and works even if the editor isn't saved to disk
- Problems finder
- 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.
- Document symbols
- 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
- Peek / go to definition
- When enabled, this allows for quickly jumping to the definition(s) for a method using the
crystal tool implementations
command
- When enabled, this allows for quickly jumping to the definition(s) for a method using the
- Show type on hover
- 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
- When enabled, this allows for viewing the type of a variable or return type of a method on hover, using the
- Tasks
- Enables executing various
crystal
/shards
commands directly from VSCode
- Enables executing various
Settings
compiler
- set a custom absolute path for the Crystal compilerdefinitions
- enables jump-to-definition (reload required)dependencies
- use the dependencies tool to determine the main for each file, required if there's multiple entrypoints to the project, can be slowflags
- flags to pass to the compilerhover
- show type information on hover (reload required)main
- set a main executable to use for the current project (${workspaceRoot}/src/main.cr
)problems
- runs the compiler on save and reports any issues (reload required)server
- absolute path to an LSP executable to use instead of the custom features provided by this extension, like Crystalline (reload required)server-env
- object defining env variables to pass to the LSP (reload required)shards
- set a custom absolute path for the shards executablespec-explorer
- enable the built-in testing UI for specs, recommended for Crystal >= 1.11 due to--dry-run
flag (reload required)spec-tags
- specific tags to pass to the spec runnerdisable-gc
- disable the garbage collector when running compiler tools, can provide increased performance at the cost of increased memory usage, defaults to false
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:
// .vscode/settings.json
{
// Turn off slow/memory-intensive features for larger projects
"crystal-lang.definitions": false,
"crystal-lang.dependencies": false,
"crystal-lang.hover": false,
"crystal-lang.problems": false,
"crystal-lang.spec-explorer": false,
}
Supported Platforms
This extension has been tested on / should work on the following platforms:
- Linux (Arch / Ubuntu / Fedora)
- MacOS (Intel / Apple Silicon)
- Windows (10 Native / 10 WSL2 / 11)
- GitHub Codespaces
Roadmap
These are some features that are planned or would be nice for the future of this project or others:
- Better / faster LSP support
- Better completion algorithm
- Better symbol detection
- Integrated debugger support
- Refactored task runner
Release Notes
See Changelog
Contributing
- Fork it https://github.com/crystal-lang-tools/vscode-crystal-lang/fork
- Create your feature branch
git checkout -b my-new-feature
- Commit your changes
git commit -am 'Add some feature'
- Push to the branch
git push origin my-new-feature
- Create a new Pull Request
Contributors
- @faustinoaq Faustino - creator
- @nobodywasishere Margret Riegert - maintainer
vscode-crystal-lang
- 279
- 58
- 11
- 0
- 0
- 2 days ago
- June 2, 2017
MIT License
Sun, 17 Nov 2024 14:48:49 GMT