Skip to content

Commit

Permalink
Mild support for double-quoted option values
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelblyons committed Mar 30, 2019
1 parent df24b9b commit 62470e5
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
15 changes: 15 additions & 0 deletions SSH Config.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,21 @@ contexts:
- include: tokens
- match: '\d+'
scope: constant.numeric.ssh_config
- match: \"
scope: punctuation.definition.string.begin.ssh_config
push:
- meta_scope: string.quoted.double.ssh_config
- match: \"
scope: punctuation.definition.string.end.ssh_config
pop: true
- match: \n|$
scope: invalid.illegal.ssh_config
pop: true
- include: tokens
- match: \*|\?
scope: constant.language.wildcard.ssh_config
- match: ','
scope: punctuation.separator.sequence.ssh_config
- match: '\S'
scope: string.unquoted.ssh_config
push:
Expand Down
5 changes: 5 additions & 0 deletions Tests/syntax_test.ssh_config
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ Host *
# ^^ keyword.declaration.host-alias
# ^ constant.language.wildcard
IdentityFile ~/.ssh/id_rsa
Ciphers "aes128-ctr,aes192-ctr,aes256-ctr"
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double
# ^ punctuation.definition.string.begin
# ^ punctuation.separator.sequence
# ^ punctuation.definition.string.end
UseKeychain yes
# ^^^^^^^^^ keyword.other
# ^^^ constant.language.boolean
Expand Down
18 changes: 18 additions & 0 deletions messages/2.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
v2.2.0 (2019-03-29)
===================

If you were missing autocomplete as you type, add a syntax-specific setting with this content (or add this key):

``` json
{
"auto_complete_selector": "text.ssh_config, text.sshd_config"
}
```

## SSH Config

- Meta scopes for blocks (`Host` and `Match`), conditionals, and options
- Support for `=` in option assignment
- Mild support for double-quoted option values
- Boolean-only options now complain about non-boolean values
- Highlight wildcards and commas in generic values
5 changes: 3 additions & 2 deletions messaging.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"2.0.0": "messages/2.0.0.md",
"2.1.0": "messages/2.1.0.md"
"2.2.0": "messages/2.2.0.md",
"2.1.0": "messages/2.1.0.md",
"2.0.0": "messages/2.0.0.md"
}

0 comments on commit 62470e5

Please sign in to comment.