GNU bug report logs -
#61923
30.0.50; go-ts-mode, multiline raw-string-literal wrong indentation
Previous Next
Reported by: Gleb Zakharov <snyssfx <at> posteo.net>
Date: Thu, 2 Mar 2023 22:21:01 UTC
Severity: normal
Found in version 30.0.50
Fixed in version 29.1
Done: Dmitry Gutov <dmitry <at> gutov.dev>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Gleb Zakharov <snyssfx <at> posteo.net>
> Date: Thu, 02 Mar 2023 17:16:34 +0000
>
> In Go, I sometimes work with code written in another language.
> I embed it into Go as string literals, for example, SQL code.
>
> When I type a multiline string, I notice that tree-sitter indents it by
> usual Go rules, but this feature should be turned off inside the string.
I don't think your conclusion is correct. This use case, and others
like it, are supposed to be handled by features that support multiple
major modes in the same buffer. Tweaking the language indentation
rules to cater for these quite specialized use cases is not TRT, IMO,
because it is likely to contradict what the majority of language users
want and expect.
So I agree we should support these use cases, just not by changing the
general indentation rules of the language inside strings.
This bug report was last modified 1 year and 179 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.