Skip to content
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

feat(lang): add go.mod and go.work support #2197

Merged
merged 6 commits into from
Apr 20, 2022

Conversation

ttys3
Copy link
Contributor

@ttys3 ttys3 commented Apr 20, 2022

add go.mod and go.work support

according to tree-sitter/tree-sitter-go tree-sitter/tree-sitter-go#42 (comment)

since go.mod and Go are two completely different languages, and some users may only care about Go, but not go.mod, I would prefer to just keep the go.mod grammar in its own repository.

so tree-sitter-go will not add go.mod and go.work support. we need add this standalone.

❯ hx --health gomod   
Configured language server: gopls
Binary for language server: /home/ttys3/go/bin/gopls
Configured debug adapter: None
Highlight queries: ✔
Textobject queries: ✘
Indent queries: ✘
❯ hx --health gowork
Configured language server: gopls
Binary for language server: /home/ttys3/go/bin/gopls
Configured debug adapter: None
Highlight queries: ✔
Textobject queries: ✘
Indent queries: ✘

go.mod demo:
image

go.mod diagnostic demo:

image


go.work demo:

image

go.work diagnostic demo:
image

@ttys3 ttys3 force-pushed the ts-gomod-gowork branch from ea5aa74 to 89260c2 Compare April 20, 2022 15:04
@the-mikedavis
Copy link
Member

Can you commit the results of cargo xtask docgen? It adds these to the language support docs.

@ttys3
Copy link
Contributor Author

ttys3 commented Apr 20, 2022

cargo xtask docgen done

@ttys3
Copy link
Contributor Author

ttys3 commented Apr 20, 2022

And I also add go.work demo screenshot and go.work diagnostic demo screenshot

@ttys3 ttys3 requested a review from the-mikedavis April 20, 2022 15:33
@the-mikedavis
Copy link
Member

Oh whoops I made a typo in my suggestion 😅

 ((comment) @language.content
- (#set! injection.langauge "comment"))
+ (#set! injection.language "comment"))

@ttys3 ttys3 force-pushed the ts-gomod-gowork branch from 9261bc3 to f7de73f Compare April 20, 2022 16:05
@the-mikedavis the-mikedavis merged commit 4144c9d into helix-editor:master Apr 20, 2022
@ttys3 ttys3 deleted the ts-gomod-gowork branch April 23, 2022 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants