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

Executed twice of one region #280

Closed slackwareer closed 2 months ago

slackwareer commented 2 months ago

A region with only JavaScript code(has no request) executed twice.

{{+
    console.log('A');
}}

### 1
{{
    console.log('B');
}}

When region1 is executed ,it print two B.

image It's confusing me so mush....

AnWeber commented 2 months ago

The mistake is funny. When parsing, I assign the same Id js to both scripts. The initial thought was that nobody has the same element in a range. However, the + pushes it into the same processing chain. Actually no problem, because I actually make sure that they still have a unique idea, except for this case. Too bad. Both end up in a map with the same ID and the second script overwrites the first. Fixed by forcing a unique id in this case as well.

slackwareer commented 2 months ago

The mistake is funny. When parsing, I assign the same Id js to both scripts. The initial thought was that nobody has the same element in a range. However, the + pushes it into the same processing chain. Actually no problem, because I actually make sure that they still have a unique idea, except for this case. Too bad. Both end up in a map with the same ID and the second script overwrites the first. Fixed by forcing a unique id in this case as well.

Appreciate for you efficiency o( ̄▽ ̄)d