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

"Generate Code" not working with httpyac.environmentVariables in VS Code Settings #221

Closed bohni closed 9 months ago

bohni commented 9 months ago

When defining variables in VS Code User Settings "Generate Code" does not work and instead shows a popup with message ReferenceError: userVariable is not defined at Object.userJS

User Settings or Workspace Settings (.vscode/settings.json )

{
    "httpyac.environmentVariables": {
        "$shared" : {
            "codeVariable": "codeVariable"
        }
    }
}

.httpyac.config.js

module.exports = {
    "environments": {
      "$shared": {
        "sharedVariable": "sharedVariable",
        "baseUrl": "http://httpbin.org/anything"
      }
    }
}

error.http

### Without VS Code User Settings
GET {{baseUrl}}?param={{sharedVariable}}

### With  VS Code User Settings
GET {{baseUrl}}?param={{codeVariable}}
AnWeber commented 9 months ago

fixed with v6.6.6

bohni commented 9 months ago

Thanks for those quick fixes! And for that great tool!

AnWeber commented 9 months ago

You are Welcome.