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

"env" directory is not found anymore #198

Closed NiewView closed 1 year ago

NiewView commented 1 year ago

Hi,

it seems like since the latest release 6.4.5 the env directory is ignored. It does not mark the root of a project anymore (as described here https://httpyac.github.io/config/#project-root), nor do the environment files get included in the environment selection.

I have a repository, with an env dir like this without a package.json or .httpyac.json:

env/
├─ Test1.env
├─ Test2.env
Something.http

The enviroments Test1 and Test2 are not found: image

Even if I add a .httpyac.json like this there are no environments:

{
  "envDirName": "env"
}

only when I directly add them into the httpyac config files a environment is shown:

{
  "envDirName": "env",
  "environments": {
    "Hello": {
      "test": "kflads"
    }
  }
}

image

I guess it is a side-effect of the fix for #194

AnWeber commented 1 year ago

I overlooked that the search for the httpyac config files always returns a folder and that's why the fallthrough to the search for package.json and env files doesn't work. I have corrected it.

AnWeber commented 1 year ago

it is fixed with v6.4.6.

rishigharpuray-ag commented 1 year ago

.env files are still not being picked up correctly in v6.4.6 either (had the same issue with v6.4.5).

Root directory of my project has a /env folder which contains a local.env file (with a few variables). However, I am unable to switch to this config via the VSCode Environment selector menu.

However, v6.4.4 seems to be working fine.

AnWeber commented 1 year ago

@rishigharpuray-ag The env directory name is configurable. But unfortunately I have removed the fallback to 'env'. Workaround is currently to configure it manually. I will make an update tomorrow where I will add this back. I am also currently writing tests where I can mock the filesystem extensively and test the constellations for me. i thought they were already there.