From 678f0cb477ce6cb844ae0e4d3055918ae86ab32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9lio=20J=C3=BAnior?= <76992016+lunatic-fox@users.noreply.github.com> Date: Sat, 10 Dec 2022 07:58:13 -0300 Subject: [PATCH] add feature: vs code intellisense to `devicon.json` (#1487) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add VS Code Intellisense to `devicon.json` VS Code Intellisense provides these features: - A snippet to create a new input object by typing `new` - Validates - `name` structure - `color` structure - `version.svg[]`, `version.font[]`, `aliases.?base` and `aliases.?alias` completion - Provides some description for the properties based on the documentation * Fix name pattern and add `dot-net` exception * Update .vscode/devicon-schema.json Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com> * Update .vscode/devicon.code-snippets Great! Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com> * Update .vscode/devicon-schema.json Agreed! It's more detailed now! Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com> * Update .vscode/devicon-schema.json Great! Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com> Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com> --- .vscode/devicon-schema.json | 223 ++++++++++++++++++++++++++++ .vscode/devicon.code-snippets | 24 +++ .vscode/settings.json | 10 ++ .vscode/tags-enum.json | 267 ++++++++++++++++++++++++++++++++++ 4 files changed, 524 insertions(+) create mode 100644 .vscode/devicon-schema.json create mode 100644 .vscode/devicon.code-snippets create mode 100644 .vscode/settings.json create mode 100644 .vscode/tags-enum.json diff --git a/.vscode/devicon-schema.json b/.vscode/devicon-schema.json new file mode 100644 index 00000000..cdabb5c9 --- /dev/null +++ b/.vscode/devicon-schema.json @@ -0,0 +1,223 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "definitions": { + "IconVersions": { + "type": "string", + "enum": [ + "original", + "plain", + "line", + "original-wordmark", + "plain-wordmark", + "line-wordmark" + ] + }, + "IconVersionsArray": { + "type": "array", + "items": { + "$ref": "#/definitions/IconVersions" + } + } + }, + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "title": "The official name of the technology.", + "description": "Pattern: Only lower-case letters and digits.", + "pattern": "^(dot-net|[0-9a-z]+)$" + }, + "altnames": { + "type": "array", + "title": "List of alternative names for this technology.", + "description": "Used for the searchbar on the Devicon website. https://devicon.dev", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "title": "List of tags relating to the technology for categorization/search purpose.", + "$ref": "./tags-enum.json/#/definitions/Tags" + }, + "versions": { + "title": "Keeps track of the different versions that you have.", + "type": "object", + "additionalProperties": false, + "properties": { + "svg": { + "title": "List all the SVGs that you have.", + "contains": { + "$ref": "#/definitions/IconVersions" + }, + "minItems": 1, + "uniqueItems": true, + "$ref": "#/definitions/IconVersionsArray" + }, + "font": { + "title": "List only the SVGs that can be converted to fonts. Usually refers to \"plain\" and \"line\" versions but \"original\" can be accepted.", + "description": "DO NOT list aliases here! In this case use \"aliases\" property!", + "contains": { + "$ref": "#/definitions/IconVersions" + }, + "minItems": 1, + "uniqueItems": true, + "$ref": "#/definitions/IconVersionsArray" + } + } + }, + "color": { + "title": "The official/main hexadecimal color of the logo. [Case insensitive]", + "description": "Pattern example: #FFFFFF", + "type": "string", + "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" + }, + "aliases": { + "title": "Keeps track of the aliases for the font versions ONLY.", + "description": "Can be empty, or contain objects, each with an alias and a base version. More info here: https://github.com/devicons/devicon/wiki/Updating-%60devicon.json%60#aliases-and-aliasobj", + "type": "array", + "items": { + "title": "AliasObj, an object containing an alias and a base version", + "type": "object", + "additionalProperties": false, + "properties": { + "base": { + "title": "The SVG file you are using as source for the alias.", + "$ref": "#/definitions/IconVersions" + }, + "alias": { + "title": "The new name (alias) that you want to generate.", + "$ref": "#/definitions/IconVersions" + } + }, + "required": [ + "base", + "alias" + ], + "allOf": [ + { + "if": { + "properties": { + "base": { + "const": "original" + } + } + }, + "then": { + "not": { + "properties": { + "alias": { + "const": "original" + } + } + } + } + }, + { + "if": { + "properties": { + "base": { + "const": "plain" + } + } + }, + "then": { + "not": { + "properties": { + "alias": { + "const": "plain" + } + } + } + } + }, + { + "if": { + "properties": { + "base": { + "const": "line" + } + } + }, + "then": { + "not": { + "properties": { + "alias": { + "const": "line" + } + } + } + } + }, + { + "if": { + "properties": { + "base": { + "const": "original-wordmark" + } + } + }, + "then": { + "not": { + "properties": { + "alias": { + "const": "original-wordmark" + } + } + } + } + }, + { + "if": { + "properties": { + "base": { + "const": "plain-wordmark" + } + } + }, + "then": { + "not": { + "properties": { + "alias": { + "const": "plain-wordmark" + } + } + } + } + }, + { + "if": { + "properties": { + "base": { + "const": "line-wordmark" + } + } + }, + "then": { + "not": { + "properties": { + "alias": { + "const": "line-wordmark" + } + } + } + } + } + ] + } + } + }, + "required": [ + "name", + "altnames", + "tags", + "versions", + "color", + "aliases" + ] + } +} diff --git a/.vscode/devicon.code-snippets b/.vscode/devicon.code-snippets new file mode 100644 index 00000000..2da13047 --- /dev/null +++ b/.vscode/devicon.code-snippets @@ -0,0 +1,24 @@ +{ + "new entry": { + "scope": "json", + "prefix": "new", + "description": "Inserts the new entry template object. Use it ONLY in \"devicon.json\"!", + "body": [ + "{", + " \"name\": \"\",", + " \"altnames\": [],", + " \"tags\": [],", + " \"versions\": {", + " \"svg\": [", + " \"\"", + " ],", + " \"font\": [", + " \"\"", + " ]", + " },", + " \"color\": \"\",", + " \"aliases\": []", + "}," + ] + } +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..7eb64565 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "json.schemas": [ + { + "fileMatch": [ + "devicon.json" + ], + "url": "/.vscode/devicon-schema.json" + } + ] +} diff --git a/.vscode/tags-enum.json b/.vscode/tags-enum.json new file mode 100644 index 00000000..647f085d --- /dev/null +++ b/.vscode/tags-enum.json @@ -0,0 +1,267 @@ +{ + "definitions": { + "Tags": { + "type": "array", + "items": { + "type": "string", + "enum": [ + ".net", + "3d", + "ARM", + "C#", + "CMS", + "GNU", + "IDE", + "algorithms", + "analysis", + "analytics", + "android", + "animation", + "api", + "api_wrapper", + "app", + "apple", + "applets", + "application", + "architecture", + "arm", + "audio", + "auth", + "autodesk", + "automation", + "azure", + "blockchain", + "blog", + "brand", + "browser", + "build", + "c", + "c++", + "c-sharp", + "c/c++", + "cdn", + "chat", + "cli", + "cloud", + "cloud-computing-platform", + "cmdlets", + "cms", + "code quality", + "code-quality", + "code-review", + "coding-style", + "collaboration", + "command", + "command-line", + "company", + "compiler", + "computer", + "computer-vision", + "container", + "continuous-delivery", + "cplusplus", + "cpp", + "cross-platform", + "csharp", + "css", + "dashboard", + "data", + "data science", + "data-model", + "data-processing", + "data-science", + "data-transfer", + "database", + "db", + "deep-learning", + "deploy", + "deployment", + "design", + "desktop", + "development", + "devops", + "distribuition", + "dns", + "docker", + "documentation", + "dotnet", + "ecommerce", + "editor", + "elastic", + "engine", + "erc20", + "ethereum", + "file-format", + "format", + "framework", + "frontend", + "ftp", + "functional", + "game", + "game-engine", + "git", + "gitops", + "go", + "google", + "graph", + "graphic", + "graphics", + "hardware", + "heterogeneous-computing", + "hosting", + "html", + "http", + "hypervisor", + "iconset", + "ide", + "infrastructure", + "infrastructure-as-a-service", + "infrastructure-as-code", + "integration", + "ionic", + "ios", + "iphone", + "java", + "javascript", + "jetbrains", + "js", + "jupyter notebook", + "jvm", + "k3s", + "khronos", + "kotlin", + "kubernetes", + "language", + "laravel", + "latex2e", + "latex3", + "library", + "linter", + "linux", + "localization", + "logs", + "machine-learning", + "manager", + "markup", + "material-design", + "math", + "mel", + "mesh", + "message-broker", + "metrics", + "micro-framework", + "micro-services", + "microcontroller", + "microservices", + "mobile", + "modeling", + "modelling", + "monitoring", + "multimedia", + "networking", + "node.js", + "nodejs", + "nosql", + "note-taking", + "object-notation", + "object-oriented", + "object-relational mapper", + "observability", + "open-source", + "operating-system", + "orchestrator", + "organization", + "organize", + "orm", + "os", + "package", + "package-manager", + "performance", + "php", + "pipeline", + "platform", + "plotting", + "pods", + "pre-processor", + "procedural", + "production-tool", + "production-tracking", + "programming", + "project-management", + "promise", + "prototype-based", + "provisioning", + "proxy", + "pymel", + "python", + "query", + "rancher", + "reactjs", + "remote-development", + "rest", + "robotics", + "router", + "ruby", + "rust", + "scala", + "script", + "scripting", + "sdk", + "security", + "server", + "serverless", + "shell", + "social", + "software", + "specification", + "sql", + "ssg", + "ssh", + "standard", + "state-management", + "static site generator", + "static-site-generator", + "statistics", + "storage", + "streaming", + "svn", + "task-runner", + "telemetry", + "terminal", + "test-runner", + "testing", + "tex", + "text editor", + "tool", + "tracing", + "transpiler", + "typesetting-system", + "ui", + "universal", + "unix", + "vcs", + "vector", + "version", + "version control", + "version-control", + "vfx", + "video", + "visualization", + "vmware", + "vuejs", + "vuejs-library", + "web", + "web-application", + "web-development", + "web3", + "webdrive", + "website", + "websockets", + "wiki", + "windows", + "wrapper" + ] + } + } + } +}