Closed Mango0x45 closed 2 months ago
Ok so after some investigation I noticed this:
(eglot-tempel--convert "CanonicalHeaderKey(${1:})")
; ((p 1 "CanonicalHeaderKey(" ")" q)
And that is clearly wrong; (p …)
doesn’t take a number as an argument.
Looking at this some more, I believe the issue is that the pattern ${1:}
matches this rule:
(placeholder (and "${" int ":" anything "}") `(num place -- `(p ,place ,num)))
looking at the grammer:
any ::= tabstop | placeholder | choice | variable | text
tabstop ::= '$' int | '${' int '}'
placeholder ::= '${' int ':' any '}'
choice ::= '${' int '|' text (',' text)* '|}'
variable ::= '$' var | '${' var }'
| '${' var ':' any '}'
| '${' var '/' regex '/' (format | text)+ '/' options '}'
format ::= '$' int | '${' int '}'
| '${' int ':' '/upcase' | '/downcase' | '/capitalize' '}'
| '${' int ':+' if '}'
| '${' int ':?' if ':' else '}'
| '${' int ':-' else '}' | '${' int ':' else '}'
regex ::= Regular Expression value (ctor-string)
options ::= Regular Expression option (ctor-options)
var ::= [_a-zA-Z] [_a-zA-Z0-9]*
int ::= [0-9]+
text ::= .*
if ::= text
else ::= text
it's technically possible, we get a place holder with an 'int' and 'any', 'any' could be text and text is '.*'
I just did not expect a place holder to be empty, I'll add a test with that snippet and work from there
Thanks for reporting
In
go-ts-mode
when running Eglot withgopls
as the language server, almost every expansion (functions that take parameters) cause an error of the form:I’m not really sure how to further debug this, such as to see what the snippet actually is.