Archived
1
0

Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'

This commit is contained in:
Joe Previte
2020-12-15 15:52:33 -07:00
4649 changed files with 1311795 additions and 0 deletions

View File

@ -0,0 +1,2 @@
test/**
cgmanifest.json

View File

@ -0,0 +1,17 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "mmims/language-batchfile",
"repositoryUrl": "https://github.com/mmims/language-batchfile",
"commitHash": "95ea8c699f7a8296b15767069868532d52631c46"
}
},
"license": "MIT",
"version": "0.7.5"
}
],
"version": 1
}

View File

@ -0,0 +1,29 @@
{
"comments": {
"lineComment": "@REM"
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
{ "open": "\"", "close": "\"", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["%", "%"],
["\"", "\""]
],
"folding": {
"markers": {
"start": "^\\s*(::|REM|@REM)\\s*#region",
"end": "^\\s*(::|REM|@REM)\\s*#endregion"
}
}
}

View File

@ -0,0 +1,29 @@
{
"name": "bat",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": { "vscode": "*" },
"scripts": {
"update-grammar": "node ../../build/npm/update-grammar.js mmims/language-batchfile grammars/batchfile.cson ./syntaxes/batchfile.tmLanguage.json"
},
"contributes": {
"languages": [{
"id": "bat",
"extensions": [ ".bat", ".cmd"],
"aliases": [ "Batch", "bat" ],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "bat",
"scopeName": "source.batchfile",
"path": "./syntaxes/batchfile.tmLanguage.json"
}],
"snippets": [{
"language": "bat",
"path": "./snippets/batchfile.code-snippets"
}]
}
}

View File

@ -0,0 +1,4 @@
{
"displayName": "Windows Bat Language Basics",
"description": "Provides snippets, syntax highlighting, bracket matching and folding in Windows batch files."
}

View File

@ -0,0 +1,16 @@
{
"Region Start": {
"prefix": "#region",
"body": [
"::#region"
],
"description": "Folding Region Start"
},
"Region End": {
"prefix": "#endregion",
"body": [
"::#endregion"
],
"description": "Folding Region End"
}
}

View File

@ -0,0 +1,738 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/mmims/language-batchfile/blob/master/grammars/batchfile.cson",
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/mmims/language-batchfile/commit/95ea8c699f7a8296b15767069868532d52631c46",
"name": "Batch File",
"scopeName": "source.batchfile",
"patterns": [
{
"include": "#commands"
},
{
"include": "#comments"
},
{
"include": "#constants"
},
{
"include": "#controls"
},
{
"include": "#escaped_characters"
},
{
"include": "#labels"
},
{
"include": "#numbers"
},
{
"include": "#operators"
},
{
"include": "#parens"
},
{
"include": "#strings"
},
{
"include": "#variables"
}
],
"repository": {
"commands": {
"patterns": [
{
"match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|scp|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|ssh|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)",
"name": "keyword.command.batchfile"
},
{
"begin": "(?i)(?<=^|[\\s@])(echo)(?:(?=$|\\.|:)|\\s+(?:(on|off)(?=\\s*$))?)",
"beginCaptures": {
"1": {
"name": "keyword.command.batchfile"
},
"2": {
"name": "keyword.other.special-method.batchfile"
}
},
"end": "(?=$\\n|[&|><)])",
"patterns": [
{
"include": "#escaped_characters"
},
{
"include": "#variables"
},
{
"include": "#numbers"
},
{
"include": "#strings"
}
]
},
{
"match": "(?i)(?<=^|[\\s@])(setlocal)(?:\\s*$|\\s+(EnableExtensions|DisableExtensions|EnableDelayedExpansion|DisableDelayedExpansion)(?=\\s*$))",
"captures": {
"1": {
"name": "keyword.command.batchfile"
},
"2": {
"name": "keyword.other.special-method.batchfile"
}
}
},
{
"include": "#command_set"
}
]
},
"command_set": {
"patterns": [
{
"begin": "(?<=^|[\\s@])(?i:SET)(?=$|\\s)",
"beginCaptures": {
"0": {
"name": "keyword.command.batchfile"
}
},
"end": "(?=$\\n|[&|><)])",
"patterns": [
{
"include": "#command_set_inside"
}
]
}
]
},
"command_set_inside": {
"patterns": [
{
"include": "#escaped_characters"
},
{
"include": "#variables"
},
{
"include": "#numbers"
},
{
"include": "#parens"
},
{
"include": "#command_set_strings"
},
{
"include": "#strings"
},
{
"begin": "([^ ][^=]*)(=)",
"beginCaptures": {
"1": {
"name": "variable.other.readwrite.batchfile"
},
"2": {
"name": "keyword.operator.assignment.batchfile"
}
},
"end": "(?=$\\n|[&|><)])",
"patterns": [
{
"include": "#escaped_characters"
},
{
"include": "#variables"
},
{
"include": "#numbers"
},
{
"include": "#parens"
},
{
"include": "#strings"
}
]
},
{
"begin": "\\s+/[aA]\\s+",
"end": "(?=$\\n|[&|><)])",
"name": "meta.expression.set.batchfile",
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.batchfile"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.batchfile"
}
},
"name": "string.quoted.double.batchfile",
"patterns": [
{
"include": "#command_set_inside_arithmetic"
},
{
"include": "#command_set_group"
},
{
"include": "#variables"
}
]
},
{
"include": "#command_set_inside_arithmetic"
},
{
"include": "#command_set_group"
}
]
},
{
"begin": "\\s+/[pP]\\s+",
"end": "(?=$\\n|[&|><)])",
"patterns": [
{
"include": "#command_set_strings"
},
{
"begin": "([^ ][^=]*)(=)",
"beginCaptures": {
"1": {
"name": "variable.other.readwrite.batchfile"
},
"2": {
"name": "keyword.operator.assignment.batchfile"
}
},
"end": "(?=$\\n|[&|><)])",
"name": "meta.prompt.set.batchfile",
"patterns": [
{
"include": "#strings"
}
]
}
]
}
]
},
"command_set_group": {
"patterns": [
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.batchfile"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.batchfile"
}
},
"patterns": [
{
"include": "#command_set_inside_arithmetic"
}
]
}
]
},
"command_set_inside_arithmetic": {
"patterns": [
{
"include": "#command_set_operators"
},
{
"include": "#numbers"
},
{
"match": ",",
"name": "punctuation.separator.batchfile"
}
]
},
"command_set_operators": {
"patterns": [
{
"match": "([^ ]*)(\\+\\=|\\-\\=|\\*\\=|\\/\\=|%%\\=|&\\=|\\|\\=|\\^\\=|<<\\=|>>\\=)",
"captures": {
"1": {
"name": "variable.other.readwrite.batchfile"
},
"2": {
"name": "keyword.operator.assignment.augmented.batchfile"
}
}
},
{
"match": "\\+|\\-|/|\\*|%%|\\||&|\\^|<<|>>|~",
"name": "keyword.operator.arithmetic.batchfile"
},
{
"match": "!",
"name": "keyword.operator.logical.batchfile"
},
{
"match": "([^ ][^=]*)(=)",
"captures": {
"1": {
"name": "variable.other.readwrite.batchfile"
},
"2": {
"name": "keyword.operator.assignment.batchfile"
}
}
}
]
},
"command_set_strings": {
"patterns": [
{
"begin": "(\")\\s*([^ ][^=]*)(=)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.batchfile"
},
"2": {
"name": "variable.other.readwrite.batchfile"
},
"3": {
"name": "keyword.operator.assignment.batchfile"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.batchfile"
}
},
"name": "string.quoted.double.batchfile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#numbers"
},
{
"include": "#escaped_characters"
}
]
}
]
},
"comments": {
"patterns": [
{
"begin": "(?:^|(&))\\s*(?=((?::[+=,;: ])))",
"beginCaptures": {
"1": {
"name": "keyword.operator.conditional.batchfile"
}
},
"end": "\\n",
"patterns": [
{
"begin": "((?::[+=,;: ]))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.batchfile"
}
},
"end": "(?=\\n)",
"name": "comment.line.colon.batchfile"
}
]
},
{
"begin": "(?<=^|[\\s@])(?i)(REM)(\\.)",
"beginCaptures": {
"1": {
"name": "keyword.command.rem.batchfile"
},
"2": {
"name": "punctuation.separator.batchfile"
}
},
"end": "(?=$\\n|[&|><)])",
"name": "comment.line.rem.batchfile"
},
{
"begin": "(?<=^|[\\s@])(?i:rem)\\b",
"beginCaptures": {
"0": {
"name": "keyword.command.rem.batchfile"
}
},
"end": "\\n",
"name": "comment.line.rem.batchfile",
"patterns": [
{
"match": "[><|]",
"name": "invalid.illegal.unexpected-character.batchfile"
}
]
}
]
},
"constants": {
"patterns": [
{
"match": "\\b(?i:NUL)\\b",
"name": "constant.language.batchfile"
}
]
},
"controls": {
"patterns": [
{
"match": "(?i)(?<=^|\\s)(?:call|exit(?=$|\\s)|goto(?=$|\\s|:))",
"name": "keyword.control.statement.batchfile"
},
{
"match": "(?<=^|\\s)(?i)(if)\\s+(?:(not)\\s+)?(exist|defined|errorlevel|cmdextversion)(?=\\s)",
"captures": {
"1": {
"name": "keyword.control.conditional.batchfile"
},
"2": {
"name": "keyword.operator.logical.batchfile"
},
"3": {
"name": "keyword.other.special-method.batchfile"
}
}
},
{
"match": "(?<=^|\\s)(?i)(?:if|else)(?=$|\\s)",
"name": "keyword.control.conditional.batchfile"
},
{
"match": "(?<=^|\\s)(?i)for(?=\\s)",
"name": "keyword.control.repeat.batchfile"
}
]
},
"escaped_characters": {
"patterns": [
{
"match": "%%|\\^\\^!|\\^(?=.)|\\^\\n",
"name": "constant.character.escape.batchfile"
}
]
},
"labels": {
"patterns": [
{
"match": "(?i)(?:^\\s*|(?<=goto)\\s*)(:)([^+=,;:\\s].*)$",
"captures": {
"1": {
"name": "punctuation.separator.batchfile"
},
"2": {
"name": "keyword.other.special-method.batchfile"
}
}
}
]
},
"numbers": {
"patterns": [
{
"match": "(?<=^|\\s|=)(0[xX][0-9A-Fa-f]*|[+-]?\\d+)(?=$|\\s|<|>)",
"name": "constant.numeric.batchfile"
}
]
},
"operators": {
"patterns": [
{
"match": "@(?=\\S)",
"name": "keyword.operator.at.batchfile"
},
{
"match": "(?<=\\s)(?i:EQU|NEQ|LSS|LEQ|GTR|GEQ)(?=\\s)|==",
"name": "keyword.operator.comparison.batchfile"
},
{
"match": "(?<=\\s)(?i)(NOT)(?=\\s)",
"name": "keyword.operator.logical.batchfile"
},
{
"match": "(?<!\\^)&&?|\\|\\|",
"name": "keyword.operator.conditional.batchfile"
},
{
"match": "(?<!\\^)\\|",
"name": "keyword.operator.pipe.batchfile"
},
{
"match": "<&?|>[&>]?",
"name": "keyword.operator.redirection.batchfile"
}
]
},
"parens": {
"patterns": [
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.group.begin.batchfile"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.group.end.batchfile"
}
},
"name": "meta.group.batchfile",
"patterns": [
{
"match": ",|;",
"name": "punctuation.separator.batchfile"
},
{
"include": "$self"
}
]
}
]
},
"strings": {
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.batchfile"
}
},
"end": "(\")|(\\n)",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.batchfile"
},
"2": {
"name": "invalid.illegal.newline.batchfile"
}
},
"name": "string.quoted.double.batchfile",
"patterns": [
{
"match": "%%",
"name": "constant.character.escape.batchfile"
},
{
"include": "#variables"
}
]
}
]
},
"variables": {
"patterns": [
{
"match": "(%)((~([fdpnxsatz]|\\$PATH:)*)?\\d|\\*)",
"captures": {
"1": {
"name": "punctuation.definition.variable.batchfile"
},
"2": {
"name": "variable.parameter.batchfile"
}
}
},
{
"include": "#variable"
},
{
"include": "#variable_delayed_expansion"
}
]
},
"variable": {
"patterns": [
{
"begin": "%(?=[^%]+%)",
"beginCaptures": {
"0": {
"name": "punctuation.definition.variable.begin.batchfile"
}
},
"end": "(%)|\\n",
"endCaptures": {
"1": {
"name": "punctuation.definition.variable.end.batchfile"
}
},
"name": "variable.other.readwrite.batchfile",
"patterns": [
{
"begin": ":~",
"beginCaptures": {
"0": {
"name": "punctuation.separator.batchfile"
}
},
"end": "(?=%|\\n)",
"name": "meta.variable.substring.batchfile",
"patterns": [
{
"include": "#variable_substring"
}
]
},
{
"begin": ":",
"beginCaptures": {
"0": {
"name": "punctuation.separator.batchfile"
}
},
"end": "(?=%|\\n)",
"name": "meta.variable.substitution.batchfile",
"patterns": [
{
"include": "#variable_replace"
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "punctuation.separator.batchfile"
}
},
"end": "(?=%|\\n)",
"patterns": [
{
"include": "#variable_delayed_expansion"
},
{
"match": "[^%]+",
"name": "string.unquoted.batchfile"
}
]
}
]
}
]
}
]
},
"variable_delayed_expansion": {
"patterns": [
{
"begin": "!(?=[^!]+!)",
"beginCaptures": {
"0": {
"name": "punctuation.definition.variable.begin.batchfile"
}
},
"end": "(!)|\\n",
"endCaptures": {
"1": {
"name": "punctuation.definition.variable.end.batchfile"
}
},
"name": "variable.other.readwrite.batchfile",
"patterns": [
{
"begin": ":~",
"beginCaptures": {
"0": {
"name": "punctuation.separator.batchfile"
}
},
"end": "(?=!|\\n)",
"name": "meta.variable.substring.batchfile",
"patterns": [
{
"include": "#variable_substring"
}
]
},
{
"begin": ":",
"beginCaptures": {
"0": {
"name": "punctuation.separator.batchfile"
}
},
"end": "(?=!|\\n)",
"name": "meta.variable.substitution.batchfile",
"patterns": [
{
"include": "#escaped_characters"
},
{
"include": "#variable_replace"
},
{
"include": "#variable"
},
{
"begin": "=",
"beginCaptures": {
"0": {
"name": "punctuation.separator.batchfile"
}
},
"end": "(?=!|\\n)",
"patterns": [
{
"include": "#variable"
},
{
"match": "[^!]+",
"name": "string.unquoted.batchfile"
}
]
}
]
}
]
}
]
},
"variable_replace": {
"patterns": [
{
"match": "[^=%!\\n]+",
"name": "string.unquoted.batchfile"
}
]
},
"variable_substring": {
"patterns": [
{
"match": "([+-]?\\d+)(?:(,)([+-]?\\d+))?",
"captures": {
"1": {
"name": "constant.numeric.batchfile"
},
"2": {
"name": "punctuation.separator.batchfile"
},
"3": {
"name": "constant.numeric.batchfile"
}
}
}
]
}
}
}

View File

@ -0,0 +1,24 @@
@echo off
setlocal
title VSCode Dev
pushd %~dp0\..
:: Node modules
if not exist node_modules call .\scripts\npm.bat install
:: Get electron
node .\node_modules\gulp\bin\gulp.js electron
:: Build
if not exist out node .\node_modules\gulp\bin\gulp.js compile
:: Configuration
set NODE_ENV=development
call echo %%LINE:rem +=%%
popd
endlocal

View File

@ -0,0 +1,541 @@
[
{
"c": "@",
"t": "source.batchfile keyword.operator.at.batchfile",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": "echo",
"t": "source.batchfile keyword.command.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "off",
"t": "source.batchfile keyword.other.special-method.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": "setlocal",
"t": "source.batchfile keyword.command.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": "title",
"t": "source.batchfile keyword.command.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": " VSCode Dev",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "pushd",
"t": "source.batchfile keyword.command.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "%",
"t": "source.batchfile punctuation.definition.variable.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "~dp0",
"t": "source.batchfile variable.parameter.batchfile",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": "\\..",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "::",
"t": "source.batchfile comment.line.colon.batchfile punctuation.definition.comment.batchfile",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " Node modules",
"t": "source.batchfile comment.line.colon.batchfile",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "if",
"t": "source.batchfile keyword.control.conditional.batchfile",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "not",
"t": "source.batchfile keyword.operator.logical.batchfile",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "exist",
"t": "source.batchfile keyword.other.special-method.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": " node_modules ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "call",
"t": "source.batchfile keyword.control.statement.batchfile",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " .\\scripts\\npm.bat install",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "::",
"t": "source.batchfile comment.line.colon.batchfile punctuation.definition.comment.batchfile",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " Get electron",
"t": "source.batchfile comment.line.colon.batchfile",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "node .\\node_modules\\gulp\\bin\\gulp.js electron",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "::",
"t": "source.batchfile comment.line.colon.batchfile punctuation.definition.comment.batchfile",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " Build",
"t": "source.batchfile comment.line.colon.batchfile",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "if",
"t": "source.batchfile keyword.control.conditional.batchfile",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "not",
"t": "source.batchfile keyword.operator.logical.batchfile",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "exist",
"t": "source.batchfile keyword.other.special-method.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": " out node .\\node_modules\\gulp\\bin\\gulp.js compile",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "::",
"t": "source.batchfile comment.line.colon.batchfile punctuation.definition.comment.batchfile",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " Configuration",
"t": "source.batchfile comment.line.colon.batchfile",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "set",
"t": "source.batchfile keyword.command.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "NODE_ENV",
"t": "source.batchfile variable.other.readwrite.batchfile",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": "=",
"t": "source.batchfile keyword.operator.assignment.batchfile",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": "development",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "call",
"t": "source.batchfile keyword.control.statement.batchfile",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "echo",
"t": "source.batchfile keyword.command.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": " ",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "%%",
"t": "source.batchfile constant.character.escape.batchfile",
"r": {
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "constant.character: #569CD6"
}
},
{
"c": "LINE:rem +=",
"t": "source.batchfile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "%%",
"t": "source.batchfile constant.character.escape.batchfile",
"r": {
"dark_plus": "constant.character.escape: #D7BA7D",
"light_plus": "constant.character.escape: #EE0000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "constant.character: #569CD6"
}
},
{
"c": "popd",
"t": "source.batchfile keyword.command.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
},
{
"c": "endlocal",
"t": "source.batchfile keyword.command.batchfile",
"r": {
"dark_plus": "keyword: #569CD6",
"light_plus": "keyword: #0000FF",
"dark_vs": "keyword: #569CD6",
"light_vs": "keyword: #0000FF",
"hc_black": "keyword: #569CD6"
}
}
]

View File

@ -0,0 +1,18 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "typescript",
"repositoryUrl": "https://github.com/microsoft/TypeScript",
"commitHash": "54426a14f4c232da8e563d20ca8e71263e1c96b5"
}
},
"isOnlyProductionDependency": true,
"license": "Apache-2.0",
"version": "2.6.2"
}
],
"version": 1
}

View File

@ -0,0 +1,2 @@
test/**
cgmanifest.json

View File

@ -0,0 +1,18 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "atom/language-clojure",
"repositoryUrl": "https://github.com/atom/language-clojure",
"commitHash": "de877502aa4a77ccdc2c7f0c9180436aea3effff"
}
},
"license": "MIT",
"version": "0.22.7",
"description": "The file syntaxes/clojure.tmLanguage.json was derived from the Atom package https://github.com/atom/language-clojure which was originally converted from the TextMate bundle https://github.com/mmcgrana/textmate-clojure."
}
],
"version": 1
}

View File

@ -0,0 +1,25 @@
{
"comments": {
"lineComment": ";"
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
{ "open": "\"", "close": "\"", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""]
],
"folding": {
"offSide": true
}
}

View File

@ -0,0 +1,25 @@
{
"name": "clojure",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": { "vscode": "*" },
"scripts": {
"update-grammar": "node ../../build/npm/update-grammar.js atom/language-clojure grammars/clojure.cson ./syntaxes/clojure.tmLanguage.json"
},
"contributes": {
"languages": [{
"id": "clojure",
"aliases": ["Clojure", "clojure"],
"extensions": [".clj", ".cljs", ".cljc", ".cljx", ".clojure", ".edn"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "clojure",
"scopeName": "source.clojure",
"path": "./syntaxes/clojure.tmLanguage.json"
}]
}
}

View File

@ -0,0 +1,4 @@
{
"displayName": "Clojure Language Basics",
"description": "Provides syntax highlighting and bracket matching in Clojure files."
}

View File

@ -0,0 +1,435 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/atom/language-clojure/blob/master/grammars/clojure.cson",
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/atom/language-clojure/commit/de877502aa4a77ccdc2c7f0c9180436aea3effff",
"name": "Clojure",
"scopeName": "source.clojure",
"patterns": [
{
"include": "#comment"
},
{
"include": "#shebang-comment"
},
{
"include": "#quoted-sexp"
},
{
"include": "#sexp"
},
{
"include": "#keyfn"
},
{
"include": "#string"
},
{
"include": "#vector"
},
{
"include": "#set"
},
{
"include": "#map"
},
{
"include": "#regexp"
},
{
"include": "#var"
},
{
"include": "#constants"
},
{
"include": "#dynamic-variables"
},
{
"include": "#metadata"
},
{
"include": "#namespace-symbol"
},
{
"include": "#symbol"
}
],
"repository": {
"comment": {
"begin": "(?<!\\\\);",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.clojure"
}
},
"end": "$",
"name": "comment.line.semicolon.clojure"
},
"constants": {
"patterns": [
{
"match": "(nil)(?=(\\s|\\)|\\]|\\}))",
"name": "constant.language.nil.clojure"
},
{
"match": "(true|false)",
"name": "constant.language.boolean.clojure"
},
{
"match": "(-?\\d+/\\d+)",
"name": "constant.numeric.ratio.clojure"
},
{
"match": "(-?\\d+[rR]\\w+)",
"name": "constant.numeric.arbitrary-radix.clojure"
},
{
"match": "(-?0[xX][0-9a-fA-F]+)",
"name": "constant.numeric.hexadecimal.clojure"
},
{
"match": "(-?0\\d+)",
"name": "constant.numeric.octal.clojure"
},
{
"match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?M)",
"name": "constant.numeric.bigdecimal.clojure"
},
{
"match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?)",
"name": "constant.numeric.double.clojure"
},
{
"match": "(-?\\d+N)",
"name": "constant.numeric.bigint.clojure"
},
{
"match": "(-?\\d+)",
"name": "constant.numeric.long.clojure"
},
{
"include": "#keyword"
}
]
},
"keyword": {
"match": "(?<=(\\s|\\(|\\[|\\{)):[\\w\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))",
"name": "constant.keyword.clojure"
},
"keyfn": {
"patterns": [
{
"match": "(?<=(\\s|\\(|\\[|\\{))(if(-[-\\p{Ll}\\?]*)?|when(-[-\\p{Ll}]*)?|for(-[-\\p{Ll}]*)?|cond|do|let(-[-\\p{Ll}\\?]*)?|binding|loop|recur|fn|throw[\\p{Ll}\\-]*|try|catch|finally|([\\p{Ll}]*case))(?=(\\s|\\)|\\]|\\}))",
"name": "storage.control.clojure"
},
{
"match": "(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[\\p{Ll}\\-]*))(?=(\\s|\\)|\\]|\\}))",
"name": "keyword.control.clojure"
}
]
},
"dynamic-variables": {
"match": "\\*[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\d]+\\*",
"name": "meta.symbol.dynamic.clojure"
},
"map": {
"begin": "(\\{)",
"beginCaptures": {
"1": {
"name": "punctuation.section.map.begin.clojure"
}
},
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.map.end.trailing.clojure"
},
"2": {
"name": "punctuation.section.map.end.clojure"
}
},
"name": "meta.map.clojure",
"patterns": [
{
"include": "$self"
}
]
},
"metadata": {
"patterns": [
{
"begin": "(\\^\\{)",
"beginCaptures": {
"1": {
"name": "punctuation.section.metadata.map.begin.clojure"
}
},
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.metadata.map.end.trailing.clojure"
},
"2": {
"name": "punctuation.section.metadata.map.end.clojure"
}
},
"name": "meta.metadata.map.clojure",
"patterns": [
{
"include": "$self"
}
]
},
{
"begin": "(\\^)",
"end": "(\\s)",
"name": "meta.metadata.simple.clojure",
"patterns": [
{
"include": "#keyword"
},
{
"include": "$self"
}
]
}
]
},
"quoted-sexp": {
"begin": "(['``]\\()",
"beginCaptures": {
"1": {
"name": "punctuation.section.expression.begin.clojure"
}
},
"end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.expression.end.trailing.clojure"
},
"2": {
"name": "punctuation.section.expression.end.trailing.clojure"
},
"3": {
"name": "punctuation.section.expression.end.clojure"
}
},
"name": "meta.quoted-expression.clojure",
"patterns": [
{
"include": "$self"
}
]
},
"regexp": {
"begin": "#\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.regexp.begin.clojure"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.regexp.end.clojure"
}
},
"name": "string.regexp.clojure",
"patterns": [
{
"include": "#regexp_escaped_char"
}
]
},
"regexp_escaped_char": {
"match": "\\\\.",
"name": "constant.character.escape.clojure"
},
"set": {
"begin": "(\\#\\{)",
"beginCaptures": {
"1": {
"name": "punctuation.section.set.begin.clojure"
}
},
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.set.end.trailing.clojure"
},
"2": {
"name": "punctuation.section.set.end.clojure"
}
},
"name": "meta.set.clojure",
"patterns": [
{
"include": "$self"
}
]
},
"sexp": {
"begin": "(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.section.expression.begin.clojure"
}
},
"end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.expression.end.trailing.clojure"
},
"2": {
"name": "punctuation.section.expression.end.trailing.clojure"
},
"3": {
"name": "punctuation.section.expression.end.clojure"
}
},
"name": "meta.expression.clojure",
"patterns": [
{
"begin": "(?<=\\()(ns|declare|def[\\w\\d._:+=><!?*-]*|[\\w._:+=><!?*-][\\w\\d._:+=><!?*-]*/def[\\w\\d._:+=><!?*-]*)\\s+",
"beginCaptures": {
"1": {
"name": "keyword.control.clojure"
}
},
"end": "(?=\\))",
"name": "meta.definition.global.clojure",
"patterns": [
{
"include": "#metadata"
},
{
"include": "#dynamic-variables"
},
{
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
"name": "entity.global.clojure"
},
{
"include": "$self"
}
]
},
{
"include": "#keyfn"
},
{
"include": "#constants"
},
{
"include": "#vector"
},
{
"include": "#map"
},
{
"include": "#set"
},
{
"include": "#sexp"
},
{
"match": "(?<=\\()(.+?)(?=\\s|\\))",
"captures": {
"1": {
"name": "entity.name.function.clojure"
}
},
"patterns": [
{
"include": "$self"
}
]
},
{
"include": "$self"
}
]
},
"shebang-comment": {
"begin": "^(#!)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.shebang.clojure"
}
},
"end": "$",
"name": "comment.line.shebang.clojure"
},
"string": {
"begin": "(?<!\\\\)(\")",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.clojure"
}
},
"end": "(\")",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.clojure"
}
},
"name": "string.quoted.double.clojure",
"patterns": [
{
"match": "\\\\.",
"name": "constant.character.escape.clojure"
}
]
},
"namespace-symbol": {
"patterns": [
{
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)/",
"captures": {
"1": {
"name": "meta.symbol.namespace.clojure"
}
}
}
]
},
"symbol": {
"patterns": [
{
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
"name": "meta.symbol.clojure"
}
]
},
"var": {
"match": "(?<=(\\s|\\(|\\[|\\{)\\#)'[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))",
"name": "meta.var.clojure"
},
"vector": {
"begin": "(\\[)",
"beginCaptures": {
"1": {
"name": "punctuation.section.vector.begin.clojure"
}
},
"end": "(\\](?=[\\}\\]\\)\\s]*(?:;|$)))|(\\])",
"endCaptures": {
"1": {
"name": "punctuation.section.vector.end.trailing.clojure"
},
"2": {
"name": "punctuation.section.vector.end.clojure"
}
},
"name": "meta.vector.clojure",
"patterns": [
{
"include": "$self"
}
]
}
}
}

View File

@ -0,0 +1,52 @@
;; from http://clojure-doc.org/articles/tutorials/introduction.html
(require '[clojure.string :as str])
(def the-answer 42)
[1 2 3] ; A vector
[1 :two "three"]
{:a 1 :b 2}
#{:a :b :c}
'(1 2 3)
(def my-stuff ["shirt" "coat" "hat"]) ; this is more typical usage.
(my-func (my-func2 arg1
arg2)
(other-func arg-a
(foo-bar arg-x
arg-y
(+ arg-xx
arg-yy
arg-zz))
arg-b))
'(+ 1 2 3)
;; ⇒ (+ 1 2 3)
(let [width 10
height 20
thickness 2]
(println "hello from inside the `let`.")
(* width
height
thickness))
;; Vectors
(def v [:a :b :c])
(def li '(:a :b :c))
(conj v :d) ; ⇒ [:a :b :c :d]
(conj li :d) ; ⇒ (:d :a :b :c)
v ; ⇒ is still [:a :b :c]
li ; ⇒ is still (:a :b :c)
;; Maps
(def m {:a 1 :b 2})
(assoc m :c 3) ; ⇒ {:a 1 :c 3 :b 2}
(dissoc m :b) ; ⇒ {:a 1}
(def my-atom (atom {:foo 1}))
;; ⇒ #'user/my-atom
@my-atom
;; ⇒ {:foo 1}
(swap! my-atom update-in [:foo] inc)
;; ⇒ {:foo 2}
@my-atom
;; ⇒ {:foo 2}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
test/**
cgmanifest.json

View File

@ -0,0 +1,18 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "atom/language-coffee-script",
"repositoryUrl": "https://github.com/atom/language-coffee-script",
"commitHash": "0f6db9143663e18b1ad00667820f46747dba495e"
}
},
"license": "MIT",
"description": "The file syntaxes/coffeescript.tmLanguage.json was derived from the Atom package https://github.com/atom/language-coffee-script which was originally converted from the TextMate bundle https://github.com/jashkenas/coffee-script-tmbundle.",
"version": "0.49.3"
}
],
"version": 1
}

View File

@ -0,0 +1,33 @@
{
"comments": {
"lineComment": "#",
"blockComment": [ "###", "###" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "'", "close": "'", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"],
[" ", " "]
],
"folding": {
"offSide": true,
"markers": {
"start": "^\\s*#region\\b",
"end": "^\\s*#endregion\\b"
}
}
}

View File

@ -0,0 +1,34 @@
{
"name": "coffeescript",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": { "vscode": "*" },
"scripts": {
"update-grammar": "node ../../build/npm/update-grammar.js atom/language-coffee-script grammars/coffeescript.cson ./syntaxes/coffeescript.tmLanguage.json"
},
"contributes": {
"languages": [{
"id": "coffeescript",
"extensions": [ ".coffee", ".cson", ".iced" ],
"aliases": [ "CoffeeScript", "coffeescript", "coffee" ],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "coffeescript",
"scopeName": "source.coffee",
"path": "./syntaxes/coffeescript.tmLanguage.json"
}],
"breakpoints": [
{
"language": "coffeescript"
}
],
"snippets": [{
"language": "coffeescript",
"path": "./snippets/coffeescript.code-snippets"
}]
}
}

View File

@ -0,0 +1,4 @@
{
"displayName": "CoffeeScript Language Basics",
"description": "Provides snippets, syntax highlighting, bracket matching and folding in CoffeeScript files."
}

View File

@ -0,0 +1,16 @@
{
"Region Start": {
"prefix": "#region",
"body": [
"#region"
],
"description": "Folding Region Start"
},
"Region End": {
"prefix": "#endregion",
"body": [
"#endregion"
],
"description": "Folding Region End"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
regex = /Hello (\d+) #{user}/g
2 / 3
2/3
a = b/c + d/g
someOtherStuff
name="hello"
test=/// #{name}
fancyRegExp = ///
(\d+) # numbers
(\w*) # letters
$ # the end
///

View File

@ -0,0 +1,28 @@
"""
A CoffeeScript sample.
"""
class Vehicle
constructor: (@name) =>
drive: () =>
alert "Drive #{@name}"
class Car extends Vehicle
drive: () =>
alert "Driving #{@name}"
c = new Car "Volvo"
while onTheRoad()
c.drive()
vehicles = (new Car for i in [1..100])
startRace = (vehicles) -> [vehicle.drive() for vehicle in vehicles]
fancyRegExp = ///
(\d+) # numbers
(\w*) # letters
$ # the end
///

View File

@ -0,0 +1,728 @@
[
{
"c": "regex",
"t": "source.coffee variable.assignment.coffee",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": " ",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "=",
"t": "source.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": " ",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "/",
"t": "source.coffee string.regexp.coffee punctuation.definition.string.begin.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "Hello ",
"t": "source.coffee string.regexp.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "(",
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
"dark_plus": "punctuation.definition.group.regexp: #CE9178",
"light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "\\d",
"t": "source.coffee string.regexp.coffee meta.group.regexp constant.character.character-class.regexp",
"r": {
"dark_plus": "constant.character.character-class.regexp: #D16969",
"light_plus": "constant.character.character-class.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "constant.character: #569CD6"
}
},
{
"c": "+",
"t": "source.coffee string.regexp.coffee meta.group.regexp keyword.operator.quantifier.regexp",
"r": {
"dark_plus": "keyword.operator.quantifier.regexp: #D7BA7D",
"light_plus": "keyword.operator.quantifier.regexp: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": ")",
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
"r": {
"dark_plus": "punctuation.definition.group.regexp: #CE9178",
"light_plus": "punctuation.definition.group.regexp: #D16969",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": " #{user}",
"t": "source.coffee string.regexp.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "/",
"t": "source.coffee string.regexp.coffee punctuation.definition.string.end.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "g",
"t": "source.coffee string.regexp.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "2",
"t": "source.coffee constant.numeric.decimal.coffee",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
"dark_vs": "constant.numeric: #B5CEA8",
"light_vs": "constant.numeric: #098658",
"hc_black": "constant.numeric: #B5CEA8"
}
},
{
"c": " ",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "/",
"t": "source.coffee keyword.operator.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": " ",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "3",
"t": "source.coffee constant.numeric.decimal.coffee",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
"dark_vs": "constant.numeric: #B5CEA8",
"light_vs": "constant.numeric: #098658",
"hc_black": "constant.numeric: #B5CEA8"
}
},
{
"c": "2",
"t": "source.coffee constant.numeric.decimal.coffee",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
"dark_vs": "constant.numeric: #B5CEA8",
"light_vs": "constant.numeric: #098658",
"hc_black": "constant.numeric: #B5CEA8"
}
},
{
"c": "/",
"t": "source.coffee keyword.operator.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": "3",
"t": "source.coffee constant.numeric.decimal.coffee",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
"dark_vs": "constant.numeric: #B5CEA8",
"light_vs": "constant.numeric: #098658",
"hc_black": "constant.numeric: #B5CEA8"
}
},
{
"c": "a",
"t": "source.coffee variable.assignment.coffee",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": " ",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "=",
"t": "source.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": " b",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "/",
"t": "source.coffee keyword.operator.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": "c ",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "+",
"t": "source.coffee keyword.operator.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": " d",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "/",
"t": "source.coffee keyword.operator.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": "g",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "someOtherStuff",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "name",
"t": "source.coffee variable.assignment.coffee",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": "=",
"t": "source.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": "\"",
"t": "source.coffee string.quoted.double.coffee punctuation.definition.string.begin.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "hello",
"t": "source.coffee string.quoted.double.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "\"",
"t": "source.coffee string.quoted.double.coffee punctuation.definition.string.end.coffee",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "test",
"t": "source.coffee variable.assignment.coffee",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": "=",
"t": "source.coffee keyword.operator.assignment.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": "///",
"t": "source.coffee string.regexp.multiline.coffee punctuation.definition.string.begin.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": " ",
"t": "source.coffee string.regexp.multiline.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "#{",
"t": "source.coffee string.regexp.multiline.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "name",
"t": "source.coffee string.regexp.multiline.coffee source.coffee.embedded.source",
"r": {
"dark_plus": "source.coffee.embedded: #9CDCFE",
"light_plus": "source.coffee.embedded: #FF0000",
"dark_vs": "source.coffee.embedded: #9CDCFE",
"light_vs": "source.coffee.embedded: #FF0000",
"hc_black": "source.coffee.embedded: #D4D4D4"
}
},
{
"c": "}",
"t": "source.coffee string.regexp.multiline.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded: #569CD6",
"light_plus": "punctuation.section.embedded: #0000FF",
"dark_vs": "punctuation.section.embedded: #569CD6",
"light_vs": "punctuation.section.embedded: #0000FF",
"hc_black": "punctuation.section.embedded: #569CD6"
}
},
{
"c": "fancyRegExp = ",
"t": "source.coffee string.regexp.multiline.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "///",
"t": "source.coffee string.regexp.multiline.coffee punctuation.definition.string.end.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "\t",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "(",
"t": "source.coffee meta.brace.round.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "\\d",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "+",
"t": "source.coffee keyword.operator.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": ")",
"t": "source.coffee meta.brace.round.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "\t",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "#",
"t": "source.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " numbers",
"t": "source.coffee comment.line.number-sign.coffee",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "\t",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "(",
"t": "source.coffee meta.brace.round.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "\\w",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "*",
"t": "source.coffee keyword.operator.coffee",
"r": {
"dark_plus": "keyword.operator: #D4D4D4",
"light_plus": "keyword.operator: #000000",
"dark_vs": "keyword.operator: #D4D4D4",
"light_vs": "keyword.operator: #000000",
"hc_black": "keyword.operator: #D4D4D4"
}
},
{
"c": ")",
"t": "source.coffee meta.brace.round.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "\t",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "#",
"t": "source.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " letters",
"t": "source.coffee comment.line.number-sign.coffee",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "\t$\t\t",
"t": "source.coffee",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "#",
"t": "source.coffee comment.line.number-sign.coffee punctuation.definition.comment.coffee",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " the end",
"t": "source.coffee comment.line.number-sign.coffee",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "///",
"t": "source.coffee string.regexp.multiline.coffee punctuation.definition.string.begin.coffee",
"r": {
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
}
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
test/**
src/**
tsconfig.json
out/**
extension.webpack.config.js
extension-browser.webpack.config.js
yarn.lock

View File

@ -0,0 +1,21 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const withBrowserDefaults = require('../shared.webpack.config').browser;
module.exports = withBrowserDefaults({
context: __dirname,
entry: {
extension: './src/configurationEditingMain.ts'
},
output: {
filename: 'configurationEditingMain.js'
}
});

View File

@ -0,0 +1,23 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const withDefaults = require('../shared.webpack.config');
module.exports = withDefaults({
context: __dirname,
entry: {
extension: './src/configurationEditingMain.ts',
},
output: {
filename: 'configurationEditingMain.js'
},
resolve: {
mainFields: ['module', 'main']
}
});

View File

@ -0,0 +1,133 @@
{
"name": "configuration-editing",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "^1.0.0"
},
"activationEvents": [
"onLanguage:json",
"onLanguage:jsonc"
],
"main": "./out/configurationEditingMain",
"browser": "./dist/browser/configurationEditingMain",
"scripts": {
"compile": "gulp compile-extension:configuration-editing",
"watch": "gulp watch-extension:configuration-editing"
},
"dependencies": {
"jsonc-parser": "^2.2.1",
"vscode-nls": "^4.1.1"
},
"contributes": {
"languages": [
{
"id": "jsonc",
"extensions": [
".code-workspace",
"language-configuration.json",
"icon-theme.json",
"color-theme.json",
".code-snippets"
],
"filenames": [
"settings.json",
"launch.json",
"tasks.json",
"keybindings.json",
"extensions.json",
"argv.json",
"profiles.json"
]
}
],
"jsonValidation": [
{
"fileMatch": "vscode://defaultsettings/keybindings.json",
"url": "vscode://schemas/keybindings"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/keybindings.json",
"url": "vscode://schemas/keybindings"
},
{
"fileMatch": "vscode://defaultsettings/*.json",
"url": "vscode://schemas/settings/default"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/settings.json",
"url": "vscode://schemas/settings/user"
},
{
"fileMatch": "%MACHINE_SETTINGS_HOME%/settings.json",
"url": "vscode://schemas/settings/machine"
},
{
"fileMatch": "%APP_WORKSPACES_HOME%/*/workspace.json",
"url": "vscode://schemas/workspaceConfig"
},
{
"fileMatch": "**/*.code-workspace",
"url": "vscode://schemas/workspaceConfig"
},
{
"fileMatch": "**/argv.json",
"url": "vscode://schemas/argv"
},
{
"fileMatch": "/.vscode/settings.json",
"url": "vscode://schemas/settings/folder"
},
{
"fileMatch": "/.vscode/launch.json",
"url": "vscode://schemas/launch"
},
{
"fileMatch": "/.vscode/tasks.json",
"url": "vscode://schemas/tasks"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/tasks.json",
"url": "vscode://schemas/tasks"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/snippets/*.json",
"url": "vscode://schemas/snippets"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/sync/snippets/preview/*.json",
"url": "vscode://schemas/snippets"
},
{
"fileMatch": "**/*.code-snippets",
"url": "vscode://schemas/global-snippets"
},
{
"fileMatch": "/.vscode/extensions.json",
"url": "vscode://schemas/extensions"
},
{
"fileMatch": "/.devcontainer/devcontainer.json",
"url": "./schemas/devContainer.schema.json"
},
{
"fileMatch": "/.devcontainer.json",
"url": "./schemas/devContainer.schema.json"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/*.json",
"url": "./schemas/attachContainer.schema.json"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/globalStorage/ms-vscode-remote.remote-containers/imageConfigs/*.json",
"url": "./schemas/attachContainer.schema.json"
}
]
},
"devDependencies": {
"@types/node": "^12.11.7"
}
}

View File

@ -0,0 +1,4 @@
{
"displayName": "Configuration Editing",
"description": "Provides capabilities (advanced IntelliSense, auto-fixing) in configuration files like settings, launch, and extension recommendation files."
}

View File

@ -0,0 +1,77 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Configures an attached to container",
"allowComments": true,
"allowTrailingCommas": true,
"type": "object",
"definitions": {
"attachContainer": {
"type": "object",
"properties": {
"workspaceFolder": {
"type": "string",
"description": "The path of the workspace folder inside the container."
},
"forwardPorts": {
"type": "array",
"description": "Ports that are forwarded from the container to the local machine.",
"items": {
"type": "integer"
}
},
"settings": {
"$ref": "vscode://schemas/settings/machine",
"description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time."
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
"type": [
"string",
"null"
]
},
"description": "Remote environment variables."
},
"remoteUser": {
"type": "string",
"description": "The user VS Code Server will be started with. The default is the same user as the container."
},
"extensions": {
"type": "array",
"description": "An array of extensions that should be installed into the container.",
"items": {
"type": "string",
"pattern": "^([a-z0-9A-Z][a-z0-9\\-A-Z]*)\\.([a-z0-9A-Z][a-z0-9\\-A-Z]*)(@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?$",
"errorMessage": "Expected format: '${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
}
},
"userEnvProbe": {
"type": "string",
"enum": [
"none",
"loginShell",
"loginInteractiveShell",
"interactiveShell"
],
"description": "User environment probe to run. The default is none."
},
"postAttachCommand": {
"type": [
"string",
"array"
],
"description": "A command to run after attaching to the container. If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
"items": {
"type": "string"
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/attachContainer"
}
]
}

View File

@ -0,0 +1,357 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Defines a dev container",
"allowComments": true,
"allowTrailingCommas": true,
"type": "object",
"definitions": {
"devContainerCommon": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A name to show for the workspace folder."
},
"extensions": {
"type": "array",
"description": "An array of extensions that should be installed into the container.",
"items": {
"type": "string",
"pattern": "^([a-z0-9A-Z][a-z0-9\\-A-Z]*)\\.([a-z0-9A-Z][a-z0-9\\-A-Z]*)(@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?$",
"errorMessage": "Expected format: '${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
}
},
"settings": {
"$ref": "vscode://schemas/settings/machine",
"description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time, rebuilding the container then triggers it again."
},
"forwardPorts": {
"type": "array",
"description": "Ports that are forwarded from the container to the local machine.",
"items": {
"type": "integer",
"maximum": 65535,
"minimum": 0
}
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
"type": [
"string",
"null"
]
},
"description": "Remote environment variables."
},
"remoteUser": {
"type": "string",
"description": "The user VS Code Server will be started with. The default is the same user as the container."
},
"initializeCommand": {
"type": [
"string",
"array"
],
"description": "A command to run locally before anything else. If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
"items": {
"type": "string"
}
},
"postCreateCommand": {
"type": [
"string",
"array"
],
"description": "A command to run after creating the container. If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
"items": {
"type": "string"
}
},
"postStartCommand": {
"type": [
"string",
"array"
],
"description": "A command to run after starting the container. If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
"items": {
"type": "string"
}
},
"postAttachCommand": {
"type": [
"string",
"array"
],
"description": "A command to run after attaching to the container. If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
"items": {
"type": "string"
}
},
"devPort": {
"type": "integer",
"description": "The port VS Code can use to connect to its backend."
},
"userEnvProbe": {
"type": "string",
"enum": [
"none",
"loginShell",
"loginInteractiveShell",
"interactiveShell"
],
"description": "User environment probe to run. The default is none."
},
"codespaces": {
"type": "object",
"description": "Codespaces-specific configuration."
}
}
},
"nonComposeBase": {
"type": "object",
"properties": {
"appPort": {
"type": [
"integer",
"string",
"array"
],
"description": "Application ports that are exposed by the container. This can be a single port or an array of ports. Each port can be a number or a string. A number is mapped to the same port on the host. A string is passed to Docker unchanged and can be used to map ports differently, e.g. \"8000:8010\".",
"items": {
"type": [
"integer",
"string"
]
}
},
"containerEnv": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Container environment variables."
},
"containerUser": {
"type": "string",
"description": "The user the container will be started with. The default is the user on the Docker image."
},
"updateRemoteUserUID": {
"type": "boolean",
"description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default."
},
"mounts": {
"type": "array",
"description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.",
"items": {
"type": "string"
}
},
"runArgs": {
"type": "array",
"description": "The arguments required when starting in the container.",
"items": {
"type": "string"
}
},
"shutdownAction": {
"type": "string",
"enum": [
"none",
"stopContainer"
],
"description": "Action to take when the VS Code window is closed. The default is to stop the container."
},
"overrideCommand": {
"type": "boolean",
"description": "Whether to overwrite the command specified in the image. The default is true."
},
"workspaceFolder": {
"type": "string",
"description": "The path of the workspace folder inside the container."
},
"workspaceMount": {
"type": "string",
"description": "The --mount parameter for docker run. The default is to mount the project folder at /workspaces/$project."
}
}
},
"dockerfileContainer": {
"oneOf": [
{
"type": "object",
"properties": {
"build": {
"type": "object",
"description": "Docker build-related options.",
"allOf": [
{
"type": "object",
"properties": {
"dockerfile": {
"type": "string",
"description": "The location of the Dockerfile that defines the contents of the container. The path is relative to the folder containing the `devcontainer.json` file."
},
"context": {
"type": "string",
"description": "The location of the context folder for building the Docker image. The path is relative to the folder containing the `devcontainer.json` file."
}
},
"required": [
"dockerfile"
]
},
{
"$ref": "#/definitions/buildOptions"
}
]
}
},
"required": [
"build"
]
},
{
"allOf": [
{
"type": "object",
"properties": {
"dockerFile": {
"type": "string",
"description": "The location of the Dockerfile that defines the contents of the container. The path is relative to the folder containing the `devcontainer.json` file."
},
"context": {
"type": "string",
"description": "The location of the context folder for building the Docker image. The path is relative to the folder containing the `devcontainer.json` file."
}
},
"required": [
"dockerFile"
]
},
{
"type": "object",
"properties": {
"build": {
"description": "Docker build-related options.",
"$ref": "#/definitions/buildOptions"
}
}
}
]
}
]
},
"buildOptions": {
"type": "object",
"properties": {
"target": {
"type": "string",
"description": "Target stage in a multi-stage build."
},
"args": {
"type": "object",
"additionalProperties": {
"type": [
"string"
]
},
"description": "Build arguments."
}
}
},
"imageContainer": {
"type": "object",
"properties": {
"image": {
"type": "string",
"description": "The docker image that will be used to create the container."
}
},
"required": [
"image"
]
},
"composeContainer": {
"type": "object",
"properties": {
"dockerComposeFile": {
"type": [
"string",
"array"
],
"description": "The name of the docker-compose file(s) used to start the services.",
"items": {
"type": "string"
}
},
"service": {
"type": "string",
"description": "The service you want to work on."
},
"runServices": {
"type": "array",
"description": "An array of services that should be started and stopped.",
"items": {
"type": "string"
}
},
"workspaceFolder": {
"type": "string",
"description": "The path of the workspace folder inside the container. This is typically the target path of a volume mount in the docker-compose.yml."
},
"shutdownAction": {
"type": "string",
"enum": [
"none",
"stopCompose"
],
"description": "Action to take when the VS Code window is closed. The default is to stop the containers."
}
},
"required": [
"dockerComposeFile",
"service",
"workspaceFolder"
]
}
},
"oneOf": [
{
"allOf": [
{
"oneOf": [
{
"allOf": [
{
"oneOf": [
{
"$ref": "#/definitions/dockerfileContainer"
},
{
"$ref": "#/definitions/imageContainer"
}
]
},
{
"$ref": "#/definitions/nonComposeBase"
}
]
},
{
"$ref": "#/definitions/composeContainer"
}
]
},
{
"$ref": "#/definitions/devContainerCommon"
}
]
},
{
"type": "object",
"$ref": "#/definitions/devContainerCommon",
"additionalProperties": false
}
]
}

View File

@ -0,0 +1,138 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { getLocation, parse, visit } from 'jsonc-parser';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { SettingsDocument } from './settingsDocumentHelper';
import { provideInstalledExtensionProposals } from './extensionsProposals';
const localize = nls.loadMessageBundle();
export function activate(context: vscode.ExtensionContext): void {
//settings.json suggestions
context.subscriptions.push(registerSettingsCompletions());
//extensions suggestions
context.subscriptions.push(...registerExtensionsCompletions());
// launch.json variable suggestions
context.subscriptions.push(registerVariableCompletions('**/launch.json'));
// task.json variable suggestions
context.subscriptions.push(registerVariableCompletions('**/tasks.json'));
}
function registerSettingsCompletions(): vscode.Disposable {
return vscode.languages.registerCompletionItemProvider({ language: 'jsonc', pattern: '**/settings.json' }, {
provideCompletionItems(document, position, token) {
return new SettingsDocument(document).provideCompletionItems(position, token);
}
});
}
function registerVariableCompletions(pattern: string): vscode.Disposable {
return vscode.languages.registerCompletionItemProvider({ language: 'jsonc', pattern }, {
provideCompletionItems(document, position, _token) {
const location = getLocation(document.getText(), document.offsetAt(position));
if (!location.isAtPropertyKey && location.previousNode && location.previousNode.type === 'string') {
const indexOf$ = document.lineAt(position.line).text.indexOf('$');
const startPosition = indexOf$ >= 0 ? new vscode.Position(position.line, indexOf$) : position;
return [
{ label: 'workspaceFolder', detail: localize('workspaceFolder', "The path of the folder opened in VS Code") },
{ label: 'workspaceFolderBasename', detail: localize('workspaceFolderBasename', "The name of the folder opened in VS Code without any slashes (/)") },
{ label: 'relativeFile', detail: localize('relativeFile', "The current opened file relative to ${workspaceFolder}") },
{ label: 'relativeFileDirname', detail: localize('relativeFileDirname', "The current opened file's dirname relative to ${workspaceFolder}") },
{ label: 'file', detail: localize('file', "The current opened file") },
{ label: 'cwd', detail: localize('cwd', "The task runner's current working directory on startup") },
{ label: 'lineNumber', detail: localize('lineNumber', "The current selected line number in the active file") },
{ label: 'selectedText', detail: localize('selectedText', "The current selected text in the active file") },
{ label: 'fileDirname', detail: localize('fileDirname', "The current opened file's dirname") },
{ label: 'fileExtname', detail: localize('fileExtname', "The current opened file's extension") },
{ label: 'fileBasename', detail: localize('fileBasename', "The current opened file's basename") },
{ label: 'fileBasenameNoExtension', detail: localize('fileBasenameNoExtension', "The current opened file's basename with no file extension") },
{ label: 'defaultBuildTask', detail: localize('defaultBuildTask', "The name of the default build task. If there is not a single default build task then a quick pick is shown to choose the build task.") },
].map(variable => ({
label: '${' + variable.label + '}',
range: new vscode.Range(startPosition, position),
detail: variable.detail
}));
}
return [];
}
});
}
interface IExtensionsContent {
recommendations: string[];
}
function registerExtensionsCompletions(): vscode.Disposable[] {
return [registerExtensionsCompletionsInExtensionsDocument(), registerExtensionsCompletionsInWorkspaceConfigurationDocument()];
}
function registerExtensionsCompletionsInExtensionsDocument(): vscode.Disposable {
return vscode.languages.registerCompletionItemProvider({ pattern: '**/extensions.json' }, {
provideCompletionItems(document, position, _token) {
const location = getLocation(document.getText(), document.offsetAt(position));
const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
if (location.path[0] === 'recommendations') {
const extensionsContent = <IExtensionsContent>parse(document.getText());
return provideInstalledExtensionProposals(extensionsContent && extensionsContent.recommendations || [], range, false);
}
return [];
}
});
}
function registerExtensionsCompletionsInWorkspaceConfigurationDocument(): vscode.Disposable {
return vscode.languages.registerCompletionItemProvider({ pattern: '**/*.code-workspace' }, {
provideCompletionItems(document, position, _token) {
const location = getLocation(document.getText(), document.offsetAt(position));
const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
if (location.path[0] === 'extensions' && location.path[1] === 'recommendations') {
const extensionsContent = <IExtensionsContent>parse(document.getText())['extensions'];
return provideInstalledExtensionProposals(extensionsContent && extensionsContent.recommendations || [], range, false);
}
return [];
}
});
}
vscode.languages.registerDocumentSymbolProvider({ pattern: '**/launch.json', language: 'jsonc' }, {
provideDocumentSymbols(document: vscode.TextDocument, _token: vscode.CancellationToken): vscode.ProviderResult<vscode.SymbolInformation[]> {
const result: vscode.SymbolInformation[] = [];
let name: string = '';
let lastProperty = '';
let startOffset = 0;
let depthInObjects = 0;
visit(document.getText(), {
onObjectProperty: (property, _offset, _length) => {
lastProperty = property;
},
onLiteralValue: (value: any, _offset: number, _length: number) => {
if (lastProperty === 'name') {
name = value;
}
},
onObjectBegin: (offset: number, _length: number) => {
depthInObjects++;
if (depthInObjects === 2) {
startOffset = offset;
}
},
onObjectEnd: (offset: number, _length: number) => {
if (name && depthInObjects === 2) {
result.push(new vscode.SymbolInformation(name, vscode.SymbolKind.Object, new vscode.Range(document.positionAt(startOffset), document.positionAt(offset))));
}
depthInObjects--;
},
});
return result;
}
}, { label: 'Launch Targets' });

View File

@ -0,0 +1,35 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
export function provideInstalledExtensionProposals(existing: string[], range: vscode.Range, includeBuiltinExtensions: boolean): vscode.ProviderResult<vscode.CompletionItem[] | vscode.CompletionList> {
if (Array.isArray(existing)) {
const extensions = includeBuiltinExtensions ? vscode.extensions.all : vscode.extensions.all.filter(e => !(e.id.startsWith('vscode.') || e.id === 'Microsoft.vscode-markdown'));
const knownExtensionProposals = extensions.filter(e => existing.indexOf(e.id) === -1);
if (knownExtensionProposals.length) {
return knownExtensionProposals.map(e => {
const item = new vscode.CompletionItem(e.id);
const insertText = `"${e.id}"`;
item.kind = vscode.CompletionItemKind.Value;
item.insertText = insertText;
item.range = range;
item.filterText = insertText;
return item;
});
} else {
const example = new vscode.CompletionItem(localize('exampleExtension', "Example"));
example.insertText = '"vscode.csharp"';
example.kind = vscode.CompletionItemKind.Value;
example.range = range;
return [example];
}
}
return undefined;
}

View File

@ -0,0 +1,249 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { getLocation, Location, parse } from 'jsonc-parser';
import * as nls from 'vscode-nls';
import { provideInstalledExtensionProposals } from './extensionsProposals';
const localize = nls.loadMessageBundle();
export class SettingsDocument {
constructor(private document: vscode.TextDocument) { }
public provideCompletionItems(position: vscode.Position, _token: vscode.CancellationToken): vscode.ProviderResult<vscode.CompletionItem[] | vscode.CompletionList> {
const location = getLocation(this.document.getText(), this.document.offsetAt(position));
const range = this.document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
// window.title
if (location.path[0] === 'window.title') {
return this.provideWindowTitleCompletionItems(location, range);
}
// files.association
if (location.path[0] === 'files.associations') {
return this.provideFilesAssociationsCompletionItems(location, range);
}
// files.exclude, search.exclude
if (location.path[0] === 'files.exclude' || location.path[0] === 'search.exclude') {
return this.provideExcludeCompletionItems(location, range);
}
// files.defaultLanguage
if (location.path[0] === 'files.defaultLanguage') {
return this.provideLanguageCompletionItems(location, range).then(items => {
// Add special item '${activeEditorLanguage}'
return [this.newSimpleCompletionItem(JSON.stringify('${activeEditorLanguage}'), range, localize('activeEditor', "Use the language of the currently active text editor if any")), ...items];
});
}
// settingsSync.ignoredExtensions
if (location.path[0] === 'settingsSync.ignoredExtensions') {
let ignoredExtensions = [];
try {
ignoredExtensions = parse(this.document.getText())['settingsSync.ignoredExtensions'];
} catch (e) {/* ignore error */ }
return provideInstalledExtensionProposals(ignoredExtensions, range, true);
}
return this.provideLanguageOverridesCompletionItems(location, position);
}
private provideWindowTitleCompletionItems(_location: Location, range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[]> {
const completions: vscode.CompletionItem[] = [];
completions.push(this.newSimpleCompletionItem('${activeEditorShort}', range, localize('activeEditorShort', "the file name (e.g. myFile.txt)")));
completions.push(this.newSimpleCompletionItem('${activeEditorMedium}', range, localize('activeEditorMedium', "the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt)")));
completions.push(this.newSimpleCompletionItem('${activeEditorLong}', range, localize('activeEditorLong', "the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt)")));
completions.push(this.newSimpleCompletionItem('${activeFolderShort}', range, localize('activeFolderShort', "the name of the folder the file is contained in (e.g. myFileFolder)")));
completions.push(this.newSimpleCompletionItem('${activeFolderMedium}', range, localize('activeFolderMedium', "the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder)")));
completions.push(this.newSimpleCompletionItem('${activeFolderLong}', range, localize('activeFolderLong', "the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder)")));
completions.push(this.newSimpleCompletionItem('${rootName}', range, localize('rootName', "name of the workspace (e.g. myFolder or myWorkspace)")));
completions.push(this.newSimpleCompletionItem('${rootPath}', range, localize('rootPath', "file path of the workspace (e.g. /Users/Development/myWorkspace)")));
completions.push(this.newSimpleCompletionItem('${folderName}', range, localize('folderName', "name of the workspace folder the file is contained in (e.g. myFolder)")));
completions.push(this.newSimpleCompletionItem('${folderPath}', range, localize('folderPath', "file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)")));
completions.push(this.newSimpleCompletionItem('${appName}', range, localize('appName', "e.g. VS Code")));
completions.push(this.newSimpleCompletionItem('${remoteName}', range, localize('remoteName', "e.g. SSH")));
completions.push(this.newSimpleCompletionItem('${dirty}', range, localize('dirty', "a dirty indicator if the active editor is dirty")));
completions.push(this.newSimpleCompletionItem('${separator}', range, localize('separator', "a conditional separator (' - ') that only shows when surrounded by variables with values")));
return Promise.resolve(completions);
}
private provideFilesAssociationsCompletionItems(location: Location, range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[]> {
const completions: vscode.CompletionItem[] = [];
if (location.path.length === 2) {
// Key
if (!location.isAtPropertyKey || location.path[1] === '') {
completions.push(this.newSnippetCompletionItem({
label: localize('assocLabelFile', "Files with Extension"),
documentation: localize('assocDescriptionFile', "Map all files matching the glob pattern in their filename to the language with the given identifier."),
snippet: location.isAtPropertyKey ? '"*.${1:extension}": "${2:language}"' : '{ "*.${1:extension}": "${2:language}" }',
range
}));
completions.push(this.newSnippetCompletionItem({
label: localize('assocLabelPath', "Files with Path"),
documentation: localize('assocDescriptionPath', "Map all files matching the absolute path glob pattern in their path to the language with the given identifier."),
snippet: location.isAtPropertyKey ? '"/${1:path to file}/*.${2:extension}": "${3:language}"' : '{ "/${1:path to file}/*.${2:extension}": "${3:language}" }',
range
}));
} else {
// Value
return this.provideLanguageCompletionItemsForLanguageOverrides(location, range);
}
}
return Promise.resolve(completions);
}
private provideExcludeCompletionItems(location: Location, range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[]> {
const completions: vscode.CompletionItem[] = [];
// Key
if (location.path.length === 1) {
completions.push(this.newSnippetCompletionItem({
label: localize('fileLabel', "Files by Extension"),
documentation: localize('fileDescription', "Match all files of a specific file extension."),
snippet: location.isAtPropertyKey ? '"**/*.${1:extension}": true' : '{ "**/*.${1:extension}": true }',
range
}));
completions.push(this.newSnippetCompletionItem({
label: localize('filesLabel', "Files with Multiple Extensions"),
documentation: localize('filesDescription', "Match all files with any of the file extensions."),
snippet: location.isAtPropertyKey ? '"**/*.{ext1,ext2,ext3}": true' : '{ "**/*.{ext1,ext2,ext3}": true }',
range
}));
completions.push(this.newSnippetCompletionItem({
label: localize('derivedLabel', "Files with Siblings by Name"),
documentation: localize('derivedDescription', "Match files that have siblings with the same name but a different extension."),
snippet: location.isAtPropertyKey ? '"**/*.${1:source-extension}": { "when": "$(basename).${2:target-extension}" }' : '{ "**/*.${1:source-extension}": { "when": "$(basename).${2:target-extension}" } }',
range
}));
completions.push(this.newSnippetCompletionItem({
label: localize('topFolderLabel', "Folder by Name (Top Level)"),
documentation: localize('topFolderDescription', "Match a top level folder with a specific name."),
snippet: location.isAtPropertyKey ? '"${1:name}": true' : '{ "${1:name}": true }',
range
}));
completions.push(this.newSnippetCompletionItem({
label: localize('topFoldersLabel', "Folders with Multiple Names (Top Level)"),
documentation: localize('topFoldersDescription', "Match multiple top level folders."),
snippet: location.isAtPropertyKey ? '"{folder1,folder2,folder3}": true' : '{ "{folder1,folder2,folder3}": true }',
range
}));
completions.push(this.newSnippetCompletionItem({
label: localize('folderLabel', "Folder by Name (Any Location)"),
documentation: localize('folderDescription', "Match a folder with a specific name in any location."),
snippet: location.isAtPropertyKey ? '"**/${1:name}": true' : '{ "**/${1:name}": true }',
range
}));
}
// Value
else {
completions.push(this.newSimpleCompletionItem('false', range, localize('falseDescription', "Disable the pattern.")));
completions.push(this.newSimpleCompletionItem('true', range, localize('trueDescription', "Enable the pattern.")));
completions.push(this.newSnippetCompletionItem({
label: localize('derivedLabel', "Files with Siblings by Name"),
documentation: localize('siblingsDescription', "Match files that have siblings with the same name but a different extension."),
snippet: '{ "when": "$(basename).${1:extension}" }',
range
}));
}
return Promise.resolve(completions);
}
private provideLanguageCompletionItems(_location: Location, range: vscode.Range, formatFunc: (string: string) => string = (l) => JSON.stringify(l)): Thenable<vscode.CompletionItem[]> {
return vscode.languages.getLanguages()
.then(languages => languages.map(l => this.newSimpleCompletionItem(formatFunc(l), range)));
}
private provideLanguageCompletionItemsForLanguageOverrides(_location: Location, range: vscode.Range, formatFunc: (string: string) => string = (l) => JSON.stringify(l)): Thenable<vscode.CompletionItem[]> {
return vscode.languages.getLanguages().then(languages => {
const completionItems = [];
const configuration = vscode.workspace.getConfiguration();
for (const language of languages) {
const inspect = configuration.inspect(`[${language}]`);
if (!inspect || !inspect.defaultValue) {
const item = new vscode.CompletionItem(formatFunc(language));
item.kind = vscode.CompletionItemKind.Property;
item.range = range;
completionItems.push(item);
}
}
return completionItems;
});
}
private provideLanguageOverridesCompletionItems(location: Location, position: vscode.Position): vscode.ProviderResult<vscode.CompletionItem[]> {
if (location.path.length === 0) {
let range = this.document.getWordRangeAtPosition(position, /^\s*\[.*]?/) || new vscode.Range(position, position);
let text = this.document.getText(range);
if (text && text.trim().startsWith('[')) {
range = new vscode.Range(new vscode.Position(range.start.line, range.start.character + text.indexOf('[')), range.end);
return this.provideLanguageCompletionItemsForLanguageOverrides(location, range, language => `"[${language}]"`);
}
range = this.document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
text = this.document.getText(range);
let snippet = '"[${1:language}]": {\n\t"$0"\n}';
// Suggestion model word matching includes quotes,
// hence exclude the starting quote from the snippet and the range
// ending quote gets replaced
if (text && text.startsWith('"')) {
range = new vscode.Range(new vscode.Position(range.start.line, range.start.character + 1), range.end);
snippet = snippet.substring(1);
}
return Promise.resolve([this.newSnippetCompletionItem({
label: localize('languageSpecificEditorSettings', "Language specific editor settings"),
documentation: localize('languageSpecificEditorSettingsDescription', "Override editor settings for language"),
snippet,
range
})]);
}
if (location.path.length === 1 && location.previousNode && typeof location.previousNode.value === 'string' && location.previousNode.value.startsWith('[')) {
// Suggestion model word matching includes closed sqaure bracket and ending quote
// Hence include them in the proposal to replace
const range = this.document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
return this.provideLanguageCompletionItemsForLanguageOverrides(location, range, language => `"[${language}]"`);
}
return Promise.resolve([]);
}
private newSimpleCompletionItem(text: string, range: vscode.Range, description?: string, insertText?: string): vscode.CompletionItem {
const item = new vscode.CompletionItem(text);
item.kind = vscode.CompletionItemKind.Value;
item.detail = description;
item.insertText = insertText ? insertText : text;
item.range = range;
return item;
}
private newSnippetCompletionItem(o: { label: string; documentation?: string; snippet: string; range: vscode.Range; }): vscode.CompletionItem {
const item = new vscode.CompletionItem(o.label);
item.kind = vscode.CompletionItemKind.Value;
item.documentation = o.documentation;
item.insertText = new vscode.SnippetString(o.snippet);
item.range = o.range;
return item;
}
}

View File

@ -0,0 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>

View File

@ -0,0 +1,9 @@
{
"extends": "../shared.tsconfig.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}

View File

@ -0,0 +1,18 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/node@^12.11.7":
version "12.11.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.11.7.tgz#57682a9771a3f7b09c2497f28129a0462966524a"
integrity sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==
jsonc-parser@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc"
integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w==
vscode-nls@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==

View File

@ -0,0 +1,3 @@
build/**
test/**
cgmanifest.json

View File

@ -0,0 +1,15 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
var updateGrammar = require('../../../build/npm/update-grammar');
updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/c.tmLanguage.json', './syntaxes/c.tmLanguage.json', undefined, 'master', 'source/languages/cpp/');
updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/cpp.tmLanguage.json', './syntaxes/cpp.tmLanguage.json', undefined, 'master', 'source/languages/cpp/');
updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/cpp.embedded.macro.tmLanguage.json', './syntaxes/cpp.embedded.macro.tmLanguage.json', undefined, 'master', 'source/languages/cpp/');
// `source.c.platform` which is still included by other grammars
updateGrammar.update('textmate/c.tmbundle', 'Syntaxes/Platform.tmLanguage', './syntaxes/platform.tmLanguage.json');

View File

@ -0,0 +1,45 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "jeff-hykin/cpp-textmate-grammar",
"repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar",
"commitHash": "666808cab3907fc91ed4d3901060ee6b045cca58"
}
},
"license": "MIT",
"version": "1.14.15",
"description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
},
{
"component": {
"type": "git",
"git": {
"name": "textmate/c.tmbundle",
"repositoryUrl": "https://github.com/textmate/c.tmbundle",
"commitHash": "60daf83b9d45329524f7847a75e9298b3aae5805"
}
},
"licenseDetail": [
"Copyright (c) textmate-c.tmbundle authors",
"",
"If not otherwise specified (see below), files in this repository fall under the following license:",
"",
"Permission to copy, use, modify, sell and distribute this",
"software is granted. This software is provided \"as is\" without",
"express or implied warranty, and with no claim as to its",
"suitability for any purpose.",
"",
"An exception is made for files in readable text which contain their own license information,",
"or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added",
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
"\"tidy\" is accompanied by \"tidy-license.txt\"."
],
"license": "TextMate Bundle License",
"version": "0.0.0"
}
],
"version": 1
}

View File

@ -0,0 +1,32 @@
{
"comments": {
"lineComment": "//",
"blockComment": ["/*", "*/"]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "[", "close": "]" },
{ "open": "{", "close": "}" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"],
["<", ">"]
],
"folding": {
"markers": {
"start": "^\\s*#pragma\\s+region\\b",
"end": "^\\s*#pragma\\s+endregion\\b"
}
}
}

View File

@ -0,0 +1,87 @@
{
"name": "cpp",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "*"
},
"scripts": {
"update-grammar": "node ./build/update-grammars.js"
},
"contributes": {
"languages": [
{
"id": "c",
"extensions": [
".c",
".i"
],
"aliases": [
"C",
"c"
],
"configuration": "./language-configuration.json"
},
{
"id": "cpp",
"extensions": [
".cpp",
".cc",
".cxx",
".c++",
".hpp",
".hh",
".hxx",
".h++",
".h",
".ii",
".ino",
".inl",
".ipp",
".hpp.in",
".h.in"
],
"aliases": [
"C++",
"Cpp",
"cpp"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "c",
"scopeName": "source.c",
"path": "./syntaxes/c.tmLanguage.json"
},
{
"language": "cpp",
"scopeName": "source.cpp.embedded.macro",
"path": "./syntaxes/cpp.embedded.macro.tmLanguage.json"
},
{
"language": "cpp",
"scopeName": "source.cpp",
"path": "./syntaxes/cpp.tmLanguage.json"
},
{
"scopeName": "source.c.platform",
"path": "./syntaxes/platform.tmLanguage.json"
}
],
"snippets": [
{
"language": "c",
"path": "./snippets/c.code-snippets"
},
{
"language": "cpp",
"path": "./snippets/cpp.code-snippets"
}
]
}
}

View File

@ -0,0 +1,4 @@
{
"displayName": "C/C++ Language Basics",
"description": "Provides snippets, syntax highlighting, bracket matching and folding in C/C++ files."
}

View File

@ -0,0 +1,16 @@
{
"Region Start": {
"prefix": "#region",
"body": [
"#pragma region $0"
],
"description": "Folding Region Start"
},
"Region End": {
"prefix": "#endregion",
"body": [
"#pragma endregion"
],
"description": "Folding Region End"
}
}

View File

@ -0,0 +1,16 @@
{
"Region Start": {
"prefix": "#region",
"body": [
"#pragma region $0"
],
"description": "Folding Region Start"
},
"Region End": {
"prefix": "#endregion",
"body": [
"#pragma endregion"
],
"description": "Folding Region End"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
#ifndef _UCRT
#define _UCRT
#endif

View File

@ -0,0 +1,3 @@
#ifndef _UCRT
#define _UCRT
#endif

View File

@ -0,0 +1,13 @@
#define DOCTEST_IMPLEMENT_FIXTURE(der, base, func, decorators) \
namespace { \
struct der : public base \
{ \
void f(); \
}; \
static void func() { \
der v; \
v.f(); \
} \
DOCTEST_REGISTER_FUNCTION(DOCTEST_EMPTY, func, decorators) \
} \
inline DOCTEST_NOINLINE void der::f()

View File

@ -0,0 +1,10 @@
struct Foo {
Foo();
int a;
int b;
int c;
};
Foo::Foo()
: a(1),
// b(2),
c(3) {}

View File

@ -0,0 +1,3 @@
std::tuple_element<0, std::pair<pugi::xml_node, std::map<std::basic_string<char>, pugi::xml_node, std::less<std::basic_string<char> >, std::allocator<std::pair<const std::basic_string<char>, pugi::xml_node> > > > >::type dnode
std::_Rb_tree_iterator<std::pair<const long, std::pair<pugi::xml_node, std::map<std::basic_string<char>, pugi::xml_node, std::less<std::basic_string<char> >, std::allocator<std::pair<const std::basic_string<char>, pugi::xml_node> > > > > > dnode_it = dnodes_.find(uid.position)

View File

@ -0,0 +1,30 @@
/* C Program to find roots of a quadratic equation when coefficients are entered by user. */
/* Library function sqrt() computes the square root. */
#include <stdio.h>
#include <math.h> /* This is needed to use sqrt() function.*/
int main()
{
float a, b, c, determinant, r1,r2, real, imag;
printf("Enter coefficients a, b and c: ");
scanf("%f%f%f",&a,&b,&c);
determinant=b*b-4*a*c;
if (determinant>0)
{
r1= (-b+sqrt(determinant))/(2*a);
r2= (-b-sqrt(determinant))/(2*a);
printf("Roots are: %.2f and %.2f",r1 , r2);
}
else if (determinant==0)
{
r1 = r2 = -b/(2*a);
printf("Roots are: %.2f and %.2f", r1, r2);
}
else
{
real= -b/(2*a);
imag = sqrt(-determinant)/(2*a);
printf("Roots are: %.2f+%.2fi and %.2f-%.2fi", real, imag, real, imag);
}
return 0;
}

View File

@ -0,0 +1,27 @@
#if B4G_DEBUG_CHECK
fprintf(stderr,"num_candidate_ret=%d:", num_candidate);
for(int i=0;i<num_candidate;++i)
fprintf(stderr,"%d,",user_candidate[i]);
fprintf(stderr,";");
#endif
void main(O obj) {
LOG_INFO("not hilighted as string");
LOG_INFO(obj << ", even worse; " << obj.x << " check this out.");
// everything from this point on is interpeted as a string literal...
O x;
std::unique_ptr<O> o(new O);
// sadness.
sprintf(options, "STYLE=Keramik;TITLE=%s;THEME=%s", ...);
}
int main2() {
printf(";");
// the rest of
asm("movw $0x38, %ax; ltr %ax");
fn("{};");
// the rest of
}

View File

@ -0,0 +1,33 @@
// classes example
#include <iostream>
using namespace std;
#define EXTERN_C extern "C"
class Rectangle {
int width, height;
public:
void set_values (int,int);
int area() {return width*height;}
};
void Rectangle::set_values (int x, int y) {
width = x;
height = y;
}
long double operator "" _w(long double);
#define MY_MACRO(a, b)
int main () {
1.2_w; // calls operator "" _w(1.2L)
asm("movl %a %b");
MY_MACRO(1, 2);
Rectangle rect;
rect.set_values (3,4);
cout << "area: " << rect.area();
Task<ANY_OUTPUT_TYPE, ANY_INPUT_TYPE>::links_to;
int t = 2;
if (t > 0) puts("\n*************************************************");
return 0;
}

View File

@ -0,0 +1,123 @@
[
{
"c": "#",
"t": "source.cpp keyword.control.directive.conditional.ifndef.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "ifndef",
"t": "source.cpp keyword.control.directive.conditional.ifndef.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.cpp meta.preprocessor.conditional.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "meta.preprocessor: #569CD6"
}
},
{
"c": "_UCRT",
"t": "source.cpp meta.preprocessor.conditional.cpp entity.name.function.preprocessor.cpp",
"r": {
"dark_plus": "entity.name.function.preprocessor: #569CD6",
"light_plus": "entity.name.function.preprocessor: #0000FF",
"dark_vs": "entity.name.function.preprocessor: #569CD6",
"light_vs": "entity.name.function.preprocessor: #0000FF",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": " ",
"t": "source.cpp meta.preprocessor.macro.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "meta.preprocessor: #569CD6"
}
},
{
"c": "#",
"t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "define",
"t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.cpp meta.preprocessor.macro.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "meta.preprocessor: #569CD6"
}
},
{
"c": "_UCRT",
"t": "source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp",
"r": {
"dark_plus": "entity.name.function.preprocessor: #569CD6",
"light_plus": "entity.name.function.preprocessor: #0000FF",
"dark_vs": "entity.name.function.preprocessor: #569CD6",
"light_vs": "entity.name.function.preprocessor: #0000FF",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": "#",
"t": "source.cpp keyword.control.directive.endif.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "endif",
"t": "source.cpp keyword.control.directive.endif.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
}
]

View File

@ -0,0 +1,112 @@
[
{
"c": "#",
"t": "source.cpp keyword.control.directive.conditional.ifndef.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "ifndef",
"t": "source.cpp keyword.control.directive.conditional.ifndef.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.cpp meta.preprocessor.conditional.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "meta.preprocessor: #569CD6"
}
},
{
"c": "_UCRT",
"t": "source.cpp meta.preprocessor.conditional.cpp entity.name.function.preprocessor.cpp",
"r": {
"dark_plus": "entity.name.function.preprocessor: #569CD6",
"light_plus": "entity.name.function.preprocessor: #0000FF",
"dark_vs": "entity.name.function.preprocessor: #569CD6",
"light_vs": "entity.name.function.preprocessor: #0000FF",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": "#",
"t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "define",
"t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": " ",
"t": "source.cpp meta.preprocessor.macro.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
"dark_vs": "meta.preprocessor: #569CD6",
"light_vs": "meta.preprocessor: #0000FF",
"hc_black": "meta.preprocessor: #569CD6"
}
},
{
"c": "_UCRT",
"t": "source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp",
"r": {
"dark_plus": "entity.name.function.preprocessor: #569CD6",
"light_plus": "entity.name.function.preprocessor: #0000FF",
"dark_vs": "entity.name.function.preprocessor: #569CD6",
"light_vs": "entity.name.function.preprocessor: #0000FF",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": "#",
"t": "source.cpp keyword.control.directive.endif.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
},
{
"c": "endif",
"t": "source.cpp keyword.control.directive.endif.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
"dark_vs": "keyword.control: #569CD6",
"light_vs": "keyword.control: #0000FF",
"hc_black": "keyword.control: #C586C0"
}
}
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,530 @@
[
{
"c": "struct",
"t": "source.cpp meta.block.struct.cpp meta.head.struct.cpp storage.type.struct.cpp",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
"dark_vs": "storage.type: #569CD6",
"light_vs": "storage.type: #0000FF",
"hc_black": "storage.type: #569CD6"
}
},
{
"c": " ",
"t": "source.cpp meta.block.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "Foo",
"t": "source.cpp meta.block.struct.cpp meta.head.struct.cpp entity.name.type.struct.cpp",
"r": {
"dark_plus": "entity.name.type: #4EC9B0",
"light_plus": "entity.name.type: #267F99",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "entity.name.type: #4EC9B0"
}
},
{
"c": " ",
"t": "source.cpp meta.block.struct.cpp meta.head.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "{",
"t": "source.cpp meta.block.struct.cpp meta.head.struct.cpp punctuation.section.block.begin.bracket.curly.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp meta.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "Foo",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp entity.name.function.constructor.cpp entity.name.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": "(",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.parameters.begin.bracket.round.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ")",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.parameters.end.bracket.round.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ";",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp punctuation.terminator.statement.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "int",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
"dark_vs": "storage.type: #569CD6",
"light_vs": "storage.type: #0000FF",
"hc_black": "storage.type: #569CD6"
}
},
{
"c": " a",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ";",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp punctuation.terminator.statement.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "int",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
"dark_vs": "storage.type: #569CD6",
"light_vs": "storage.type: #0000FF",
"hc_black": "storage.type: #569CD6"
}
},
{
"c": " b",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ";",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp punctuation.terminator.statement.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "int",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
"dark_vs": "storage.type: #569CD6",
"light_vs": "storage.type: #0000FF",
"hc_black": "storage.type: #569CD6"
}
},
{
"c": " c",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ";",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp punctuation.terminator.statement.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "}",
"t": "source.cpp meta.block.struct.cpp meta.body.struct.cpp punctuation.section.block.end.bracket.curly.struct.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ";",
"t": "source.cpp meta.block.struct.cpp punctuation.terminator.statement.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "Foo",
"t": "source.cpp meta.function.definition.special.constructor.cpp entity.name.type.constructor.cpp",
"r": {
"dark_plus": "entity.name.type: #4EC9B0",
"light_plus": "entity.name.type: #267F99",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "entity.name.type: #4EC9B0"
}
},
{
"c": "::",
"t": "source.cpp meta.function.definition.special.constructor.cpp punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "Foo",
"t": "source.cpp meta.function.definition.special.constructor.cpp entity.name.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": "(",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.parameters.begin.bracket.round.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ")",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.parameters.end.bracket.round.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ":",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.separator.initializers.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "a",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp entity.name.function.call.initializer.cpp",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": "(",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.arguments.begin.bracket.round.function.call.initializer.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "1",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp meta.parameter.initialization.cpp constant.numeric.decimal.cpp",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
"dark_vs": "constant.numeric: #B5CEA8",
"light_vs": "constant.numeric: #098658",
"hc_black": "constant.numeric: #B5CEA8"
}
},
{
"c": ")",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.arguments.end.bracket.round.function.call.initializer.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": ",",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.separator.delimiter.comma.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp comment.line.double-slash.cpp",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "//",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " b(2),",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp comment.line.double-slash.cpp",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " ",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "c",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp entity.name.function.call.initializer.cpp",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "entity.name.function: #DCDCAA"
}
},
{
"c": "(",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.arguments.begin.bracket.round.function.call.initializer.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "3",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp meta.parameter.initialization.cpp constant.numeric.decimal.cpp",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #098658",
"dark_vs": "constant.numeric: #B5CEA8",
"light_vs": "constant.numeric: #098658",
"hc_black": "constant.numeric: #B5CEA8"
}
},
{
"c": ")",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.arguments.end.bracket.round.function.call.initializer.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "{",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp punctuation.section.block.begin.bracket.curly.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "}",
"t": "source.cpp meta.function.definition.special.constructor.cpp meta.body.function.definition.special.constructor.cpp punctuation.section.block.end.bracket.curly.function.definition.special.constructor.cpp",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
test/**
cgmanifest.json

View File

@ -0,0 +1,18 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "dotnet/csharp-tmLanguage",
"repositoryUrl": "https://github.com/dotnet/csharp-tmLanguage",
"commitHash": "572697a2c2267430010b3534281f73337144e94f"
}
},
"license": "MIT",
"version": "0.1.0",
"description": "The file syntaxes/csharp.tmLanguage.json was derived from https://github.com/dotnet/csharp-tmLanguage"
}
],
"version": 1
}

View File

@ -0,0 +1,32 @@
{
"comments": {
"lineComment": "//",
"blockComment": ["/*", "*/"]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"],
["'", "'"],
["\"", "\""]
],
"folding": {
"markers": {
"start": "^\\s*#region\\b",
"end": "^\\s*#endregion\\b"
}
}
}

View File

@ -0,0 +1,43 @@
{
"name": "csharp",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "0.10.x"
},
"scripts": {
"update-grammar": "node ../../build/npm/update-grammar.js dotnet/csharp-tmLanguage grammars/csharp.tmLanguage ./syntaxes/csharp.tmLanguage.json"
},
"contributes": {
"languages": [
{
"id": "csharp",
"extensions": [
".cs",
".csx",
".cake"
],
"aliases": [
"C#",
"csharp"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "csharp",
"scopeName": "source.cs",
"path": "./syntaxes/csharp.tmLanguage.json"
}
],
"snippets": [{
"language": "csharp",
"path": "./snippets/csharp.code-snippets"
}]
}
}

View File

@ -0,0 +1,4 @@
{
"displayName": "C# Language Basics",
"description": "Provides snippets, syntax highlighting, bracket matching and folding in C# files."
}

View File

@ -0,0 +1,16 @@
{
"Region Start": {
"prefix": "#region",
"body": [
"#region $0"
],
"description": "Folding Region Start"
},
"Region End": {
"prefix": "#endregion",
"body": [
"#endregion"
],
"description": "Folding Region End"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
using System;
namespace SampleNamespace
{
class TestClass
{
static void Main(string[] args)
{
int[] radii = { 15, 32, 108, 74, 9 };
const double pi = 3.14159;
foreach (int radius in radii) {
double circumference = pi * (2 * radius);
// Display the number of command line arguments:
System.Console.WriteLine("Circumference = {0:N2}", circumference);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
{
"version": "0.2.0",
"compounds": [
{
"name": "Debug Extension and Language Server",
"configurations": [
"Launch Extension",
"Attach Language Server"
]
}
],
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/client/out/**/*.js"
],
"smartStep": true
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/client/out/test"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/client/out/test/**/*.js"
]
},
{
"name": "Attach Language Server",
"type": "node",
"request": "attach",
"protocol": "inspector",
"port": 6044,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/server/out/**/*.js"
],
"smartStep": true,
"restart": true
},
{
"name": "Server Unit Tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"--timeout",
"999999",
"--colors"
],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"runtimeArgs": [],
"env": {},
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/server/out/**"
]
}
]
}

View File

@ -0,0 +1,5 @@
{
"prettier.semi": true,
"prettier.singleQuote": true,
"prettier.printWidth": 120,
}

View File

@ -0,0 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View File

@ -0,0 +1,21 @@
test/**
.vscode/**
server/.vscode/**
server/node_modules/**
client/src/**
server/src/**
client/out/**
server/out/**
client/tsconfig.json
server/tsconfig.json
server/test/**
server/bin/**
server/build/**
server/yarn.lock
server/.npmignore
yarn.lock
server/extension.webpack.config.js
extension.webpack.config.js
server/extension-browser.webpack.config.js
extension-browser.webpack.config.js
CONTRIBUTING.md

View File

@ -0,0 +1,39 @@
## Setup
- Clone [microsoft/vscode](https://github.com/microsoft/vscode)
- Run `yarn` at `/`, this will install
- Dependencies for `/extension/css-language-features/`
- Dependencies for `/extension/css-language-features/server/`
- devDependencies such as `gulp`
- Open `/extensions/css-language-features/` as the workspace in VS Code
- Run the [`Launch Extension`](https://github.com/microsoft/vscode/blob/master/extensions/css-language-features/.vscode/launch.json) debug target in the Debug View. This will:
- Launch the `preLaunchTask` task to compile the extension
- Launch a new VS Code instance with the `css-language-features` extension loaded
- You should see a notification saying the development version of `css-language-features` overwrites the bundled version of `css-language-features`
- Test the behavior of this extension by editing CSS/SCSS/Less files
- Run `Reload Window` command in the launched instance to reload the extension
### Contribute to vscode-css-languageservice
[microsoft/vscode-css-languageservice](https://github.com/microsoft/vscode-css-languageservice) contains the language smarts for CSS/SCSS/Less.
This extension wraps the css language service into a Language Server for VS Code.
If you want to fix CSS/SCSS/Less issues or make improvements, you should make changes at [microsoft/vscode-css-languageservice](https://github.com/microsoft/vscode-css-languageservice).
However, within this extension, you can run a development version of `vscode-css-languageservice` to debug code or test language features interactively:
#### Linking `vscode-css-languageservice` in `css-language-features/server/`
- Clone [microsoft/vscode-css-languageservice](https://github.com/microsoft/vscode-css-languageservice)
- Run `yarn` in `vscode-css-languageservice`
- Run `yarn link` in `vscode-css-languageservice`. This will compile and link `vscode-css-languageservice`
- In `css-language-features/server/`, run `yarn link vscode-css-languageservice`
#### Testing the development version of `vscode-css-languageservice`
- Open both `vscode-css-languageservice` and this extension in a single workspace with [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) feature
- Run `yarn watch` in `vscode-css-languageservice` to recompile the extension whenever it changes
- Run `yarn watch` at `css-language-features/server/` to recompile this extension with the linked version of `vscode-css-languageservice`
- Make some changes in `vscode-css-languageservice`
- Now when you run `Launch Extension` debug target, the launched instance will use your development version of `vscode-css-languageservice`. You can interactively test the language features.
- You can also run the `Debug Extension and Language Server` debug target, which will launch the extension and attach the debugger to the language server. After successful attach, you should be able to hit breakpoints in both `vscode-css-languageservice` and `css-language-features/server/`

View File

@ -0,0 +1,9 @@
# Language Features for CSS, SCSS, and LESS files
**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
## Features
See [CSS, SCSS and Less in VS Code](https://code.visualstudio.com/docs/languages/css) to learn about the features of this extension.
Please read the [CONTRIBUTING.md](https://github.com/microsoft/vscode/blob/master/extensions/css-language-features/CONTRIBUTING.md) file to learn how to contribute to this extension.

View File

@ -0,0 +1,32 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ExtensionContext, Uri } from 'vscode';
import { LanguageClientOptions } from 'vscode-languageclient';
import { startClient, LanguageClientConstructor } from '../cssClient';
import { LanguageClient } from 'vscode-languageclient/browser';
declare const Worker: {
new(stringUrl: string): any;
};
declare const TextDecoder: {
new(encoding?: string): { decode(buffer: ArrayBuffer): string; };
};
// this method is called when vs code is activated
export function activate(context: ExtensionContext) {
const serverMain = Uri.joinPath(context.extensionUri, 'server/dist/browser/cssServerMain.js');
try {
const worker = new Worker(serverMain.toString());
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
return new LanguageClient(id, name, clientOptions, worker);
};
startClient(context, newLanguageClient, { TextDecoder });
} catch (e) {
console.log(e);
}
}

View File

@ -0,0 +1,166 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { commands, CompletionItem, CompletionItemKind, ExtensionContext, languages, Position, Range, SnippetString, TextEdit, window, TextDocument, CompletionContext, CancellationToken, ProviderResult, CompletionList } from 'vscode';
import { Disposable, LanguageClientOptions, ProvideCompletionItemsSignature, NotificationType, CommonLanguageClient } from 'vscode-languageclient';
import * as nls from 'vscode-nls';
import { getCustomDataSource } from './customData';
import { RequestService, serveFileSystemRequests } from './requests';
namespace CustomDataChangedNotification {
export const type: NotificationType<string[]> = new NotificationType('css/customDataChanged');
}
const localize = nls.loadMessageBundle();
export type LanguageClientConstructor = (name: string, description: string, clientOptions: LanguageClientOptions) => CommonLanguageClient;
export interface Runtime {
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string; } };
fs?: RequestService;
}
export function startClient(context: ExtensionContext, newLanguageClient: LanguageClientConstructor, runtime: Runtime) {
const customDataSource = getCustomDataSource(context.subscriptions);
let documentSelector = ['css', 'scss', 'less'];
// Options to control the language client
let clientOptions: LanguageClientOptions = {
documentSelector,
synchronize: {
configurationSection: ['css', 'scss', 'less']
},
initializationOptions: {
handledSchemas: ['file']
},
middleware: {
provideCompletionItem(document: TextDocument, position: Position, context: CompletionContext, token: CancellationToken, next: ProvideCompletionItemsSignature): ProviderResult<CompletionItem[] | CompletionList> {
// testing the replace / insert mode
function updateRanges(item: CompletionItem) {
const range = item.range;
if (range instanceof Range && range.end.isAfter(position) && range.start.isBeforeOrEqual(position)) {
item.range = { inserting: new Range(range.start, position), replacing: range };
}
}
function updateLabel(item: CompletionItem) {
if (item.kind === CompletionItemKind.Color) {
item.label2 = {
name: item.label,
type: (item.documentation as string)
};
}
}
// testing the new completion
function updateProposals(r: CompletionItem[] | CompletionList | null | undefined): CompletionItem[] | CompletionList | null | undefined {
if (r) {
(Array.isArray(r) ? r : r.items).forEach(updateRanges);
(Array.isArray(r) ? r : r.items).forEach(updateLabel);
}
return r;
}
const isThenable = <T>(obj: ProviderResult<T>): obj is Thenable<T> => obj && (<any>obj)['then'];
const r = next(document, position, context, token);
if (isThenable<CompletionItem[] | CompletionList | null | undefined>(r)) {
return r.then(updateProposals);
}
return updateProposals(r);
}
}
};
// Create the language client and start the client.
let client = newLanguageClient('css', localize('cssserver.name', 'CSS Language Server'), clientOptions);
client.registerProposedFeatures();
client.onReady().then(() => {
client.sendNotification(CustomDataChangedNotification.type, customDataSource.uris);
customDataSource.onDidChange(() => {
client.sendNotification(CustomDataChangedNotification.type, customDataSource.uris);
});
serveFileSystemRequests(client, runtime);
});
let disposable = client.start();
// Push the disposable to the context's subscriptions so that the
// client can be deactivated on extension deactivation
context.subscriptions.push(disposable);
let indentationRules = {
increaseIndentPattern: /(^.*\{[^}]*$)/,
decreaseIndentPattern: /^\s*\}/
};
languages.setLanguageConfiguration('css', {
wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g,
indentationRules: indentationRules
});
languages.setLanguageConfiguration('less', {
wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]+(?=[^,{;]*[,{]))|(([@#.!])?[\w-?]+%?|[@#!.])/g,
indentationRules: indentationRules
});
languages.setLanguageConfiguration('scss', {
wordPattern: /(#?-?\d*\.\d\w*%?)|(::?[\w-]*(?=[^,{;]*[,{]))|(([@$#.!])?[\w-?]+%?|[@#!$.])/g,
indentationRules: indentationRules
});
client.onReady().then(() => {
context.subscriptions.push(initCompletionProvider());
});
function initCompletionProvider(): Disposable {
const regionCompletionRegExpr = /^(\s*)(\/(\*\s*(#\w*)?)?)?$/;
return languages.registerCompletionItemProvider(documentSelector, {
provideCompletionItems(doc: TextDocument, pos: Position) {
let lineUntilPos = doc.getText(new Range(new Position(pos.line, 0), pos));
let match = lineUntilPos.match(regionCompletionRegExpr);
if (match) {
let range = new Range(new Position(pos.line, match[1].length), pos);
let beginProposal = new CompletionItem('#region', CompletionItemKind.Snippet);
beginProposal.range = range; TextEdit.replace(range, '/* #region */');
beginProposal.insertText = new SnippetString('/* #region $1*/');
beginProposal.documentation = localize('folding.start', 'Folding Region Start');
beginProposal.filterText = match[2];
beginProposal.sortText = 'za';
let endProposal = new CompletionItem('#endregion', CompletionItemKind.Snippet);
endProposal.range = range;
endProposal.insertText = '/* #endregion */';
endProposal.documentation = localize('folding.end', 'Folding Region End');
endProposal.sortText = 'zb';
endProposal.filterText = match[2];
return [beginProposal, endProposal];
}
return null;
}
});
}
commands.registerCommand('_css.applyCodeAction', applyCodeAction);
function applyCodeAction(uri: string, documentVersion: number, edits: TextEdit[]) {
let textEditor = window.activeTextEditor;
if (textEditor && textEditor.document.uri.toString() === uri) {
if (textEditor.document.version !== documentVersion) {
window.showInformationMessage(`CSS fix is outdated and can't be applied to the document.`);
}
textEditor.edit(mutator => {
for (let edit of edits) {
mutator.replace(client.protocol2CodeConverter.asRange(edit.range), edit.newText);
}
}).then(success => {
if (!success) {
window.showErrorMessage('Failed to apply CSS fix to the document. Please consider opening an issue with steps to reproduce.');
}
});
}
}
}

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { workspace, extensions, Uri, EventEmitter, Disposable } from 'vscode';
import { resolvePath, joinPath } from './requests';
export function getCustomDataSource(toDispose: Disposable[]) {
let pathsInWorkspace = getCustomDataPathsInAllWorkspaces();
let pathsInExtensions = getCustomDataPathsFromAllExtensions();
const onChange = new EventEmitter<void>();
toDispose.push(extensions.onDidChange(_ => {
const newPathsInExtensions = getCustomDataPathsFromAllExtensions();
if (newPathsInExtensions.length !== pathsInExtensions.length || !newPathsInExtensions.every((val, idx) => val === pathsInExtensions[idx])) {
pathsInExtensions = newPathsInExtensions;
onChange.fire();
}
}));
toDispose.push(workspace.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('css.customData')) {
pathsInWorkspace = getCustomDataPathsInAllWorkspaces();
onChange.fire();
}
}));
return {
get uris() {
return pathsInWorkspace.concat(pathsInExtensions);
},
get onDidChange() {
return onChange.event;
}
};
}
function getCustomDataPathsInAllWorkspaces(): string[] {
const workspaceFolders = workspace.workspaceFolders;
const dataPaths: string[] = [];
if (!workspaceFolders) {
return dataPaths;
}
const collect = (paths: string[] | undefined, rootFolder: Uri) => {
if (Array.isArray(paths)) {
for (const path of paths) {
if (typeof path === 'string') {
dataPaths.push(resolvePath(rootFolder, path).toString());
}
}
}
};
for (let i = 0; i < workspaceFolders.length; i++) {
const folderUri = workspaceFolders[i].uri;
const allCssConfig = workspace.getConfiguration('css', folderUri);
const customDataInspect = allCssConfig.inspect<string[]>('customData');
if (customDataInspect) {
collect(customDataInspect.workspaceFolderValue, folderUri);
if (i === 0) {
if (workspace.workspaceFile) {
collect(customDataInspect.workspaceValue, workspace.workspaceFile);
}
collect(customDataInspect.globalValue, folderUri);
}
}
}
return dataPaths;
}
function getCustomDataPathsFromAllExtensions(): string[] {
const dataPaths: string[] = [];
for (const extension of extensions.all) {
const customData = extension.packageJSON?.contributes?.css?.customData;
if (Array.isArray(customData)) {
for (const rp of customData) {
dataPaths.push(joinPath(extension.extensionUri, rp).toString());
}
}
}
return dataPaths;
}

View File

@ -0,0 +1,35 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { getNodeFSRequestService } from './nodeFs';
import { ExtensionContext, extensions } from 'vscode';
import { startClient, LanguageClientConstructor } from '../cssClient';
import { ServerOptions, TransportKind, LanguageClientOptions, LanguageClient } from 'vscode-languageclient/node';
import { TextDecoder } from 'util';
// this method is called when vs code is activated
export function activate(context: ExtensionContext) {
const clientMain = extensions.getExtension('vscode.css-language-features')?.packageJSON?.main || '';
const serverMain = `./server/${clientMain.indexOf('/dist/') !== -1 ? 'dist' : 'out'}/node/cssServerMain`;
const serverModule = context.asAbsolutePath(serverMain);
// The debug options for the server
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
const serverOptions: ServerOptions = {
run: { module: serverModule, transport: TransportKind.ipc },
debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
};
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
return new LanguageClient(id, name, serverOptions, clientOptions);
};
startClient(context, newLanguageClient, { fs: getNodeFSRequestService(), TextDecoder });
}

View File

@ -0,0 +1,85 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as fs from 'fs';
import { Uri } from 'vscode';
import { getScheme, RequestService, FileType } from '../requests';
export function getNodeFSRequestService(): RequestService {
function ensureFileUri(location: string) {
if (getScheme(location) !== 'file') {
throw new Error('fileRequestService can only handle file URLs');
}
}
return {
getContent(location: string, encoding?: string) {
ensureFileUri(location);
return new Promise((c, e) => {
const uri = Uri.parse(location);
fs.readFile(uri.fsPath, encoding, (err, buf) => {
if (err) {
return e(err);
}
c(buf.toString());
});
});
},
stat(location: string) {
ensureFileUri(location);
return new Promise((c, e) => {
const uri = Uri.parse(location);
fs.stat(uri.fsPath, (err, stats) => {
if (err) {
if (err.code === 'ENOENT') {
return c({ type: FileType.Unknown, ctime: -1, mtime: -1, size: -1 });
} else {
return e(err);
}
}
let type = FileType.Unknown;
if (stats.isFile()) {
type = FileType.File;
} else if (stats.isDirectory()) {
type = FileType.Directory;
} else if (stats.isSymbolicLink()) {
type = FileType.SymbolicLink;
}
c({
type,
ctime: stats.ctime.getTime(),
mtime: stats.mtime.getTime(),
size: stats.size
});
});
});
},
readDirectory(location: string) {
ensureFileUri(location);
return new Promise((c, e) => {
const path = Uri.parse(location).fsPath;
fs.readdir(path, { withFileTypes: true }, (err, children) => {
if (err) {
return e(err);
}
c(children.map(stat => {
if (stat.isSymbolicLink()) {
return [stat.name, FileType.SymbolicLink];
} else if (stat.isDirectory()) {
return [stat.name, FileType.Directory];
} else if (stat.isFile()) {
return [stat.name, FileType.File];
} else {
return [stat.name, FileType.Unknown];
}
}));
});
});
}
};
}

View File

@ -0,0 +1,148 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Uri, workspace } from 'vscode';
import { RequestType, CommonLanguageClient } from 'vscode-languageclient';
import { Runtime } from './cssClient';
export namespace FsContentRequest {
export const type: RequestType<{ uri: string; encoding?: string; }, string, any, any> = new RequestType('fs/content');
}
export namespace FsStatRequest {
export const type: RequestType<string, FileStat, any, any> = new RequestType('fs/stat');
}
export namespace FsReadDirRequest {
export const type: RequestType<string, [string, FileType][], any, any> = new RequestType('fs/readDir');
}
export function serveFileSystemRequests(client: CommonLanguageClient, runtime: Runtime) {
client.onRequest(FsContentRequest.type, (param: { uri: string; encoding?: string; }) => {
const uri = Uri.parse(param.uri);
if (uri.scheme === 'file' && runtime.fs) {
return runtime.fs.getContent(param.uri);
}
return workspace.fs.readFile(uri).then(buffer => {
return new runtime.TextDecoder(param.encoding).decode(buffer);
});
});
client.onRequest(FsReadDirRequest.type, (uriString: string) => {
const uri = Uri.parse(uriString);
if (uri.scheme === 'file' && runtime.fs) {
return runtime.fs.readDirectory(uriString);
}
return workspace.fs.readDirectory(uri);
});
client.onRequest(FsStatRequest.type, (uriString: string) => {
const uri = Uri.parse(uriString);
if (uri.scheme === 'file' && runtime.fs) {
return runtime.fs.stat(uriString);
}
return workspace.fs.stat(uri);
});
}
export enum FileType {
/**
* The file type is unknown.
*/
Unknown = 0,
/**
* A regular file.
*/
File = 1,
/**
* A directory.
*/
Directory = 2,
/**
* A symbolic link to a file.
*/
SymbolicLink = 64
}
export interface FileStat {
/**
* The type of the file, e.g. is a regular file, a directory, or symbolic link
* to a file.
*/
type: FileType;
/**
* The creation timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.
*/
ctime: number;
/**
* The modification timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.
*/
mtime: number;
/**
* The size in bytes.
*/
size: number;
}
export interface RequestService {
getContent(uri: string, encoding?: string): Promise<string>;
stat(uri: string): Promise<FileStat>;
readDirectory(uri: string): Promise<[string, FileType][]>;
}
export function getScheme(uri: string) {
return uri.substr(0, uri.indexOf(':'));
}
export function dirname(uri: string) {
const lastIndexOfSlash = uri.lastIndexOf('/');
return lastIndexOfSlash !== -1 ? uri.substr(0, lastIndexOfSlash) : '';
}
export function basename(uri: string) {
const lastIndexOfSlash = uri.lastIndexOf('/');
return uri.substr(lastIndexOfSlash + 1);
}
const Slash = '/'.charCodeAt(0);
const Dot = '.'.charCodeAt(0);
export function isAbsolutePath(path: string) {
return path.charCodeAt(0) === Slash;
}
export function resolvePath(uri: Uri, path: string): Uri {
if (isAbsolutePath(path)) {
return uri.with({ path: normalizePath(path.split('/')) });
}
return joinPath(uri, path);
}
export function normalizePath(parts: string[]): string {
const newParts: string[] = [];
for (const part of parts) {
if (part.length === 0 || part.length === 1 && part.charCodeAt(0) === Dot) {
// ignore
} else if (part.length === 2 && part.charCodeAt(0) === Dot && part.charCodeAt(1) === Dot) {
newParts.pop();
} else {
newParts.push(part);
}
}
if (parts.length > 1 && parts[parts.length - 1].length === 0) {
newParts.push('');
}
let res = newParts.join('/');
if (parts[0].length === 0) {
res = '/' + res;
}
return res;
}
export function joinPath(uri: Uri, ...paths: string[]): Uri {
const parts = uri.path.split('/');
for (let path of paths) {
parts.push(...path.split('/'));
}
return uri.with({ path: normalizePath(parts) });
}

View File

@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../../src/vs/vscode.d.ts'/>
/// <reference path="../../../../../src/vs/vscode.proposed.d.ts" />

View File

@ -0,0 +1,9 @@
{
"extends": "../../shared.tsconfig.json",
"compilerOptions": {
"outDir": "./out"
},
"include": [
"src/**/*"
]
}

View File

@ -0,0 +1,22 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const withBrowserDefaults = require('../shared.webpack.config').browser;
const path = require('path');
module.exports = withBrowserDefaults({
context: path.join(__dirname, 'client'),
entry: {
extension: './src/browser/cssClientMain.ts'
},
output: {
filename: 'cssClientMain.js',
path: path.join(__dirname, 'client', 'dist', 'browser')
}
});

View File

@ -0,0 +1,22 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const withDefaults = require('../shared.webpack.config');
const path = require('path');
module.exports = withDefaults({
context: path.join(__dirname, 'client'),
entry: {
extension: './src/node/cssClientMain.ts',
},
output: {
filename: 'cssClientMain.js',
path: path.join(__dirname, 'client', 'dist', 'node')
}
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,817 @@
{
"name": "css-language-features",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "^1.29.0"
},
"icon": "icons/css.png",
"activationEvents": [
"onLanguage:css",
"onLanguage:less",
"onLanguage:scss",
"onCommand:_css.applyCodeAction"
],
"main": "./client/out/node/cssClientMain",
"browser": "./client/dist/browser/cssClientMain",
"enableProposedApi": true,
"scripts": {
"compile": "gulp compile-extension:css-language-features-client compile-extension:css-language-features-server",
"watch": "gulp watch-extension:css-language-features-client watch-extension:css-language-features-server",
"test": "mocha",
"postinstall": "cd server && yarn install",
"install-client-next": "yarn add vscode-languageclient@next"
},
"categories": [
"Programming Languages"
],
"contributes": {
"configuration": [
{
"order": 22,
"id": "css",
"title": "%css.title%",
"properties": {
"css.customData": {
"type": "array",
"markdownDescription": "%css.customData.desc%",
"default": [],
"items": {
"type": "string"
},
"scope": "resource"
},
"css.completion.triggerPropertyValueCompletion": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%css.completion.triggerPropertyValueCompletion.desc%"
},
"css.completion.completePropertyWithSemicolon": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%css.completion.completePropertyWithSemicolon.desc%"
},
"css.validate": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%css.validate.desc%"
},
"css.lint.compatibleVendorPrefixes": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%css.lint.compatibleVendorPrefixes.desc%"
},
"css.lint.vendorPrefix": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%css.lint.vendorPrefix.desc%"
},
"css.lint.duplicateProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%css.lint.duplicateProperties.desc%"
},
"css.lint.emptyRules": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%css.lint.emptyRules.desc%"
},
"css.lint.importStatement": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%css.lint.importStatement.desc%"
},
"css.lint.boxModel": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%css.lint.boxModel.desc%"
},
"css.lint.universalSelector": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%css.lint.universalSelector.desc%"
},
"css.lint.zeroUnits": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%css.lint.zeroUnits.desc%"
},
"css.lint.fontFaceProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"markdownDescription": "%css.lint.fontFaceProperties.desc%"
},
"css.lint.hexColorLength": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "error",
"description": "%css.lint.hexColorLength.desc%"
},
"css.lint.argumentsInColorFunction": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "error",
"description": "%css.lint.argumentsInColorFunction.desc%"
},
"css.lint.unknownProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%css.lint.unknownProperties.desc%"
},
"css.lint.validProperties": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "%css.lint.validProperties.desc%"
},
"css.lint.ieHack": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%css.lint.ieHack.desc%"
},
"css.lint.unknownVendorSpecificProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%css.lint.unknownVendorSpecificProperties.desc%"
},
"css.lint.propertyIgnoredDueToDisplay": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"markdownDescription": "%css.lint.propertyIgnoredDueToDisplay.desc%"
},
"css.lint.important": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%css.lint.important.desc%"
},
"css.lint.float": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%css.lint.float.desc%"
},
"css.lint.idSelector": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%css.lint.idSelector.desc%"
},
"css.lint.unknownAtRules": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%css.lint.unknownAtRules.desc%"
},
"css.trace.server": {
"type": "string",
"scope": "window",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "%css.trace.server.desc%"
}
}
},
{
"id": "scss",
"order": 24,
"title": "%scss.title%",
"properties": {
"scss.completion.triggerPropertyValueCompletion": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%scss.completion.triggerPropertyValueCompletion.desc%"
},
"scss.completion.completePropertyWithSemicolon": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%scss.completion.completePropertyWithSemicolon.desc%"
},
"scss.validate": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%scss.validate.desc%"
},
"scss.lint.compatibleVendorPrefixes": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%scss.lint.compatibleVendorPrefixes.desc%"
},
"scss.lint.vendorPrefix": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%scss.lint.vendorPrefix.desc%"
},
"scss.lint.duplicateProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%scss.lint.duplicateProperties.desc%"
},
"scss.lint.emptyRules": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%scss.lint.emptyRules.desc%"
},
"scss.lint.importStatement": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%scss.lint.importStatement.desc%"
},
"scss.lint.boxModel": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%scss.lint.boxModel.desc%"
},
"scss.lint.universalSelector": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%scss.lint.universalSelector.desc%"
},
"scss.lint.zeroUnits": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%scss.lint.zeroUnits.desc%"
},
"scss.lint.fontFaceProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"markdownDescription": "%scss.lint.fontFaceProperties.desc%"
},
"scss.lint.hexColorLength": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "error",
"description": "%scss.lint.hexColorLength.desc%"
},
"scss.lint.argumentsInColorFunction": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "error",
"description": "%scss.lint.argumentsInColorFunction.desc%"
},
"scss.lint.unknownProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%scss.lint.unknownProperties.desc%"
},
"scss.lint.validProperties": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "%scss.lint.validProperties.desc%"
},
"scss.lint.ieHack": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%scss.lint.ieHack.desc%"
},
"scss.lint.unknownVendorSpecificProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%scss.lint.unknownVendorSpecificProperties.desc%"
},
"scss.lint.propertyIgnoredDueToDisplay": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"markdownDescription": "%scss.lint.propertyIgnoredDueToDisplay.desc%"
},
"scss.lint.important": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%scss.lint.important.desc%"
},
"scss.lint.float": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%scss.lint.float.desc%"
},
"scss.lint.idSelector": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%scss.lint.idSelector.desc%"
},
"scss.lint.unknownAtRules": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%scss.lint.unknownAtRules.desc%"
}
}
},
{
"id": "less",
"order": 23,
"type": "object",
"title": "%less.title%",
"properties": {
"less.completion.triggerPropertyValueCompletion": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%less.completion.triggerPropertyValueCompletion.desc%"
},
"less.completion.completePropertyWithSemicolon": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%less.completion.completePropertyWithSemicolon.desc%"
},
"less.validate": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%less.validate.desc%"
},
"less.lint.compatibleVendorPrefixes": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%less.lint.compatibleVendorPrefixes.desc%"
},
"less.lint.vendorPrefix": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%less.lint.vendorPrefix.desc%"
},
"less.lint.duplicateProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%less.lint.duplicateProperties.desc%"
},
"less.lint.emptyRules": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%less.lint.emptyRules.desc%"
},
"less.lint.importStatement": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%less.lint.importStatement.desc%"
},
"less.lint.boxModel": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%less.lint.boxModel.desc%"
},
"less.lint.universalSelector": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%less.lint.universalSelector.desc%"
},
"less.lint.zeroUnits": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%less.lint.zeroUnits.desc%"
},
"less.lint.fontFaceProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"markdownDescription": "%less.lint.fontFaceProperties.desc%"
},
"less.lint.hexColorLength": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "error",
"description": "%less.lint.hexColorLength.desc%"
},
"less.lint.argumentsInColorFunction": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "error",
"description": "%less.lint.argumentsInColorFunction.desc%"
},
"less.lint.unknownProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%less.lint.unknownProperties.desc%"
},
"less.lint.validProperties": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"description": "%less.lint.validProperties.desc%"
},
"less.lint.ieHack": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%less.lint.ieHack.desc%"
},
"less.lint.unknownVendorSpecificProperties": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%less.lint.unknownVendorSpecificProperties.desc%"
},
"less.lint.propertyIgnoredDueToDisplay": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"markdownDescription": "%less.lint.propertyIgnoredDueToDisplay.desc%"
},
"less.lint.important": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%less.lint.important.desc%"
},
"less.lint.float": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"markdownDescription": "%less.lint.float.desc%"
},
"less.lint.idSelector": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "ignore",
"description": "%less.lint.idSelector.desc%"
},
"less.lint.unknownAtRules": {
"type": "string",
"scope": "resource",
"enum": [
"ignore",
"warning",
"error"
],
"default": "warning",
"description": "%less.lint.unknownAtRules.desc%"
}
}
}
],
"configurationDefaults": {
"[css]": {
"editor.suggest.insertMode": "replace"
},
"[scss]": {
"editor.suggest.insertMode": "replace"
},
"[less]": {
"editor.suggest.insertMode": "replace"
}
},
"jsonValidation": [
{
"fileMatch": "*.css-data.json",
"url": "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/master/docs/customData.schema.json"
},
{
"fileMatch": "package.json",
"url": "./schemas/package.schema.json"
}
]
},
"dependencies": {
"vscode-languageclient": "7.0.0-next.5.1",
"vscode-nls": "^4.1.2"
},
"devDependencies": {
"@types/node": "^12.11.7",
"mocha": "^7.0.1"
}
}

View File

@ -0,0 +1,84 @@
{
"displayName": "CSS Language Features",
"description": "Provides rich language support for CSS, LESS and SCSS files.",
"css.title": "CSS",
"css.customData.desc": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for the custom CSS properties, at directives, pseudo classes and pseudo elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.",
"css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.",
"css.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties",
"css.lint.argumentsInColorFunction.desc": "Invalid number of parameters.",
"css.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.",
"css.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.",
"css.lint.duplicateProperties.desc": "Do not use duplicate style definitions.",
"css.lint.emptyRules.desc": "Do not use empty rulesets.",
"css.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.",
"css.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.",
"css.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.",
"css.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.",
"css.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.",
"css.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.",
"css.lint.importStatement.desc": "Import statements do not load in parallel.",
"css.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.",
"css.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.",
"css.lint.unknownAtRules.desc": "Unknown at-rule.",
"css.lint.unknownProperties.desc": "Unknown property.",
"css.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.",
"css.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.",
"css.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.",
"css.lint.zeroUnits.desc": "No unit for zero needed.",
"css.trace.server.desc": "Traces the communication between VS Code and the CSS language server.",
"css.validate.title": "Controls CSS validation and problem severities.",
"css.validate.desc": "Enables or disables all validations.",
"less.title": "LESS",
"less.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.",
"less.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties",
"less.lint.argumentsInColorFunction.desc": "Invalid number of parameters.",
"less.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.",
"less.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.",
"less.lint.duplicateProperties.desc": "Do not use duplicate style definitions.",
"less.lint.emptyRules.desc": "Do not use empty rulesets.",
"less.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.",
"less.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.",
"less.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.",
"less.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.",
"less.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.",
"less.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.",
"less.lint.importStatement.desc": "Import statements do not load in parallel.",
"less.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.",
"less.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.",
"less.lint.unknownAtRules.desc": "Unknown at-rule.",
"less.lint.unknownProperties.desc": "Unknown property.",
"less.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.",
"less.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.",
"less.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.",
"less.lint.zeroUnits.desc": "No unit for zero needed.",
"less.validate.title": "Controls LESS validation and problem severities.",
"less.validate.desc": "Enables or disables all validations.",
"scss.title": "SCSS (Sass)",
"scss.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.",
"scss.completion.completePropertyWithSemicolon.desc": "Insert semicolon at end of line when completing CSS properties",
"scss.lint.argumentsInColorFunction.desc": "Invalid number of parameters.",
"scss.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.",
"scss.lint.compatibleVendorPrefixes.desc": "When using a vendor-specific prefix make sure to also include all other vendor-specific properties.",
"scss.lint.duplicateProperties.desc": "Do not use duplicate style definitions.",
"scss.lint.emptyRules.desc": "Do not use empty rulesets.",
"scss.lint.float.desc": "Avoid using `float`. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.",
"scss.lint.fontFaceProperties.desc": "`@font-face` rule must define `src` and `font-family` properties.",
"scss.lint.hexColorLength.desc": "Hex colors must consist of three or six hex numbers.",
"scss.lint.idSelector.desc": "Selectors should not contain IDs because these rules are too tightly coupled with the HTML.",
"scss.lint.ieHack.desc": "IE hacks are only necessary when supporting IE7 and older.",
"scss.lint.important.desc": "Avoid using `!important`. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.",
"scss.lint.importStatement.desc": "Import statements do not load in parallel.",
"scss.lint.propertyIgnoredDueToDisplay.desc": "Property is ignored due to the display. E.g. with `display: inline`, the `width`, `height`, `margin-top`, `margin-bottom`, and `float` properties have no effect.",
"scss.lint.universalSelector.desc": "The universal selector (`*`) is known to be slow.",
"scss.lint.unknownAtRules.desc": "Unknown at-rule.",
"scss.lint.unknownProperties.desc": "Unknown property.",
"scss.lint.validProperties.desc": "A list of properties that are not validated against the `unknownProperties` rule.",
"scss.lint.unknownVendorSpecificProperties.desc": "Unknown vendor specific property.",
"scss.lint.vendorPrefix.desc": "When using a vendor-specific prefix, also include the standard property.",
"scss.lint.zeroUnits.desc": "No unit for zero needed.",
"scss.validate.title": "Controls SCSS validation and problem severities.",
"scss.validate.desc": "Enables or disables all validations.",
"css.colorDecorators.enable.deprecationMessage": "The setting `css.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",
"scss.colorDecorators.enable.deprecationMessage": "The setting `scss.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",
"less.colorDecorators.enable.deprecationMessage": "The setting `less.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`."
}

View File

@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CSS contributions to package.json",
"type": "object",
"properties": {
"contributes": {
"type": "object",
"properties": {
"css.customData": {
"type": "array",
"markdownDescription": "A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-css-languageservice/blob/master/docs/customData.md).\n\nVS Code loads custom data on startup to enhance its CSS support for the custom CSS properties, at directives, pseudo classes and pseudo elements you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.",
"items": {
"type": "string",
"description": "Relative path to a CSS custom data file"
}
}
}
}
}
}

View File

@ -0,0 +1,33 @@
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
"configurations": [
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 6044,
"protocol": "inspector",
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*.js"]
},
{
"name": "Unit Tests",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/../../../node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"--timeout",
"999999",
"--colors"
],
"cwd": "${workspaceFolder}",
"runtimeExecutable": null,
"runtimeArgs": [],
"env": {},
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*.js"]
}
]
}

Some files were not shown because too many files have changed in this diff Show More