mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
go: Add first-line pattern detection for executable Go scripts (#48913)
Add support for detecting Go files that can be executed directly via shebang-style comments (e.g., '// usr/bin/env go run "$0" "$@"; exit "$?"'). This allows Zed to recognize Go scripts with first-line comments containing 'go run' as executable Go files, similar to how other languages detect shebangs or mode lines. Reference: https://stackoverflow.com/q/7707178/1458343 Release Notes: - Improved: Go language detection now recognizes executable Go scripts with first-line 'go run' comments.
This commit is contained in:
parent
ee3f40fe25
commit
4f2a277a63
1 changed files with 1 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ name = "Go"
|
|||
grammar = "go"
|
||||
path_suffixes = ["go"]
|
||||
line_comments = ["// "]
|
||||
first_line_pattern = '^//.*\bgo run\b'
|
||||
autoclose_before = ";:.,=}])>"
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
|
|
|
|||
Loading…
Reference in a new issue