Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

c: Add runnable for main function (#18720)

Muhammad Talal Anwar2f7430af70b2
diff --git a/crates/languages/src/c/runnables.scm b/crates/languages/src/c/runnables.scm
new file mode 100644
index 00000000000..4eaf5f730e1
--- /dev/null
+++ b/crates/languages/src/c/runnables.scm
@@ -0,0 +1,10 @@
+; Tag the main function
+(
+ (function_definition
+ declarator: (function_declarator
+ declarator: (identifier) @run
+ )
+ ) @c-main
+ (#eq? @run "main")
+ (#set! tag c-main)
+)