Skip to content

[FEATURE REQUEST] Validate and add snippet to devicon.json in VS Code #1481

@lunatic-fox

Description

@lunatic-fox

I have searched through the issues and didn't find my problem.

  • Confirm

Problem

In devicon.json, we can sometimes miss a property or even get confused about the value that should be added.

Possible Solution

I think many users use VS Code or GitHub Codespaces. Also I got inspired by @BenSouchet comment in order to create a validator and a snippet for a new entry to devicon.json in VS Code.

This is the link to a branch with this proposed feature.

Feature overview

Once you start typing new on devicon.json the snippet suggestion is activated.
new-entry

Hitting Enter will create a template object with all required properties.
new-entry-json

The validator will be working, that's why some parts are underlined in yellow.
If you hover over some property it'll show a short description.

All descriptions were based on Updating devicon.json.
hover-properties

versions.svg, versions.font, aliases[].base and aliases[].alias show autocompletion suggestions with all possible icon versions.
auto-completion-suggestions

aliases[].base and aliases[].alias are suggested properties, because the objects of aliases are optional.
auto-completion-suggestions-properties

Validation

  • name - ^[0-9a-z-]+$
  • altnames[] - none
  • tags[] - tags-enum.json

    Needs to be standardized!

  • versions
    • .svg[] - icon versions
    • .font[] - icon versions
  • color - ^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$

    Can be standardized to six digits!

  • aliases[]
    • .?base - icon versions
    • .?alias - icon versions

Additional information

I made tags-enum.json just by grouping all existent tags in devicon.json develop branch with Node.js.

I think in a strategy of breaking tags by -, / and space in order to be just a set of single words. But I need opinions on that!

Metadata

Metadata

Assignees

No one assigned

    Labels

    devopsDevops/automation related enhancementsenhancementin-developThe fix/feature is present in `develop` branch but not merged into `master` yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions