pfeiferj / vscode-hurl

Provides a vscode plugin for hurl.dev
Apache License 2.0
21 stars 5 forks source link

VSCode plugin doesn't render comments with a single # #15

Open pravic opened 1 month ago

pravic commented 1 month ago

Basically, this plugin requires one more symbol (whitespace or not) to render a line as a comment, even though the Hurl grammar is # ~[\n]* (note the * and not ?).

So, right now this (v1.3.2):

#
#
# comment
# 
##

is rendered as (note the whitespace):

image

cc #7

pravic commented 1 month ago

Does this plugin use https://github.com/kjuulh/tree-sitter-hurl as an actual syntax parser? Judging by https://github.com/pfeiferj/vscode-hurl/blob/main/tree-sitter-hurl.wasm.

upd: Nope, it uses https://github.com/pfeiferj/tree-sitter-hurl.

pravic commented 1 month ago

Ah, I see the problem.

https://github.com/kjuulh/tree-sitter-hurl/blob/781f62c09a64f99e4a05c06518de75d8a1cfe594/grammar.js#L110 uses .* and you use [^\n]+ in https://github.com/pfeiferj/tree-sitter-hurl/blob/ad705af8c44c737bdb965fc081329c50716d2d03/grammar.js#L418.

But it should be [^\n]* instead.