on master help sign in
Make shebangs optional, they don't make sense outside of scripts
commitf804ed3192600fcfd704f3613edde37bbba26050 authorBlaž Hrastnik <blaz@mxxn.io> dateTue 9 Nov 2021, 10:57 (5 years ago) parent41fc326
2 files changed+5−26
helix-core/src/syntax.rs+2−1 languages.toml+3−25
helix-core/src/syntax.rs+2−1
@@ -52,7 +52,8 @@ pub struct LanguageConfiguration {
5252 pub language_id: String,
5353 pub scope: String, // source.rust
5454 pub file_types: Vec<String>, // filename ends_with? <Gemfile, rb, etc>
55− pub shebangs: Vec<String>, // interpreter(s) associated with language
55+ #[serde(default)]
56+ pub shebangs: Vec<String>, // interpreter(s) associated with language
5657 pub roots: Vec<String>, // these indicate project roots <.git, Cargo.toml>
5758 pub comment_token: Option<String>,
5859
languages.toml+3−25
@@ -3,7 +3,6 @@ name = "rust"
33scope = "source.rust"
44injection-regex = "rust"
55file-types = ["rs"]
6−shebangs = []
76roots = []
87auto-format = true
98comment-token = "//"
@@ -18,7 +17,6 @@ name = "toml"
1817scope = "source.toml"
1918injection-regex = "toml"
2019file-types = ["toml"]
21−shebangs = []
2220roots = []
2321comment-token = "#"
2422
@@ -29,7 +27,6 @@ name = "protobuf"
2927scope = "source.proto"
3028injection-regex = "protobuf"
3129file-types = ["proto"]
32−shebangs = []
3330roots = []
3431comment-token = "//"
3532
@@ -40,7 +37,7 @@ name = "elixir"
4037scope = "source.elixir"
4138injection-regex = "elixir"
4239file-types = ["ex", "exs"]
43−shebangs = []
40+shebangs = ["elixir"]
4441roots = []
4542comment-token = "#"
4643
@@ -64,7 +61,6 @@ name = "json"
6461scope = "source.json"
6562injection-regex = "json"
6663file-types = ["json"]
67−shebangs = []
6864roots = []
6965
7066indent = { tab-width = 2, unit = " " }
@@ -74,7 +70,6 @@ name = "c"
7470scope = "source.c"
7571injection-regex = "c"
7672file-types = ["c"] # TODO: ["h"]
77−shebangs = []
7873roots = []
7974comment-token = "//"
8075
@@ -86,7 +81,6 @@ name = "cpp"
8681scope = "source.cpp"
8782injection-regex = "cpp"
8883file-types = ["cc", "hh", "cpp", "hpp", "h", "ipp", "tpp", "cxx", "hxx", "ixx", "txx", "ino"]
89−shebangs = []
9084roots = []
9185comment-token = "//"
9286
@@ -98,7 +92,6 @@ name = "c-sharp"
9892scope = "source.csharp"
9993injection-regex = "c-?sharp"
10094file-types = ["cs"]
101−shebangs = []
10295roots = []
10396comment-token = "//"
10497
@@ -109,7 +102,6 @@ name = "go"
109102scope = "source.go"
110103injection-regex = "go"
111104file-types = ["go"]
112−shebangs = []
113105roots = ["Gopkg.toml", "go.mod"]
114106auto-format = true
115107comment-token = "//"
@@ -123,7 +115,7 @@ name = "javascript"
123115scope = "source.js"
124116injection-regex = "^(js|javascript)$"
125117file-types = ["js", "mjs"]
126−shebangs = []
118+shebangs = ["node"]
127119roots = []
128120comment-token = "//"
129121# TODO: highlights-jsx, highlights-params
@@ -147,7 +139,6 @@ name = "tsx"
147139scope = "source.tsx"
148140injection-regex = "^(tsx)$" # |typescript
149141file-types = ["tsx"]
150−shebangs = []
151142roots = []
152143# TODO: highlights-jsx, highlights-params
153144
@@ -159,7 +150,6 @@ name = "css"
159150scope = "source.css"
160151injection-regex = "css"
161152file-types = ["css"]
162−shebangs = []
163153roots = []
164154
165155indent = { tab-width = 2, unit = " " }
@@ -169,7 +159,6 @@ name = "html"
169159scope = "text.html.basic"
170160injection-regex = "html"
171161file-types = ["html"]
172−shebangs = []
173162roots = []
174163
175164indent = { tab-width = 2, unit = " " }
@@ -238,7 +227,6 @@ name = "latex"
238227scope = "source.tex"
239228injection-regex = "tex"
240229file-types = ["tex"]
241−shebangs = []
242230roots = []
243231comment-token = "%"
244232
@@ -249,7 +237,6 @@ name = "julia"
249237scope = "source.julia"
250238injection-regex = "julia"
251239file-types = ["jl"]
252−shebangs = []
253240roots = []
254241comment-token = "#"
255242language-server = { command = "julia", args = [
@@ -275,7 +262,6 @@ name = "java"
275262scope = "source.java"
276263injection-regex = "java"
277264file-types = ["java"]
278−shebangs = []
279265roots = []
280266indent = { tab-width = 4, unit = " " }
281267
@@ -284,7 +270,6 @@ name = "ledger"
284270scope = "source.ledger"
285271injection-regex = "ledger"
286272file-types = ["ldg", "ledger", "journal"]
287−shebangs = []
288273roots = []
289274comment-token = ";"
290275indent = { tab-width = 4, unit = " " }
@@ -312,7 +297,7 @@ indent = { tab-width = 2, unit = " "}
312297name = "lua"
313298scope = "source.lua"
314299file-types = ["lua"]
315−shebangs = []
300+shebangs = ["lua"]
316301roots = []
317302comment-token = "--"
318303indent = { tab-width = 2, unit = " " }
@@ -322,7 +307,6 @@ name = "svelte"
322307scope = "source.svelte"
323308injection-regex = "svelte"
324309file-types = ["svelte"]
325−shebangs = []
326310roots = []
327311indent = { tab-width = 2, unit = " " }
328312language-server = { command = "svelteserver", args = ["--stdio"] }
@@ -333,7 +317,6 @@ name = "vue"
333317scope = "source.vue"
334318injection-regex = "vue"
335319file-types = ["vue"]
336−shebangs = []
337320roots = []
338321indent = { tab-width = 2, unit = " " }
339322
@@ -341,7 +324,6 @@ indent = { tab-width = 2, unit = " " }
341324name = "yaml"
342325scope = "source.yaml"
343326file-types = ["yml", "yaml"]
344−shebangs = []
345327roots = []
346328comment-token = "#"
347329indent = { tab-width = 2, unit = " " }
@@ -361,7 +343,6 @@ name = "zig"
361343scope = "source.zig"
362344injection-regex = "zig"
363345file-types = ["zig"]
364−shebangs = []
365346roots = ["build.zig"]
366347auto-format = true
367348comment-token = "//"
@@ -386,7 +367,6 @@ language-server = { command = "swipl", args = [
386367name = "tsq"
387368scope = "source.tsq"
388369file-types = ["scm"]
389−shebangs = []
390370roots = []
391371comment-token = ";"
392372indent = { tab-width = 2, unit = " " }
@@ -395,7 +375,6 @@ indent = { tab-width = 2, unit = " " }
395375name = "cmake"
396376scope = "source.cmake"
397377file-types = ["cmake", "CMakeLists.txt"]
398−shebangs = []
399378roots = []
400379comment-token = "#"
401380indent = { tab-width = 2, unit = " " }
@@ -405,7 +384,6 @@ language-server = { command = "cmake-language-server" }
405384name = "glsl"
406385scope = "source.glsl"
407386file-types = ["glsl", "vert", "tesc", "tese", "geom", "frag", "comp" ]
408−shebangs = []
409387roots = []
410388comment-token = "//"
411389indent = { tab-width = 4, unit = " " }