GNU bug report logs -
#74461
[PATCH] Add go-work-ts-mode
Previous Next
Full log
Message #8 received at 74461 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 21 Nov 2024 07:49:35 -0300
> From: Gabriel Santos via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> I wrote a tree-sitter mode after founding there wasn't one for Go
> Workspace files. I'd like to say thanks to Randy Taylor on his work to
> the Go tree-sitter mode, helped me a lot in this process.
>
> Commit message:
>
> * admin/notes/tree-sitter/build-module/batch.sh:
> * admin/notes/tree-sitter/build-module/build.sh: Add go-work support.
> * etc/NEWS: Mention go-work-ts-mode.
> * lisp/progmodes/eglot.el (eglot-server-programs): Add go-work-ts-mode.
> * lisp/progmodes/go-ts-mode: Add go-work-ts-mode for working with
> workspace files.
>
> The parser can be found here:
> https://github.com/omertuc/tree-sitter-go-work
I think the parser URL should be mentioned in the comments in
go-ts-mode.el.
> I will mail my copyright assignment to the FSF still today.
Thanks.
> +---
> +** New major mode 'go-work-ts-mode'.
> +A major mode based on the tree-sitter library for editing "go.work"
> +files. It is auto-enabled for files which are named "go.work".
The last sentence is factually inaccurate: the user needs to load
go-ts-mode to have this mode auto-enabled, right?
> +(defun go-work-ts-mode--in-directive-p ()
> + "Return non-nil if point is inside a directive.
"inside a go-work directive", I presume? IOW, the doc string's first
sentence sounds too general.
> +(if (treesit-ready-p 'gowork)
> + (add-to-list 'auto-mode-alist '("/go\\.work\\'" . go-work-ts-mode)))
Wouldn't it be better to have this in the default value of
auto-mode-alist, just conditioned by (treesit-ready-p 'gowork) ? That
way, loading go-ts-mode will not change auto-mode-alist.
Stefan, WDYT?
This bug report was last modified 103 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.