diff --git a/extensions/ini/ini.language-configuration.json b/extensions/ini/ini.language-configuration.json new file mode 100644 index 00000000000..93cfa1ce3b9 --- /dev/null +++ b/extensions/ini/ini.language-configuration.json @@ -0,0 +1,25 @@ +{ + "comments": { + "lineComment": ";", + "blockComment": [ ";", " " ] + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/extensions/ini/package.json b/extensions/ini/package.json index 374e73d7162..7c20952302a 100644 --- a/extensions/ini/package.json +++ b/extensions/ini/package.json @@ -6,15 +6,26 @@ "contributes": { "languages": [{ "id": "ini", - "extensions": [ ".ini", ".properties", ".gitconfig" ], - "filenames": ["config", ".gitattributes", ".gitconfig", "gitconfig", ".editorconfig"], + "extensions": [ ".ini"], "aliases": [ "Ini", "ini" ], - "configuration": "./language-configuration.json" - }], + "configuration": "./ini.language-configuration.json" + }, + { + "id": "properties", + "extensions": [ ".properties", ".gitconfig" ], + "filenames": ["config", ".gitattributes", ".gitconfig", "gitconfig", ".editorconfig"], + "aliases": [ "properties", "properties" ], + "configuration": "./properties.language-configuration.json" + } + ], "grammars": [{ "language": "ini", "scopeName": "source.ini", - "path": "./syntaxes/Ini.plist" + "path": "./syntaxes/Ini.tmLanuage" + },{ + "language": "properties", + "scopeName": "source.properties", + "path": "./syntaxes/properties.plist" }] } } diff --git a/extensions/ini/language-configuration.json b/extensions/ini/properties.language-configuration.json similarity index 100% rename from extensions/ini/language-configuration.json rename to extensions/ini/properties.language-configuration.json diff --git a/extensions/ini/syntaxes/Ini.tmLanguage b/extensions/ini/syntaxes/Ini.tmLanguage new file mode 100644 index 00000000000..b43ff239149 --- /dev/null +++ b/extensions/ini/syntaxes/Ini.tmLanguage @@ -0,0 +1,127 @@ + + + + + fileTypes + + ini + INI + inf + INF + reg + REG + lng + cfg + CFG + url + URL + .editorconfig + + name + INI + patterns + + + captures + + 1 + + name + punctuation.definition.comment.ini + + + match + ^\s*(;|#).*$\n? + name + comment.line.semicolon.ini + + + captures + + 1 + + name + punctuation.definition.section.ini + + 2 + + name + entity.section.ini + + 3 + + name + punctuation.definition.section.ini + + + match + ^\s*(\[)(.*?)(\]) + name + meta.tag.section.ini + + + captures + + 1 + + name + meta.property.ini + + 2 + + name + punctuation.definition.quote.ini + + 3 + + name + keyword.name.ini + + 4 + + name + punctuation.definition.quote.ini + + 5 + + name + punctuation.definition.equals.ini + + 6 + + name + meta.value.ini + + 7 + + name + punctuation.definition.quote.ini + + 8 + + name + string.name.value.ini + + 9 + + name + punctuation.definition.quote.ini + + 10 + + name + comment.declarationline.semicolon.ini + + + match + ^(\s*(["']?)(.+?)(\2)\s*(=))?\s*((["']?)(.*?)(\7))\s*(;.*)?$\n? + name + meta.declaration.ini + + + scopeName + source.ini + uuid + 957acd74-6d7c-4732-a25b-5f66a1e637cd + + diff --git a/extensions/ini/syntaxes/Ini.plist b/extensions/ini/syntaxes/properties.plist similarity index 99% rename from extensions/ini/syntaxes/Ini.plist rename to extensions/ini/syntaxes/properties.plist index 86606eea259..11436566bd5 100644 --- a/extensions/ini/syntaxes/Ini.plist +++ b/extensions/ini/syntaxes/properties.plist @@ -174,7 +174,7 @@ scopeName - source.ini + source.properties uuid 77DC23B6-8A90-11D9-BAA4-000A9584EC8C