devcontainers / feature-starter

A bootstrap repo for self-authoring Dev Container Features
https://containers.dev
MIT License
277 stars 132 forks source link

add: feature json schema #33

Closed jarrodcolburn closed 1 year ago

jarrodcolburn commented 1 year ago

Without adding setting I am not getting type hints in VS Code when editing any devcontainer-feature.json files.

Adding the schema setting I DO get help...😃 Screen recording 2023-03-06 17 45 41

But without I get...😥 Screen recording 2023-03-06 17 46 08 ing the schema to the settings I get

Note: I'm not sure if the absence of schema for devcontainer-feature.json is something lacking in this template. Perhaps it's supposed to be implemented within one of the Remote Development VS Code Extensions. I do seem to be getting intelligence on devcontainer.json without using an explicit JSON schema setting this way.

samruddhikhandale commented 1 year ago

Interesting, I am getting VS Code hints for devcontainer-feature.json and I don't have any settings which should prompt me.

image

My environment -

Do you mind updating your VS Code and Dev container's extension? Thanks!

jarrodcolburn commented 1 year ago

I'm using VS Code web (via GitHub Codespace). I see the Dev Containers extension isn't installing. Screenshot 2023-03-07 20 47 10 Screen recording 2023-03-07 20 45 54

I understand that the Dev Container extension can't expose the full feature set in web. But as is, losing tab completion of devcontainer-feature.json when running inside a GitHub CodeSpace built with and to work on devcontainer-feature.json seemed like a Catch 22. Screenshot 2023-03-07 20 59 05

jarrodcolburn commented 1 year ago

@joshspicer thanks

A quick comment. While I sincerely appreciate you requesting

embed this schema into the GitHub Codespaces extension

I can think of a use VS Code Web use case this does not solve. Specifically... "Editing in VS Code Web, connected to a remote (non Github) code server/tunnel started with command code tunnel or code-server"

My suggestion, put the schema in one of Codespaces extension's dependencies, perhaps a dependency that all MS Remote extensions use.

I've never written a VS Code Extension, but I was looking at the package.json dependencies in the Codespaces extension's to look for the best culprit. The first four were ...

{
  "dependencies": {
    "@microsoft/dev-tunnels-connections": "^1.0.7329",
    "@microsoft/dev-tunnels-contracts": "^1.0.7329",
    "@microsoft/dev-tunnels-management": "^1.0.7329",
    "@microsoft/vscode-devcontainerjson-support": "0.280.0"
  }
}

...the fourth vscode-devcontainerjson-support looked promising, as it's name is pretty much the thing we need. But I think it's a private npm package so I think I myself am at the end of what I can see. But I'd greatly appreciate it if you'd make sure the json gets to the lowest level for people who use tunnels without Codespaces.

Thanks again