Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: package.json support #2

Closed
bahrus opened this issue Oct 26, 2019 · 1 comment
Closed

Proposal: package.json support #2

bahrus opened this issue Oct 26, 2019 · 1 comment

Comments

@bahrus
Copy link

bahrus commented Oct 26, 2019

Extending this proposal:

Look for an entry in package.json called "customElements".

If the value is a string, first search for a file relative to the root of the package.

For example:

"customElements": "./custom-elements.json"

Also support searching for a folder:

"customElements": "./custom-elements/"

If it points to a folder, look for a file within that folder with name most closely aligned with the language preference. For example, for Algerian Arabic:

"custom-elements/custom-elements.ar-DZ.json"

If no match found, try:

"custom-elements/custom-elements.ar.json"

If that's not found, try:

"custom-elements/custom-elements.json"

If instead of a string, the value of custom elements is an array:

"customElements": ["./src/my-button/my-button.json", "./src/my-input/my-input.json"]

Apply the same rules as above, for each item

All these files would apply to HTML editing, incorporated into /web-data

@octref
Copy link
Contributor

octref commented Oct 29, 2019

The way this support would end up in VS Code is:

  • Dynamic Custom Data loading vscode#83594 happens
  • It becomes possible to write an extension that traverses node_modules, looking for packages that contain custom-elements.json, transform them into Custom Data format that VS Code can understand, then call the VS Code API to add additional tags for custom elements.

The data format wouldn't need to change for this proposal, so I'm closing.

@octref octref closed this as completed Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants