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
222 stars 20 forks source link

Syntax highlighting issue with Intellij scripts when JSON body is used #220

Closed bratekarate closed 9 months ago

bratekarate commented 9 months ago

When using the VSCode extension, the following example HTTP file in Intellij format is not highlighted correctly in the editor:

### postStuff
POST {{my_url}} HTTP/1.1
Content-Type: application/json

{
    "my": "data"
}

> {%
    client.test("Request executed successfully", function() {
        client.assert(response.status === 200, "Response status is not 200");
    });
%}

Specifically the Intellij script is not colored correctly.

On the other hand, this works:

### postStuff
POST {{my_url}}
Content-Type: application/x-www-form-urlencoded

my=data

> {%
    client.test("Request executed successfully", function() {
        client.assert(response.status === 200, "Response status is not 200");
    });
%}
AnWeber commented 9 months ago

It seems this regex, does Not detect the start of the Intellij Script: https://github.com/AnWeber/vscode-httpyac/blob/main/syntaxes/http.tmLanguage.json#L564

AnWeber commented 9 months ago

Syntax highlighting works with next release

image