-
Notifications
You must be signed in to change notification settings - Fork 34
Add complete Java snippets pack for Zed (core Java + JUnit/Mockito + Spring/JPA + build tools) #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e5d98a6
b69c536
5e909d4
f3bd73e
97302c8
de4bb3a
c646c10
ead4a70
c5732e1
ce34e7e
3a3038c
86a2211
5fabae1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,11 @@ authors = [ | |
| "Valentine Briese <valentinegb@icloud.com>", | ||
| "Samuser107 L.Longheval <samuser107@gmail.com>", | ||
| "Yury Abykhodau <abehodau@gmail.com>", | ||
| "Keys <70819367+keys-i@users.noreply.github.com>" | ||
| ] | ||
| description = "Java support." | ||
| repository = "https://github.com/zed-extensions/java" | ||
| snippets = "./snippets/java.json" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How are other snippets (groovy, kotlin, xml) linked?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They aren’t linked via the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would that help here? I was bothered by that also a bit and could look into making this accept multiple paths finally
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think that would help here. If we can accept multiple snippet paths (or multiple packs) instead of forcing everything through a single JSON, it becomes much easier to keep “typed” vs “untyped / vendor” sources separated and avoid I’d genuinely love to help you make it multi-path and get it working end to end. If you can point me at where the config gets parsed and where the snippet loader resolves
and then merge the loaded snippets deterministically (with clear precedence rules). Happy to do the legwork and iterate with you on the design. |
||
|
|
||
| [grammars.java] | ||
| repository = "https://github.com/tree-sitter/tree-sitter-java" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| { | ||
| "Gradle (Groovy): Java library skeleton": { | ||
| "prefix": "gjava", | ||
| "body": [ | ||
| "plugins {", | ||
| " id 'java-library'", | ||
| "}", | ||
| "", | ||
| "group = '${1:com.example}'", | ||
| "version = '${2:0.1.0}'", | ||
| "", | ||
| "repositories {", | ||
| " mavenCentral()", | ||
| "}", | ||
| "", | ||
| "dependencies {", | ||
| " testImplementation 'org.junit.jupiter:junit-jupiter:${3:5.10.2}'", | ||
| " testImplementation 'org.mockito:mockito-core:${4:5.12.0}'", | ||
| " testImplementation 'org.assertj:assertj-core:${5:3.26.3}'", | ||
| "}", | ||
| "", | ||
| "test {", | ||
| " useJUnitPlatform()", | ||
| "}", | ||
| "" | ||
| ], | ||
| "description": "Gradle Groovy Java project template with JUnit/Mockito/AssertJ." | ||
| }, | ||
| "Gradle (Groovy): Spring Boot skeleton": { | ||
| "prefix": "gspring", | ||
| "body": [ | ||
| "plugins {", | ||
| " id 'java'", | ||
| " id 'org.springframework.boot' version '${1:3.3.5}'", | ||
| " id 'io.spring.dependency-management' version '${2:1.1.6}'", | ||
| "}", | ||
| "", | ||
| "group = '${3:com.example}'", | ||
| "version = '${4:0.1.0}'", | ||
| "", | ||
| "repositories {", | ||
| " mavenCentral()", | ||
| "}", | ||
| "", | ||
| "dependencies {", | ||
| " implementation 'org.springframework.boot:spring-boot-starter-web'", | ||
| " testImplementation 'org.springframework.boot:spring-boot-starter-test'", | ||
| "}", | ||
| "" | ||
| ], | ||
| "description": "Gradle Groovy Spring Boot template." | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not actually updating this field. We should consider to change it into a more inclusive
Java repo contributors, especially because by now, if everyone who has ever contributed added their name this list would be very long.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, since we’re not maintaining this field and an exhaustive list would grow indefinitely, I think we should make it inclusive and low-maintenance. Something like
authors = ["The <Repo/Project> contributors"](e.g., “The Deno authors”) works well and still gives credit broadly, while GitHub’s contributor history remains the source of truth for the full list.