Skip to content

VSC Extension JSON schema#9386

Merged
mischnic merged 2 commits into
v2from
vscode-extension-config-json-schema
Dec 5, 2023
Merged

VSC Extension JSON schema#9386
mischnic merged 2 commits into
v2from
vscode-extension-config-json-schema

Conversation

@mischnic

@mischnic mischnic commented Nov 15, 2023

Copy link
Copy Markdown
Member

Add autocomplete/popup descriptions/always-on schema validation for .parcelrc and package.json#targets

parcel-lsp-jsonschema.mov

Plus descriptions

Bildschirm­foto 2023-11-15 um 21 15 20

Two aspects that are suboptimal are (could be solved in the future with a custom LSP for the JSON as well):

  • No autocompletion for package names (which should in theory also be restricted to the parcel-{type}-* pattern)
  • You get two errors for invalid parcelrc/targets: one from Parcel and then a warning from the JSON schema.
Bildschirm­foto 2023-11-15 um 21 23 04

@celinanperalta celinanperalta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! nice addition

@mischnic mischnic merged commit 3045177 into v2 Dec 5, 2023
@mischnic mischnic deleted the vscode-extension-config-json-schema branch December 5, 2023 20:23
"type": "object",
"properties": {
"context": {
"description": "The context property defines what type of environment to build for. This tells Parcel what environment-specific APIs are available, e.g. the DOM, Node filesystem APIs.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this JSON duplicates what https://github.com/parcel-bundler/parcel/blob/9d6da2c/packages/core/core/src/TargetDescriptor.schema.js does, but descriptions seem novel.

I think if you add descriptions into TargetDescriptor.schema.js, you can just generate this file. (my script for generating json from TargetDescriptor.schema.js https://github.com/lukaw3d/parcel-bundler-json-schemas/blob/main/main.js)

@@ -0,0 +1,94 @@
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

4 participants