Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fn/end and do/end as brackets in language configuration #84

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [Unreleased]

### Added

- Added support for `do`/`end` and `fn`/`end` as brackets for VSCode, enabling
bracket colorization and bracket navigation features.

## [0.0.16]

### Added
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ The path should look something like
Controls whether notifications are shown after automatic installs of new Lexcial
versions. Defaults to `true`.

### Editor Configuration

The extension provides a language configuration for Elixir which marks
`do`/`end` and `fn`/`end` as brackets. Among other things, this enables
colorization of `do`/`end` and `fn`/`end` with VSCode's
`editor.bracketPairColorization.enabled` setting. While this can be helpful when
searching for a `do`'s corresponding `end`, some users may prefer to use the
standard keyword coloring, while still highlighting parenthesis and other
brackets. This can be achieved by adding the following to your VSCode
configuration.

```jsonc
"editor.bracketPairColorization.enabled": true,
"[elixir]": {
"editor.language.colorizedBracketPairs": [
["{", "}"],
["[", "]"],
["(", ")"]
]
}
```

### Erlang and Elixir version compatibility

#### Erlang
Expand Down
4 changes: 3 additions & 1 deletion elixir-language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
["(", ")"],
["do", "end"],
["fn", "end"]
],
"surroundingPairs": [
["{", "}"],
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
{
"language": "elixir",
"scopeName": "source.elixir",
"path": "./syntaxes/elixir.json"
"path": "./syntaxes/elixir.json",
"unbalancedBracketScopes": [
"constant.language.symbol.elixir"
]
},
{
"language": "eex",
Expand Down