AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
237 stars 20 forks source link

Assertions are highlighted differently when JSON is present #187

Closed utybo closed 1 year ago

utybo commented 1 year ago

Hi! First, thanks for making httpYac, it's an amazing project :)

Given the following httpYac file:

### Request 1
POST https://httpbin.org/anything

?? status == 200

### Request 2
POST https://httpbin.org/anything

{
    "some": "json"
}

?? status == 200

### Request 3
POST https://httpbin.org/anything

someContent

?? status == 200

The assertion is highlighted incorrectly in "Request 2".

image

Despite having a body, request 3 is highlighted fine, so it seems that it's the braces {} that mess up the syntax highlighting. (Note that this is a purely visual bug, this is parsed and executed correctly by httpYac)

AnWeber commented 1 year ago

For syntax highlighting you still need to create your own http.tmLanguage.json, which is independent of the actual parsing. In this one it was not considered that ?? also terminates the JSON section. This is added with the next release.

AnWeber commented 1 year ago

thx for reporting:-)

utybo commented 1 year ago

Thank you for the quick fix! 👍🏻