go.mod: allow no space before comment, do not allow double slash in unqouted string - #2424
Conversation
… in unqouted string
|
Thanks Caleb Doxsey (@calebdoxsey)! logan (@brainsnail) thoughts? |
|
Just loaded it up and tested out Caleb Doxsey (@calebdoxsey) changes. Looks good to me regarding the comment formatting after the keywords. I'm not super sure about the formatting for unmatched/invalid lines though. Here's an example where I just entered a line break prior to a matched The invalid or unmatched highlighting is a nice addition though once that tweak is made. Thanks again, Caleb Doxsey (@calebdoxsey)! |
|
logan (@brainsnail) I believe newlines are not allowed after the require keyword. It errors out: So I think the highlighting matches the behavior of the go mod parser. |
|
hello Ramya Rao (@ramya-rao-a) would you have time to have a look? |
|
thanks! |
|
Thanks Ramya Rao (@ramya-rao-a) |

I believe this will fix the issues identified in #2423 .
A space is no longer required after the directive, so both
require// this is now a commentand
require(should be matched.
Comments will also be detected within unquoted strings:
Which I believe replicates this line from the parser: https://github.com/golang/go/blob/master/src/cmd/go/internal/modfile/read.go#L546.
Finally anything unmatched is marked as invalid.