Skip to content

Commit d31fec9

Browse files
committed
Make PowerShell grammar suport
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
1 parent 866b377 commit d31fec9

File tree

10 files changed

+537
-0
lines changed

10 files changed

+537
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Zed generated files.
2+
/grammars
3+
/extension.wasm
4+
5+
# Rust generated files
6+
/target
7+
8+
# Test extension.
9+
/*.ps1

Cargo.lock

Lines changed: 322 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "powershell"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[lib]
7+
path = "src/powershell.rs"
8+
crate-type = ["cdylib"]
9+
10+
[dependencies]
11+
zed_extension_api = "0.0.6"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# PowerShell extension for Zed editor

extension.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
id = "powershell"
2+
name = "PowerShell"
3+
version = "0.0.1"
4+
schema_version = 1
5+
authors = ["Thanabodee Charoenpiriyakij <[email protected]>"]
6+
description = "PowerShell support"
7+
repository = "https://github.com/zed-industries/zed"
8+
9+
[grammars.powershell]
10+
repository = "https://github.com/airbus-cert/tree-sitter-powershell"
11+
commit = "804d86fd4ad286bd0cc1c1f0f7b28bd7af6755ad"

languages/powershell/brackets.scm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
("@(" @open ")" @close)
2+
("[" @open "]" @close)
3+
("{" @open "}" @close)
4+
("\"" @open "\"" @close)

languages/powershell/config.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name = "PowerShell"
2+
grammar = "powershell"
3+
path_suffixes = ["ps1"]
4+
line_comments = ["# "]
5+
# autoclose_before = ";:.,=}])>"
6+
brackets = [
7+
{ start = "{", end = "}", close = true, newline = true },
8+
{ start = "[", end = "]", close = true, newline = true },
9+
{ start = "(", end = ")", close = true, newline = true },
10+
{ start = "\"", end = "\"", close = true, newline = false, not_in = [
11+
"string",
12+
"comment",
13+
] },
14+
{ start = "'", end = "'", close = true, newline = false, not_in = [
15+
"string",
16+
"comment",
17+
] },
18+
]
19+
tab_size = 4
20+
# scope_opt_in_language_servers = ["tailwindcss-language-server"]
21+
22+
# [overrides.string]
23+
# word_characters = ["-"]
24+
# opt_into_language_servers = ["tailwindcss-language-server"]

0 commit comments

Comments
 (0)