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 unexport keyword #38

Merged
merged 1 commit into from
Oct 6, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added

- Unicode codepoint escaped characters in strings from `just` release 1.36.0
- Unexport keyword from `just` release 1.29.0

## [0.5.3] - 2024-08-14

Expand Down
13 changes: 12 additions & 1 deletion syntaxes/just.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@
},
"variable-assignment": {
"patterns": [
{
"match": "^(unexport)\\s+([a-zA-Z_][a-zA-Z0-9_-]*)",
"captures": {
"1": {
"name": "keyword.other.reserved.just"
},
"2": {
"name": "variable.other.just"
}
}
},
{
"begin": "(?x) \n ^\n (?: (export) \\s+)?\n ([a-zA-Z_][a-zA-Z0-9_-]*) \\s*\n (:=)\n",
"end": "$",
Expand Down Expand Up @@ -260,7 +271,7 @@
"reserved-keywords": {
"patterns": [
{
"match": "^(alias|export|import|mod|set)\\s+",
"match": "^(alias|export|unexport|import|mod|set)\\s+",
"captures": {
"1": {
"name": "keyword.other.reserved.just"
Expand Down
8 changes: 7 additions & 1 deletion syntaxes/just.tmLanguage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ repository:

variable-assignment:
patterns:
- match: ^(unexport)\s+([a-zA-Z_][a-zA-Z0-9_-]*)
captures:
'1':
name: keyword.other.reserved.just
'2':
name: variable.other.just
- begin: |
(?x)
^
Expand Down Expand Up @@ -196,7 +202,7 @@ repository:

reserved-keywords:
patterns:
- match: "^(alias|export|import|mod|set)\\s+"
- match: "^(alias|export|unexport|import|mod|set)\\s+"
captures:
'1':
name: keyword.other.reserved.just
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/tests/variables/variables.just
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ bar := foo / "b"
# Exports

export RUST_BACKTRACE := "1"

unexport FOO
5 changes: 4 additions & 1 deletion syntaxes/tests/variables/variables.just.snap
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,8 @@
# ^ source.just string.quoted.double.just string.quoted.double.just
# ^ source.just string.quoted.double.just
# ^ source.just string.quoted.double.just
>
>unexport FOO
#^^^^^^^^ source.just keyword.other.reserved.just
# ^ source.just
# ^^^ source.just variable.other.just
>
Loading