├── .gitattributes ├── yarn.lock ├── assets └── extension-icon.png ├── .gitignore ├── .vscodeignore ├── snippets └── vsgui.json ├── .editorconfig ├── schemas ├── README.md └── tmlanguage.json ├── CHANGELOG.md ├── .vscode └── launch.json ├── syntaxes └── vgui.tmLanguage.json ├── vgui.configuration.json ├── .travis.yml ├── LICENSE ├── README.md └── package.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/extension-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/vscode-steam-vgui/develop/assets/extension-icon.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.vsix 3 | vsc-extension-quickstart.md 4 | .DS_Store 5 | *.log 6 | .local/** 7 | out/** 8 | dist/** 9 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | vsc-extension-quickstart.md 5 | .DS_Store 6 | *.log 7 | .local/** 8 | -------------------------------------------------------------------------------- /snippets/vsgui.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "prefix": "vgui-new-control", 4 | "description": "Creates a new VGUI Control Component.", 5 | "types": "vsgui", 6 | "body": [ 7 | "# TODO" 8 | ] 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | charset = utf-8 11 | indent_style = space 12 | indent_size = 2 -------------------------------------------------------------------------------- /schemas/README.md: -------------------------------------------------------------------------------- 1 | # JSON Schema for Textmate Grammar Definition 2 | 3 | > This is a json schema for textmate grammar definitions. 4 | > Can be used to get intellisense working when editing grammar definitions within visual studio code. 5 | 6 | The JSON schema is taken from [martinring/tmllanguage](https://github.com/martinring/tmlanguage). 7 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to the "vscode-steam-vgui" extension will be documented in this file. 3 | 4 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 5 | 6 | ## [0.0.1] - 2018-10-19 7 | ### Added 8 | - Initial relesae with support for `.layout` & `.res` VGUI syntax highlighting 9 | 10 | ### Changed 11 | - `No changes` 12 | 13 | ### Removed 14 | - `No removals` 15 | 16 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "runtimeExecutable": "${execPath}", 13 | "args": [ 14 | "--extensionDevelopmentPath=${workspaceFolder}" 15 | ] 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /syntaxes/vgui.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../schemas/tmlanguage.json", 3 | "name": "Steam VGUI", 4 | "patterns": [ 5 | { 6 | "include": "#keywords" 7 | }, 8 | { 9 | "include": "#strings" 10 | } 11 | ], 12 | "repository": { 13 | "keywords": { 14 | "patterns": [{ 15 | "name": "keyword.control.vgui", 16 | "match": "\\b(if|while|for|return)\\b" 17 | }] 18 | }, 19 | "strings": { 20 | "name": "string.quoted.double.vgui", 21 | "begin": "\"", 22 | "end": "\"", 23 | "patterns": [ 24 | { 25 | "name": "constant.character.escape.vgui", 26 | "match": "\\\\." 27 | } 28 | ] 29 | } 30 | }, 31 | "scopeName": "source.steam-vgui" 32 | } 33 | -------------------------------------------------------------------------------- /vgui.configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": "//", 5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments 6 | "blockComment": [ "/*", "*/" ] 7 | }, 8 | // symbols used as brackets 9 | "brackets": [ 10 | ["{", "}"], 11 | ["[", "]"], 12 | ["(", ")"] 13 | ], 14 | // symbols that are auto closed when typing 15 | "autoClosingPairs": [ 16 | ["{", "}"], 17 | ["[", "]"], 18 | ["(", ")"], 19 | ["\"", "\""], 20 | ["'", "'"] 21 | ], 22 | // symbols that that can be used to surround a selection 23 | "surroundingPairs": [ 24 | ["{", "}"], 25 | ["[", "]"], 26 | ["(", ")"], 27 | ["\"", "\""], 28 | ["'", "'"] 29 | ] 30 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "10" 4 | dist: trusty 5 | sudo: false 6 | 7 | cache: 8 | directories: 9 | - node_modules 10 | 11 | stages: 12 | - test 13 | - package 14 | - name: deploy 15 | if: branch = develop 16 | 17 | addons: 18 | apt: 19 | update: true 20 | sources: 21 | - sourceline: 'deb https://dl.yarnpkg.com/debian/ stable main' 22 | key_url: 'https://dl.yarnpkg.com/debian/pubkey.gpg' 23 | packages: yarn 24 | 25 | install: 26 | - yarn clean 27 | - yarn 28 | 29 | before_script: 30 | - yarn global add vsce 31 | 32 | jobs: 33 | include: 34 | - stage: test 35 | script: yarn ci:test 36 | - stage: package 37 | script: yarn ci:package 38 | - stage: deploy 39 | provider: script 40 | script: 41 | - yarn ci:package 42 | - yarn ci:publish 43 | on: 44 | branch: develop 45 | 46 | notifications: 47 | email: false 48 | slack: 49 | rooms: 50 | - 'pddstudio:VcFiW1hwvEHqbCwtBKA38Eh2' 51 | on_success: change 52 | on_failure: always 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 - Patrick Jung & Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Steam VGUI Syntax & Code Snippets 2 | 3 | > Syntax Highlighting & Code Snippets for Steam's [VGUI DSL](https://developer.valvesoftware.com/wiki/VGUI_Editing). 4 | 5 | [![Build Status](https://travis-ci.org/PDDStudio/vscode-steam-vgui.svg?branch=develop)](https://travis-ci.org/PDDStudio/vscode-steam-vgui) 6 | 7 | ## Introduction 8 | 9 | This extension is a port of the [language-steam-vgui](https://github.com/StaticRocket/language-steam-vgui) extension for [Atom](https://atom.io) with some adjustments. 10 | 11 | ## Ingormation About VGUI Editing 12 | 13 | The following excerpt is taken from [Valve's Developer Documentation](https://developer.valvesoftware.com/wiki/VGUI_Editing#Styles): 14 | 15 | > **Note:** 16 | > The information below is extracted from the Valve internal document on how to edit, so it may in some cases be wrong or reference tools that don't exist. 17 | 18 | To make a skin for Steam (post 2010 UI update), you need to take a copy of resource/styles/steam.styles file and copy it to skins//resource/styles/steam.styes. The existence of that file will make Steam put that skin as an option in the settings->interface dialog (Steam will need to be restarted for it to show). From there you can start editing. You can put new files or existing steam files you want to replace under your skins folder. Good luck! 19 | 20 | ## Features 21 | 22 | - Syntax Highlighting for `.layout`, `.res` files 23 | - _(Coming soon)_ Code Snippets for creating new GUI controls 24 | 25 | ## Known Issues 26 | 27 | None yet. You can checkout the issue section of this repository. 28 | Please report any bug or 29 | 30 | ## Special Thanks 31 | 32 | The extension icon uses resources from [mbtskoudsalg](https://mbtskoudsalg.com/explore/steam-icon-png/#1). 33 | 34 | ## Release Notes 35 | 36 | Users appreciate release notes as you update your extension. 37 | 38 | ### 0.0.1 39 | 40 | Initial release of `vscode-steam-vgui` 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-steam-vgui", 3 | "displayName": "VGUI Syntax Highlighting & Code Snippets", 4 | "description": "Syntax Highlighting and Code Snippets for VGUI (Steam's Client DSL)", 5 | "icon": "assets/extension-icon.png", 6 | "galleryBanner": { 7 | "color": "#2d323b", 8 | "theme": "dark" 9 | }, 10 | "version": "0.0.3", 11 | "license": "MIT", 12 | "publisher": "pddstudio", 13 | "author": { 14 | "name": "Patrick Jung", 15 | "email": "patrick.pddstudio@gmail.com" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/pddstudio/vscode-steam-vgui" 20 | }, 21 | "bugs": { 22 | "url": "https://github.com/pddstudio/vscode-steam-vgui/issues" 23 | }, 24 | "scripts": { 25 | "build": "echo 'No building required!'", 26 | "ci:package": "vsce package --yarn", 27 | "ci:test": "echo 'No tests provided!'", 28 | "preci:publish": "yarn clean && yarn version --patch", 29 | "ci:publish": "vsce publish --yarn -p ${CI_VSCE_ACCESS_TOKEN}", 30 | "publish": "vsce publish --yarn", 31 | "clean": "rm -rf *.vsix" 32 | }, 33 | "dependencies": {}, 34 | "devDependencies": {}, 35 | "engines": { 36 | "vscode": "^1.28.0" 37 | }, 38 | "categories": [ 39 | "Programming Languages", 40 | "Snippets" 41 | ], 42 | "contributes": { 43 | "languages": [ 44 | { 45 | "id": "vgui", 46 | "aliases": [ 47 | "Steam VGUI", 48 | "VGUI", 49 | "vgui" 50 | ], 51 | "extensions": [ 52 | ".res", 53 | ".layout", 54 | ".styles" 55 | ], 56 | "configuration": "./vgui.configuration.json" 57 | } 58 | ], 59 | "grammars": [ 60 | { 61 | "language": "vgui", 62 | "scopeName": "source.steam-vgui", 63 | "path": "./syntaxes/vgui.tmLanguage.json" 64 | } 65 | ], 66 | "snippets": [ 67 | { 68 | "language": "vsgui", 69 | "path": "./snippets/vgui.json" 70 | } 71 | ] 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /schemas/tmlanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "id": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 4 | "$ref": "#/definitions/root", 5 | "definitions": { 6 | "root": { 7 | "allOf": [ 8 | { "$ref": "#/definitions/grammar" }, 9 | { 10 | "type": "object", 11 | "properties": { 12 | "name": { "type": "string" }, 13 | "scopeName": { 14 | "description": "this should be a unique name for the grammar, following the convention of being a dot-separated name where each new (left-most) part specializes the name. Normally it would be a two-part name where the first is either text or source and the second is the name of the language or document type. But if you are specializing an existing type, you probably want to derive the name from the type you are specializing. For example Markdown is text.html.markdown and Ruby on Rails (rhtml files) is text.html.rails. The advantage of deriving it from (in this case) text.html is that everything which works in the text.html scope will also work in the text.html.«something» scope (but with a lower precedence than something specifically targeting text.html.«something»).", 15 | "type": "string", 16 | "pattern": "^(text|source)(\\.[\\w0-9-]+)+$" 17 | }, 18 | "foldingStartMarker": { 19 | "description": "regular expressions that lines (in the document) are matched against. If a line matches one of the patterns (but not both), it becomes a folding marker (see the foldings section for more info).", 20 | "type": "string" 21 | }, 22 | "foldingStopMarker": { 23 | "description": "regular expressions that lines (in the document) are matched against. If a line matches one of the patterns (but not both), it becomes a folding marker (see the foldings section for more info).", 24 | "type": "string" 25 | }, 26 | "fileTypes": { 27 | "description": "this is an array of file type extensions that the grammar should (by default) be used with. This is referenced when TextMate does not know what grammar to use for a file the user opens. If however the user selects a grammar from the language pop-up in the status bar, TextMate will remember that choice.", 28 | "type": "array", 29 | "items": { "type": "string" } 30 | }, 31 | "uuid": { "type": "string" }, 32 | "firstLineMatch": { "type": "string" } 33 | }, 34 | "required": ["scopeName"] 35 | } 36 | ] 37 | }, 38 | "grammar": { 39 | "type": "object", 40 | "properties": { 41 | "patterns": { 42 | "type": "array", 43 | "items": { "$ref": "#/definitions/pattern" }, 44 | "default": [ ] 45 | }, 46 | "repository": { 47 | "description": "a dictionary (i.e. key/value pairs) of rules which can be included from other places in the grammar. The key is the name of the rule and the value is the actual rule. Further explanation (and example) follow with the description of the include rule key.", 48 | "type": "object", 49 | "additionalProperties": { 50 | "$ref": "#/definitions/grammar" 51 | } 52 | } 53 | }, 54 | "required": [ 55 | "patterns" 56 | ] 57 | }, 58 | "captures": { 59 | "type": "object", 60 | "patternProperties": { 61 | "^[0-9]+$": { 62 | "type": "object", 63 | "properties": { 64 | "name": { "$ref": "#/definitions/name" }, 65 | "patterns": { 66 | "type": "array", 67 | "items": { "$ref": "#/definitions/pattern" }, 68 | "default": [ ] 69 | } 70 | }, 71 | "additionalProperties": false 72 | } 73 | }, 74 | "additionalProperties": false 75 | }, 76 | "pattern": { 77 | "type": "object", 78 | "properties": { 79 | "comment": { "type": "string" }, 80 | "disabled": { "type": "integer", "minimum": 0, "maximum": 1 }, 81 | "include": { 82 | "description": "this allows you to reference a different language, recursively reference the grammar itself or a rule declared in this file’s repository.", 83 | "type": "string" 84 | }, 85 | "match": { 86 | "description": "a regular expression which is used to identify the portion of text to which the name should be assigned. Example: '\\b(true|false)\\b'.", 87 | "type": "string" 88 | }, 89 | "name": { 90 | "description": "the name which gets assigned to the portion matched. This is used for styling and scope-specific settings and actions, which means it should generally be derived from one of the standard names.", 91 | "$ref": "#/definitions/name" 92 | }, 93 | "contentName": { 94 | "description": "this key is similar to the name key but only assigns the name to the text between what is matched by the begin/end patterns.", 95 | "$ref": "#/definitions/name" 96 | }, 97 | "begin": { 98 | "description": "these keys allow matches which span several lines and must both be mutually exclusive with the match key. Each is a regular expression pattern. begin is the pattern that starts the block and end is the pattern which ends the block. Captures from the begin pattern can be referenced in the end pattern by using normal regular expression back-references. This is often used with here-docs. A begin/end rule can have nested patterns using the patterns key.", 99 | "type": "string" 100 | }, 101 | "end": { 102 | "description": "these keys allow matches which span several lines and must both be mutually exclusive with the match key. Each is a regular expression pattern. begin is the pattern that starts the block and end is the pattern which ends the block. Captures from the begin pattern can be referenced in the end pattern by using normal regular expression back-references. This is often used with here-docs. A begin/end rule can have nested patterns using the patterns key.", 103 | "type": "string" 104 | }, 105 | "captures": { 106 | "description": "allows you to assign attributes to the captures of the match pattern. Using the captures key for a begin/end rule is short-hand for giving both beginCaptures and endCaptures with same values.", 107 | "$ref": "#/definitions/captures" 108 | }, 109 | "beginCaptures": { 110 | "description": "allows you to assign attributes to the captures of the begin pattern. Using the captures key for a begin/end rule is short-hand for giving both beginCaptures and endCaptures with same values.", 111 | "$ref": "#/definitions/captures" 112 | }, 113 | "endCaptures": { 114 | "description": "allows you to assign attributes to the captures of the end pattern. Using the captures key for a begin/end rule is short-hand for giving both beginCaptures and endCaptures with same values.", 115 | "$ref": "#/definitions/captures" 116 | }, 117 | "patterns": { 118 | "description": "applies to the region between the begin and end matches", 119 | "type": "array", 120 | "items": { "$ref": "#/definitions/pattern" }, 121 | "default": [ ] 122 | } 123 | }, 124 | "dependencies": { 125 | "begin": ["end"], 126 | "end": ["begin"], 127 | "contentName": ["begin","end"], 128 | "beginCaptures": ["begin","end"], 129 | "endCaptures": ["begin","end"], 130 | "patterns": ["begin","end"] 131 | } 132 | }, 133 | "name": { 134 | "anyOf": [ 135 | { 136 | "type": "string", 137 | "pattern": "^[\\w0-9]+(\\.[\\w0-9-]+)*$" 138 | }, 139 | { 140 | "type": "string", 141 | "enum": [ 142 | "comment", 143 | "comment.block", 144 | "comment.block.documentation", 145 | "comment.line", 146 | "comment.line.double-dash", 147 | "comment.line.double-slash", 148 | "comment.line.number-sign", 149 | "comment.line.percentage", 150 | "constant", 151 | "constant.character", 152 | "constant.character.escape", 153 | "constant.language", 154 | "constant.numeric", 155 | "constant.other", 156 | "constant.regexp", 157 | "constant.rgb-value", 158 | "constant.sha.git-rebase", 159 | "emphasis", 160 | "entity", 161 | "entity.name", 162 | "entity.name.class", 163 | "entity.name.function", 164 | "entity.name.method", 165 | "entity.name.section", 166 | "entity.name.selector", 167 | "entity.name.tag", 168 | "entity.name.type", 169 | "entity.other", 170 | "entity.other.attribute-name", 171 | "entity.other.inherited-class", 172 | "header", 173 | "invalid", 174 | "invalid.deprecated", 175 | "invalid.illegal", 176 | "keyword", 177 | "keyword.control", 178 | "keyword.control.less", 179 | "keyword.operator", 180 | "keyword.operator.new", 181 | "keyword.other", 182 | "keyword.other.unit", 183 | "markup", 184 | "markup.bold", 185 | "markup.changed", 186 | "markup.deleted", 187 | "markup.heading", 188 | "markup.inline.raw", 189 | "markup.inserted", 190 | "markup.italic", 191 | "markup.list", 192 | "markup.list.numbered", 193 | "markup.list.unnumbered", 194 | "markup.other", 195 | "markup.punctuation.list.beginning", 196 | "markup.punctuation.quote.beginning", 197 | "markup.quote", 198 | "markup.raw", 199 | "markup.underline", 200 | "markup.underline.link", 201 | "meta", 202 | "meta.cast", 203 | "meta.parameter.type.variable", 204 | "meta.preprocessor", 205 | "meta.preprocessor.numeric", 206 | "meta.preprocessor.string", 207 | "meta.return-type", 208 | "meta.selector", 209 | "meta.structure.dictionary.key.python", 210 | "meta.tag", 211 | "meta.type.annotation", 212 | "meta.type.name", 213 | "metatag.php", 214 | "storage", 215 | "storage.modifier", 216 | "storage.modifier.import.java", 217 | "storage.modifier.package.java", 218 | "storage.type", 219 | "storage.type.cs", 220 | "storage.type.java", 221 | "string", 222 | "string.html", 223 | "string.interpolated", 224 | "string.jade", 225 | "string.other", 226 | "string.quoted", 227 | "string.quoted.double", 228 | "string.quoted.other", 229 | "string.quoted.single", 230 | "string.quoted.triple", 231 | "string.regexp", 232 | "string.unquoted", 233 | "string.xml", 234 | "string.yaml", 235 | "strong", 236 | "support", 237 | "support.class", 238 | "support.constant", 239 | "support.function", 240 | "support.function.git-rebase", 241 | "support.other", 242 | "support.property-value", 243 | "support.type", 244 | "support.type.property-name", 245 | "support.type.property-name.css", 246 | "support.type.property-name.less", 247 | "support.type.property-name.scss", 248 | "support.variable", 249 | "variable", 250 | "variable.language", 251 | "variable.name", 252 | "variable.other", 253 | "variable.parameter" 254 | ] 255 | } 256 | ] 257 | } 258 | } 259 | } 260 | --------------------------------------------------------------------------------