From 9c9b233a0bfee668647cbbca6f08370cd1d913c5 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 03:40:29 +0530 Subject: [PATCH 01/34] Create carbon.tmLanguage.json --- utils/vscode/syntaxes/carbon.tmLanguage.json | 137 +++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 utils/vscode/syntaxes/carbon.tmLanguage.json diff --git a/utils/vscode/syntaxes/carbon.tmLanguage.json b/utils/vscode/syntaxes/carbon.tmLanguage.json new file mode 100644 index 0000000000000..76d2d89cbf090 --- /dev/null +++ b/utils/vscode/syntaxes/carbon.tmLanguage.json @@ -0,0 +1,137 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "carbon", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#operators" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "include": "#reserved-words" + }, + { + "include": "#ctrl-statements" + }, + { + "include": "#functions" + }, + { + "include": "#customs" + } + ], + "repository": { + "operators": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(\\+|-|\\*|/|!)\\b" + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.line.double-dash.carbon", + "begin": "//", + "end": "\n" + } + ] + }, + "strings": { + "patterns": [ + { + "name": "string.quoted.single.carbon", + "begin": "'", + "end": "'" + }, + { + "name": "string.quoted.double.carbon", + "begin": "\"", + "end": "\"" + }, + { + "name": "string.quoted.triple.carbon", + "begin": "\"\"\"", + "end": "\"\"\"" + } + ] + }, + "ctrl-statements": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(impl|Main|extend|partial|Self|Int|UInt|Base|template|as|library)\\b" + } + ] + }, + "reserved-words": { + "patterns": [ + { + "name": "keyword.control.carbon", + "match": "\\b(package|import|fn|var|for|return|class|api|i8|i16|i32|i64|i128|i256|u8|u16|u32|u64|u128|u256|f8|f16|f32|f64|f128|if|else|auto|let|File|while|match|case|default|returned|base|bool|virtual|abstract|String|true|false)\\b" + } + ] + }, + "functions": { + "name": "keyword.operator.new.carbon", + "match": "\\b[a-zA-Z]+\\s*\\(" + }, + "customs": { + "patterns": [ + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bpackage\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "\\w+(?=\\s*:)" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bvar\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bimpl\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bimport\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bclass\\s)\\w+" + } + ] + }, + "numbers": { + "patterns": [ + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\.\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" + } + ] + } + }, + "scopeName": "source.carbon" +} From 402ab775bef15ca4db02bd4fbdf037fa2745d5ed Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 03:41:44 +0530 Subject: [PATCH 02/34] Update language-configuration.json --- utils/vscode/language-configuration.json | 44 ++++++++++++++---------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/utils/vscode/language-configuration.json b/utils/vscode/language-configuration.json index 4f505bb76585f..0bae744c47b59 100644 --- a/utils/vscode/language-configuration.json +++ b/utils/vscode/language-configuration.json @@ -3,22 +3,30 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception { - "comments": { - "lineComment": "//" - }, - "brackets": [ - ["(", ")"], - ["[", "]"], - ["{", "}"] - ], - "autoClosingPairs": [ - ["(", ")"], - ["[", "]"], - ["{", "}"] - ], - "surroundingPairs": [ - ["(", ")"], - ["[", "]"], - ["{", "}"] - ] + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "//", + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + // symbols that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] } From 946e00ae554fc14237e442bff5b9b9afb95c0abc Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 03:45:17 +0530 Subject: [PATCH 03/34] Update package.json --- utils/vscode/package.json | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/utils/vscode/package.json b/utils/vscode/package.json index f032a94495181..209ef82aca922 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -15,16 +15,12 @@ "activationEvents": [], "main": "./src/extension.js", "contributes": { - "languages": [ - { - "id": "carbon", - "aliases": [], - "extensions": [ - ".carbon" - ], - "configuration": "./language-configuration.json" - } - ], + "languages": [{ + "id": "carbon", + "aliases": ["carbon", "carbon"], + "extensions": [".carbon"], + "configuration": "./language-configuration.json" + }], "grammars": [ { "language": "carbon", @@ -41,5 +37,14 @@ }, "dependencies": { "vscode-languageclient": "^8.1.0" + }, + "contributes": { + "languages": [{ + "id": "carbon", + "aliases": ["carbon", "carbon"], + "extensions": [".carbon"], + "configuration": "./language-configuration.json" + }], + } } From 9c1cb0d0187aba6819ee0332b578d7809bfdf822 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 03:48:05 +0530 Subject: [PATCH 04/34] Update package.json --- utils/vscode/package.json | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/utils/vscode/package.json b/utils/vscode/package.json index 209ef82aca922..d0cbbfcd95c56 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -2,7 +2,7 @@ "name": "carbon-lang", "displayName": "carbon-lang", "description": "Carbon Language support", - "version": "0.0.1", + "version": "0.0.2", "repository": { "url": "https://github.com/carbon-language/carbon-lang" }, @@ -15,17 +15,24 @@ "activationEvents": [], "main": "./src/extension.js", "contributes": { - "languages": [{ - "id": "carbon", - "aliases": ["carbon", "carbon"], - "extensions": [".carbon"], - "configuration": "./language-configuration.json" - }], + "languages": [ + { + "id": "carbon", + "aliases": [ + "carbon", + "carbon" + ], + "extensions": [ + ".carbon" + ], + "configuration": "./language-configuration.json" + } + ], "grammars": [ { "language": "carbon", "scopeName": "source.carbon", - "path": "Carbon.plist" + "path": "./syntaxes/carbon.tmLanguage.json" } ] }, @@ -37,14 +44,5 @@ }, "dependencies": { "vscode-languageclient": "^8.1.0" - }, - "contributes": { - "languages": [{ - "id": "carbon", - "aliases": ["carbon", "carbon"], - "extensions": [".carbon"], - "configuration": "./language-configuration.json" - }], - } } From b06eb89642b1e3a2361fcb1ecea02b08b333e148 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 03:59:49 +0530 Subject: [PATCH 05/34] Update carbon.tmLanguage.json --- utils/vscode/syntaxes/carbon.tmLanguage.json | 270 +++++++++---------- 1 file changed, 135 insertions(+), 135 deletions(-) diff --git a/utils/vscode/syntaxes/carbon.tmLanguage.json b/utils/vscode/syntaxes/carbon.tmLanguage.json index 76d2d89cbf090..db3686b69214b 100644 --- a/utils/vscode/syntaxes/carbon.tmLanguage.json +++ b/utils/vscode/syntaxes/carbon.tmLanguage.json @@ -1,137 +1,137 @@ { - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "carbon", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#operators" - }, - { - "include": "#strings" - }, - { - "include": "#numbers" - }, - { - "include": "#reserved-words" - }, - { - "include": "#ctrl-statements" - }, - { - "include": "#functions" - }, - { - "include": "#customs" - } - ], - "repository": { - "operators": { - "patterns": [ - { - "name": "keyword.operator.new.carbon", - "match": "\\b(\\+|-|\\*|/|!)\\b" - } - ] - }, - "comments": { - "patterns": [ - { - "name": "comment.line.double-dash.carbon", - "begin": "//", - "end": "\n" - } - ] - }, - "strings": { - "patterns": [ - { - "name": "string.quoted.single.carbon", - "begin": "'", - "end": "'" - }, - { - "name": "string.quoted.double.carbon", - "begin": "\"", - "end": "\"" - }, - { - "name": "string.quoted.triple.carbon", - "begin": "\"\"\"", - "end": "\"\"\"" - } - ] - }, - "ctrl-statements": { - "patterns": [ - { - "name": "keyword.operator.new.carbon", - "match": "\\b(impl|Main|extend|partial|Self|Int|UInt|Base|template|as|library)\\b" - } - ] - }, - "reserved-words": { - "patterns": [ - { - "name": "keyword.control.carbon", - "match": "\\b(package|import|fn|var|for|return|class|api|i8|i16|i32|i64|i128|i256|u8|u16|u32|u64|u128|u256|f8|f16|f32|f64|f128|if|else|auto|let|File|while|match|case|default|returned|base|bool|virtual|abstract|String|true|false)\\b" - } - ] - }, - "functions": { - "name": "keyword.operator.new.carbon", - "match": "\\b[a-zA-Z]+\\s*\\(" - }, - "customs": { - "patterns": [ - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bpackage\\s)\\w+" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "\\w+(?=\\s*:)" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bvar\\s)\\w+" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bimpl\\s)\\w+" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bimport\\s)\\w+" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bclass\\s)\\w+" - } - ] - }, - "numbers": { - "patterns": [ - { - "name": "constant.numeric.carbon", - "match": "\\b\\d+\\b" - }, - { - "name": "constant.numeric.carbon", - "match": "\\b\\d+\\.\\d+\\b" - }, - { - "name": "constant.numeric.carbon", - "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" - } - ] - } - }, - "scopeName": "source.carbon" + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "carbon", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#operators" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "include": "#reserved-words" + }, + { + "include": "#ctrl-statements" + }, + { + "include": "#functions" + }, + { + "include": "#customs" + } + ], + "repository": { + "operators": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(\\+|-|\\*|/|!)\\b" + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.line.double-dash.carbon", + "begin": "//", + "end": "\n" + } + ] + }, + "strings": { + "patterns": [ + { + "name": "string.quoted.single.carbon", + "begin": "'", + "end": "'" + }, + { + "name": "string.quoted.double.carbon", + "begin": "\"", + "end": "\"" + }, + { + "name": "string.quoted.triple.carbon", + "begin": "\"\"\"", + "end": "\"\"\"" + } + ] + }, + "ctrl-statements": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(impl|Main|extend|partial|Self|Int|UInt|Base|template|as|library)\\b" + } + ] + }, + "reserved-words": { + "patterns": [ + { + "name": "keyword.control.carbon", + "match": "\\b(package|import|fn|var|for|return|class|api|i8|i16|i32|i64|i128|i256|u8|u16|u32|u64|u128|u256|f8|f16|f32|f64|f128|if|else|auto|let|File|while|match|case|default|returned|base|bool|virtual|abstract|String|true|false)\\b" + } + ] + }, + "functions": { + "name": "keyword.operator.new.carbon", + "match": "\\b[a-zA-Z]+\\s*\\(" + }, + "customs": { + "patterns": [ + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bpackage\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "\\w+(?=\\s*:)" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bvar\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bimpl\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bimport\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bclass\\s)\\w+" + } + ] + }, + "numbers": { + "patterns": [ + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\.\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" + } + ] + } + }, + "scopeName": "source.carbon" } From 14db0c54357c189db33ae6d41f056496917c4ae4 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 04:00:18 +0530 Subject: [PATCH 06/34] Update package.json --- utils/vscode/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/vscode/package.json b/utils/vscode/package.json index d0cbbfcd95c56..16ee8588ffa81 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -19,8 +19,8 @@ { "id": "carbon", "aliases": [ - "carbon", - "carbon" + "Carbon", + "Carbon" ], "extensions": [ ".carbon" From 7912544ead145fb147f9fafa138f7638308f0157 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 18:41:01 +0530 Subject: [PATCH 07/34] Update carbon.tmLanguage.json --- utils/vscode/syntaxes/carbon.tmLanguage.json | 299 ++++++++++--------- 1 file changed, 164 insertions(+), 135 deletions(-) diff --git a/utils/vscode/syntaxes/carbon.tmLanguage.json b/utils/vscode/syntaxes/carbon.tmLanguage.json index db3686b69214b..90baf648dd379 100644 --- a/utils/vscode/syntaxes/carbon.tmLanguage.json +++ b/utils/vscode/syntaxes/carbon.tmLanguage.json @@ -1,137 +1,166 @@ { - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "carbon", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#operators" - }, - { - "include": "#strings" - }, - { - "include": "#numbers" - }, - { - "include": "#reserved-words" - }, - { - "include": "#ctrl-statements" - }, - { - "include": "#functions" - }, - { - "include": "#customs" - } - ], - "repository": { - "operators": { - "patterns": [ - { - "name": "keyword.operator.new.carbon", - "match": "\\b(\\+|-|\\*|/|!)\\b" - } - ] - }, - "comments": { - "patterns": [ - { - "name": "comment.line.double-dash.carbon", - "begin": "//", - "end": "\n" - } - ] - }, - "strings": { - "patterns": [ - { - "name": "string.quoted.single.carbon", - "begin": "'", - "end": "'" - }, - { - "name": "string.quoted.double.carbon", - "begin": "\"", - "end": "\"" - }, - { - "name": "string.quoted.triple.carbon", - "begin": "\"\"\"", - "end": "\"\"\"" - } - ] - }, - "ctrl-statements": { - "patterns": [ - { - "name": "keyword.operator.new.carbon", - "match": "\\b(impl|Main|extend|partial|Self|Int|UInt|Base|template|as|library)\\b" - } - ] - }, - "reserved-words": { - "patterns": [ - { - "name": "keyword.control.carbon", - "match": "\\b(package|import|fn|var|for|return|class|api|i8|i16|i32|i64|i128|i256|u8|u16|u32|u64|u128|u256|f8|f16|f32|f64|f128|if|else|auto|let|File|while|match|case|default|returned|base|bool|virtual|abstract|String|true|false)\\b" - } - ] - }, - "functions": { - "name": "keyword.operator.new.carbon", - "match": "\\b[a-zA-Z]+\\s*\\(" - }, - "customs": { - "patterns": [ - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bpackage\\s)\\w+" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "\\w+(?=\\s*:)" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bvar\\s)\\w+" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bimpl\\s)\\w+" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bimport\\s)\\w+" - }, - { - "name": "entity.other.attribute-name.carbon", - "match": "(?<=\\bclass\\s)\\w+" - } - ] - }, - "numbers": { - "patterns": [ - { - "name": "constant.numeric.carbon", - "match": "\\b\\d+\\b" - }, - { - "name": "constant.numeric.carbon", - "match": "\\b\\d+\\.\\d+\\b" - }, - { - "name": "constant.numeric.carbon", - "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" - } - ] - } - }, - "scopeName": "source.carbon" + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "carbon", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#operators" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "include": "#reserved-words" + }, + { + "include": "#operator-dedicated-keywords-statements" + }, + { + "include": "#ctrl-statements" + }, + { + "include": "#special-keywords" + }, + { + "include": "#true-false" + }, + { + "include": "#functions" + }, + { + "include": "#customs" + } + ], + "repository": { + "operators": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(\\+|-|\\*|/|!)\\b" + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.line.double-dash.carbon", + "begin": "//", + "end": "\n" + } + ] + }, + "strings": { + "patterns": [ + { + "name": "string.quoted.single.carbon", + "begin": "'", + "end": "'" + }, + { + "name": "string.quoted.double.carbon", + "begin": "\"", + "end": "\"" + }, + { + "name": "string.quoted.triple.carbon", + "begin": "\"\"\"", + "end": "\"\"\"" + } + ] + }, + "special-keywords": { + "patterns": [ + { + "name": "keyword.control.less.carbon", + "match": "\\b(break|case|continue|default|else|if|for|match|return|returned|then|while)\\b" + } + ] + }, + "operator-dedicated-keywords-statements": { + "patterns": [ + { + "name": "keyword.control.less.carbon", + "match": "\\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\\b" + } + ] + }, + "reserved-words": { + "patterns": [ + { + "name": "keyword.control.less", + "match": "\\b(As|bool|Carbon\\.Int|Carbon\\.UInt|f16|f32|f64|f128|i8|i16|i32|i64|i128|i256|Slice|String|StringView|type|u8|u16|u32|u64|u128|u256)\\b" + } + ] + }, + "true-false": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(true|false)\\b" + } + ] + }, + "functions": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b[a-zA-Z]+\\s*\\(" + } + ] + }, + "customs": { + "patterns": [ + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bpackage\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "\\w+(?=\\s*:)" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\blet\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bvar\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bimpl\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bimport\\s)\\w+" + }, + { + "name": "entity.other.attribute-name.carbon", + "match": "(?<=\\bclass\\s)\\w+" + } + ] + }, + "numbers": { + "patterns": [ + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\.\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" + } + ] + } + }, + "scopeName": "source.carbon" } From 555866286a8e7fdd82e3697b56163a3878289838 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 18:41:27 +0530 Subject: [PATCH 08/34] Update package.json --- utils/vscode/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/vscode/package.json b/utils/vscode/package.json index 16ee8588ffa81..db17978464a29 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -19,7 +19,6 @@ { "id": "carbon", "aliases": [ - "Carbon", "Carbon" ], "extensions": [ From bea96b7183934c3c463426f2a06cc39f5c0a57a0 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 19:01:18 +0530 Subject: [PATCH 09/34] Update carbon.tmLanguage.json --- utils/vscode/syntaxes/carbon.tmLanguage.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/vscode/syntaxes/carbon.tmLanguage.json b/utils/vscode/syntaxes/carbon.tmLanguage.json index 90baf648dd379..c8828287ec862 100644 --- a/utils/vscode/syntaxes/carbon.tmLanguage.json +++ b/utils/vscode/syntaxes/carbon.tmLanguage.json @@ -84,7 +84,7 @@ "operator-dedicated-keywords-statements": { "patterns": [ { - "name": "keyword.control.less.carbon", + "name": "keyword.carbon", "match": "\\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\\b" } ] @@ -92,7 +92,7 @@ "reserved-words": { "patterns": [ { - "name": "keyword.control.less", + "name": "support.type.carbon", "match": "\\b(As|bool|Carbon\\.Int|Carbon\\.UInt|f16|f32|f64|f128|i8|i16|i32|i64|i128|i256|Slice|String|StringView|type|u8|u16|u32|u64|u128|u256)\\b" } ] @@ -108,7 +108,7 @@ "functions": { "patterns": [ { - "name": "keyword.operator.new.carbon", + "name": "support.function.carbon", "match": "\\b[a-zA-Z]+\\s*\\(" } ] @@ -131,6 +131,10 @@ "name": "entity.other.attribute-name.carbon", "match": "(?<=\\bvar\\s)\\w+" }, + { + "name": "support.function.carbon", + "match": "(?<=\\bfn\\s)\\w+" + }, { "name": "entity.other.attribute-name.carbon", "match": "(?<=\\bimpl\\s)\\w+" From 70f09102654ae7f036316d0ff32695e1e8b2e027 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Fri, 17 May 2024 20:22:39 +0530 Subject: [PATCH 10/34] Update carbon.tmLanguage.json --- utils/vscode/syntaxes/carbon.tmLanguage.json | 22 +++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/utils/vscode/syntaxes/carbon.tmLanguage.json b/utils/vscode/syntaxes/carbon.tmLanguage.json index c8828287ec862..47201566e8973 100644 --- a/utils/vscode/syntaxes/carbon.tmLanguage.json +++ b/utils/vscode/syntaxes/carbon.tmLanguage.json @@ -116,19 +116,27 @@ "customs": { "patterns": [ { - "name": "entity.other.attribute-name.carbon", + "name": "support.class.carbon", "match": "(?<=\\bpackage\\s)\\w+" }, { - "name": "entity.other.attribute-name.carbon", + "name": "support.variable.carbon", + "match": "(?<=\\s*\\.)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\bas\\s)\\w+" + }, + { + "name": "support.variable.carbon", "match": "\\w+(?=\\s*:)" }, { - "name": "entity.other.attribute-name.carbon", + "name": "support.variable.carbon", "match": "(?<=\\blet\\s)\\w+" }, { - "name": "entity.other.attribute-name.carbon", + "name": "support.variable.carbon", "match": "(?<=\\bvar\\s)\\w+" }, { @@ -136,15 +144,15 @@ "match": "(?<=\\bfn\\s)\\w+" }, { - "name": "entity.other.attribute-name.carbon", + "name": "support.other.carbon", "match": "(?<=\\bimpl\\s)\\w+" }, { - "name": "entity.other.attribute-name.carbon", + "name": "support.type.property-name.carbon", "match": "(?<=\\bimport\\s)\\w+" }, { - "name": "entity.other.attribute-name.carbon", + "name": "support.class.carbon", "match": "(?<=\\bclass\\s)\\w+" } ] From 9106862aa1e32098ac4e41333264c64063f682b4 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sat, 18 May 2024 03:35:12 +0530 Subject: [PATCH 11/34] Delete utils/textmate/Syntaxes directory --- utils/textmate/Syntaxes/Carbon.plist | 157 --------------------------- 1 file changed, 157 deletions(-) delete mode 100644 utils/textmate/Syntaxes/Carbon.plist diff --git a/utils/textmate/Syntaxes/Carbon.plist b/utils/textmate/Syntaxes/Carbon.plist deleted file mode 100644 index b532b89574c6e..0000000000000 --- a/utils/textmate/Syntaxes/Carbon.plist +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - name - carbon - uuid - 04F7F7E3-D5EE-40A4-9899-53CD34D28276 - scopeName - source.carbon - fileTypes - - carbon - - - - foldingStartMarker - \{\s*$ - foldingStopMarker - ^\s*\} - - - patterns - - - - begin - (^[ \t]+)?(?=//) - end - (?!\G) - patterns - - - name - comment.line.carbon - begin - // - end - $ - - - - - - name - keyword.control.carbon - match - \b(break|case|continue|default|else|if|for|match|return|returned|then|while)\b - - - - name - keyword.other.carbon - match - \b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\b - - - - name - storage.type.carbon - match - \b(As|bool|Carbon\.Int|Carbon\.UInt|f16|f32|f64|f128|i8|i16|i32|i64|i128|i256|Slice|String|StringView|type|u8|u16|u32|u64|u128|u256)\b - - - - name - keyword.other.carbon - match - \b(true|false)\b - - - - name - string.quoted.triple.carbon - begin - '''([^\s'#]*\n)? - end - ''' - beginCaptures - - 1 - - name - constant.character.escape.carbon - - - patterns - - - include - #string_escapes - - - - - - name - string.quoted.double.carbon - begin - " - end - " - - patterns - - - include - #string_escapes - - - - - - name - constant.numeric.carbon - match - 0x[_0-9A-F]+(\.[_0-9A-F]+(p[-+]?[1-9][0-9]*)?)? - - - - name - constant.numeric.carbon - match - 0b[_01]+ - - - - name - constant.numeric.carbon - match - [1-9][_0-9]*(\.[_0-9]+(e[-+]?[1-9][0-9]*)?)? - - - - - repository - - - string_escapes - - name - constant.character.escape.carbon - match - \\([tnr'"0\0]|x[0-9A-F]{2}|u\{[0-9A-F]{4,}\}) - - - - From 02a571114d647a0f6be381afb99eaa87a0155836 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sat, 18 May 2024 03:39:32 +0530 Subject: [PATCH 12/34] Update and rename Carbon.plist to carbon.tmLanguage.json --- utils/vscode/Carbon.plist | 1 - utils/vscode/carbon.tmLanguage.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 120000 utils/vscode/Carbon.plist create mode 120000 utils/vscode/carbon.tmLanguage.json diff --git a/utils/vscode/Carbon.plist b/utils/vscode/Carbon.plist deleted file mode 120000 index 7699042862a6a..0000000000000 --- a/utils/vscode/Carbon.plist +++ /dev/null @@ -1 +0,0 @@ -../textmate/Syntaxes/Carbon.plist \ No newline at end of file diff --git a/utils/vscode/carbon.tmLanguage.json b/utils/vscode/carbon.tmLanguage.json new file mode 120000 index 0000000000000..42fc01b603057 --- /dev/null +++ b/utils/vscode/carbon.tmLanguage.json @@ -0,0 +1 @@ +../textmate/Syntaxes/carbon.tmLanguage.json From 6b54f340f29d242a05b1f7e0d92097d2912a7d11 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sat, 18 May 2024 03:42:50 +0530 Subject: [PATCH 13/34] Create carbon.tmLanguage.json --- .../textmate/Syntaxes/carbon.tmLanguage.json | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 utils/textmate/Syntaxes/carbon.tmLanguage.json diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json new file mode 100644 index 0000000000000..47201566e8973 --- /dev/null +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -0,0 +1,178 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "carbon", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#operators" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "include": "#reserved-words" + }, + { + "include": "#operator-dedicated-keywords-statements" + }, + { + "include": "#ctrl-statements" + }, + { + "include": "#special-keywords" + }, + { + "include": "#true-false" + }, + { + "include": "#functions" + }, + { + "include": "#customs" + } + ], + "repository": { + "operators": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(\\+|-|\\*|/|!)\\b" + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.line.double-dash.carbon", + "begin": "//", + "end": "\n" + } + ] + }, + "strings": { + "patterns": [ + { + "name": "string.quoted.single.carbon", + "begin": "'", + "end": "'" + }, + { + "name": "string.quoted.double.carbon", + "begin": "\"", + "end": "\"" + }, + { + "name": "string.quoted.triple.carbon", + "begin": "\"\"\"", + "end": "\"\"\"" + } + ] + }, + "special-keywords": { + "patterns": [ + { + "name": "keyword.control.less.carbon", + "match": "\\b(break|case|continue|default|else|if|for|match|return|returned|then|while)\\b" + } + ] + }, + "operator-dedicated-keywords-statements": { + "patterns": [ + { + "name": "keyword.carbon", + "match": "\\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\\b" + } + ] + }, + "reserved-words": { + "patterns": [ + { + "name": "support.type.carbon", + "match": "\\b(As|bool|Carbon\\.Int|Carbon\\.UInt|f16|f32|f64|f128|i8|i16|i32|i64|i128|i256|Slice|String|StringView|type|u8|u16|u32|u64|u128|u256)\\b" + } + ] + }, + "true-false": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(true|false)\\b" + } + ] + }, + "functions": { + "patterns": [ + { + "name": "support.function.carbon", + "match": "\\b[a-zA-Z]+\\s*\\(" + } + ] + }, + "customs": { + "patterns": [ + { + "name": "support.class.carbon", + "match": "(?<=\\bpackage\\s)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\s*\\.)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\bas\\s)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "\\w+(?=\\s*:)" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\blet\\s)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\bvar\\s)\\w+" + }, + { + "name": "support.function.carbon", + "match": "(?<=\\bfn\\s)\\w+" + }, + { + "name": "support.other.carbon", + "match": "(?<=\\bimpl\\s)\\w+" + }, + { + "name": "support.type.property-name.carbon", + "match": "(?<=\\bimport\\s)\\w+" + }, + { + "name": "support.class.carbon", + "match": "(?<=\\bclass\\s)\\w+" + } + ] + }, + "numbers": { + "patterns": [ + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\.\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" + } + ] + } + }, + "scopeName": "source.carbon" +} From b157b649c8465b7bcea6a2982dc515c8055b3c3f Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sat, 18 May 2024 03:43:32 +0530 Subject: [PATCH 14/34] Delete utils/vscode/syntaxes directory --- utils/vscode/syntaxes/carbon.tmLanguage.json | 178 ------------------- 1 file changed, 178 deletions(-) delete mode 100644 utils/vscode/syntaxes/carbon.tmLanguage.json diff --git a/utils/vscode/syntaxes/carbon.tmLanguage.json b/utils/vscode/syntaxes/carbon.tmLanguage.json deleted file mode 100644 index 47201566e8973..0000000000000 --- a/utils/vscode/syntaxes/carbon.tmLanguage.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "carbon", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#operators" - }, - { - "include": "#strings" - }, - { - "include": "#numbers" - }, - { - "include": "#reserved-words" - }, - { - "include": "#operator-dedicated-keywords-statements" - }, - { - "include": "#ctrl-statements" - }, - { - "include": "#special-keywords" - }, - { - "include": "#true-false" - }, - { - "include": "#functions" - }, - { - "include": "#customs" - } - ], - "repository": { - "operators": { - "patterns": [ - { - "name": "keyword.operator.new.carbon", - "match": "\\b(\\+|-|\\*|/|!)\\b" - } - ] - }, - "comments": { - "patterns": [ - { - "name": "comment.line.double-dash.carbon", - "begin": "//", - "end": "\n" - } - ] - }, - "strings": { - "patterns": [ - { - "name": "string.quoted.single.carbon", - "begin": "'", - "end": "'" - }, - { - "name": "string.quoted.double.carbon", - "begin": "\"", - "end": "\"" - }, - { - "name": "string.quoted.triple.carbon", - "begin": "\"\"\"", - "end": "\"\"\"" - } - ] - }, - "special-keywords": { - "patterns": [ - { - "name": "keyword.control.less.carbon", - "match": "\\b(break|case|continue|default|else|if|for|match|return|returned|then|while)\\b" - } - ] - }, - "operator-dedicated-keywords-statements": { - "patterns": [ - { - "name": "keyword.carbon", - "match": "\\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\\b" - } - ] - }, - "reserved-words": { - "patterns": [ - { - "name": "support.type.carbon", - "match": "\\b(As|bool|Carbon\\.Int|Carbon\\.UInt|f16|f32|f64|f128|i8|i16|i32|i64|i128|i256|Slice|String|StringView|type|u8|u16|u32|u64|u128|u256)\\b" - } - ] - }, - "true-false": { - "patterns": [ - { - "name": "keyword.operator.new.carbon", - "match": "\\b(true|false)\\b" - } - ] - }, - "functions": { - "patterns": [ - { - "name": "support.function.carbon", - "match": "\\b[a-zA-Z]+\\s*\\(" - } - ] - }, - "customs": { - "patterns": [ - { - "name": "support.class.carbon", - "match": "(?<=\\bpackage\\s)\\w+" - }, - { - "name": "support.variable.carbon", - "match": "(?<=\\s*\\.)\\w+" - }, - { - "name": "support.variable.carbon", - "match": "(?<=\\bas\\s)\\w+" - }, - { - "name": "support.variable.carbon", - "match": "\\w+(?=\\s*:)" - }, - { - "name": "support.variable.carbon", - "match": "(?<=\\blet\\s)\\w+" - }, - { - "name": "support.variable.carbon", - "match": "(?<=\\bvar\\s)\\w+" - }, - { - "name": "support.function.carbon", - "match": "(?<=\\bfn\\s)\\w+" - }, - { - "name": "support.other.carbon", - "match": "(?<=\\bimpl\\s)\\w+" - }, - { - "name": "support.type.property-name.carbon", - "match": "(?<=\\bimport\\s)\\w+" - }, - { - "name": "support.class.carbon", - "match": "(?<=\\bclass\\s)\\w+" - } - ] - }, - "numbers": { - "patterns": [ - { - "name": "constant.numeric.carbon", - "match": "\\b\\d+\\b" - }, - { - "name": "constant.numeric.carbon", - "match": "\\b\\d+\\.\\d+\\b" - }, - { - "name": "constant.numeric.carbon", - "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" - } - ] - } - }, - "scopeName": "source.carbon" -} From 2ef24fb7c02343cc0d42300ac117fde191add0d9 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sat, 18 May 2024 03:44:13 +0530 Subject: [PATCH 15/34] Update package.json --- utils/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/vscode/package.json b/utils/vscode/package.json index db17978464a29..a80371eacfed5 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -31,7 +31,7 @@ { "language": "carbon", "scopeName": "source.carbon", - "path": "./syntaxes/carbon.tmLanguage.json" + "path": "./carbon.tmLanguage.json" } ] }, From c4e7d1b9c0ec7db1adecdafc95c883c9d091fa84 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sat, 18 May 2024 03:52:25 +0530 Subject: [PATCH 16/34] Update carbon.tmLanguage.json --- .../textmate/Syntaxes/carbon.tmLanguage.json | 352 +++++++++--------- 1 file changed, 176 insertions(+), 176 deletions(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 47201566e8973..bc80055fd2e3a 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -1,178 +1,178 @@ { - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "carbon", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#operators" - }, - { - "include": "#strings" - }, - { - "include": "#numbers" - }, - { - "include": "#reserved-words" - }, - { - "include": "#operator-dedicated-keywords-statements" - }, - { - "include": "#ctrl-statements" - }, - { - "include": "#special-keywords" - }, - { - "include": "#true-false" - }, - { - "include": "#functions" - }, - { - "include": "#customs" - } - ], - "repository": { - "operators": { - "patterns": [ - { - "name": "keyword.operator.new.carbon", - "match": "\\b(\\+|-|\\*|/|!)\\b" - } - ] - }, - "comments": { - "patterns": [ - { - "name": "comment.line.double-dash.carbon", - "begin": "//", - "end": "\n" - } - ] - }, - "strings": { - "patterns": [ - { - "name": "string.quoted.single.carbon", - "begin": "'", - "end": "'" - }, - { - "name": "string.quoted.double.carbon", - "begin": "\"", - "end": "\"" - }, - { - "name": "string.quoted.triple.carbon", - "begin": "\"\"\"", - "end": "\"\"\"" - } - ] - }, - "special-keywords": { - "patterns": [ - { - "name": "keyword.control.less.carbon", - "match": "\\b(break|case|continue|default|else|if|for|match|return|returned|then|while)\\b" - } - ] - }, - "operator-dedicated-keywords-statements": { - "patterns": [ - { - "name": "keyword.carbon", - "match": "\\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\\b" - } - ] - }, - "reserved-words": { - "patterns": [ - { - "name": "support.type.carbon", - "match": "\\b(As|bool|Carbon\\.Int|Carbon\\.UInt|f16|f32|f64|f128|i8|i16|i32|i64|i128|i256|Slice|String|StringView|type|u8|u16|u32|u64|u128|u256)\\b" - } - ] - }, - "true-false": { - "patterns": [ - { - "name": "keyword.operator.new.carbon", - "match": "\\b(true|false)\\b" - } - ] - }, - "functions": { - "patterns": [ - { - "name": "support.function.carbon", - "match": "\\b[a-zA-Z]+\\s*\\(" - } - ] - }, - "customs": { - "patterns": [ - { - "name": "support.class.carbon", - "match": "(?<=\\bpackage\\s)\\w+" - }, - { - "name": "support.variable.carbon", - "match": "(?<=\\s*\\.)\\w+" - }, - { - "name": "support.variable.carbon", - "match": "(?<=\\bas\\s)\\w+" - }, - { - "name": "support.variable.carbon", - "match": "\\w+(?=\\s*:)" - }, - { - "name": "support.variable.carbon", - "match": "(?<=\\blet\\s)\\w+" - }, - { - "name": "support.variable.carbon", - "match": "(?<=\\bvar\\s)\\w+" - }, - { - "name": "support.function.carbon", - "match": "(?<=\\bfn\\s)\\w+" - }, - { - "name": "support.other.carbon", - "match": "(?<=\\bimpl\\s)\\w+" - }, - { - "name": "support.type.property-name.carbon", - "match": "(?<=\\bimport\\s)\\w+" - }, - { - "name": "support.class.carbon", - "match": "(?<=\\bclass\\s)\\w+" - } - ] - }, - "numbers": { - "patterns": [ - { - "name": "constant.numeric.carbon", - "match": "\\b\\d+\\b" - }, - { - "name": "constant.numeric.carbon", - "match": "\\b\\d+\\.\\d+\\b" - }, - { - "name": "constant.numeric.carbon", - "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" - } - ] - } - }, - "scopeName": "source.carbon" + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "carbon", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#operators" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "include": "#reserved-words" + }, + { + "include": "#operator-dedicated-keywords-statements" + }, + { + "include": "#ctrl-statements" + }, + { + "include": "#special-keywords" + }, + { + "include": "#true-false" + }, + { + "include": "#functions" + }, + { + "include": "#customs" + } + ], + "repository": { + "operators": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(\\+|-|\\*|/|!)\\b" + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.line.double-dash.carbon", + "begin": "//", + "end": "\n" + } + ] + }, + "strings": { + "patterns": [ + { + "name": "string.quoted.single.carbon", + "begin": "'", + "end": "'" + }, + { + "name": "string.quoted.double.carbon", + "begin": "\"", + "end": "\"" + }, + { + "name": "string.quoted.triple.carbon", + "begin": "\"\"\"", + "end": "\"\"\"" + } + ] + }, + "special-keywords": { + "patterns": [ + { + "name": "keyword.control.less.carbon", + "match": "\\b(break|case|continue|default|else|if|for|match|return|returned|then|while)\\b" + } + ] + }, + "operator-dedicated-keywords-statements": { + "patterns": [ + { + "name": "keyword.carbon", + "match": "\\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\\b" + } + ] + }, + "reserved-words": { + "patterns": [ + { + "name": "support.type.carbon", + "match": "\\b(As|bool|Carbon\\.Int|Carbon\\.UInt|f16|f32|f64|f128|i8|i16|i32|i64|i128|i256|Slice|String|StringView|type|u8|u16|u32|u64|u128|u256)\\b" + } + ] + }, + "true-false": { + "patterns": [ + { + "name": "keyword.operator.new.carbon", + "match": "\\b(true|false)\\b" + } + ] + }, + "functions": { + "patterns": [ + { + "name": "support.function.carbon", + "match": "\\b[a-zA-Z]+\\s*\\(" + } + ] + }, + "customs": { + "patterns": [ + { + "name": "support.class.carbon", + "match": "(?<=\\bpackage\\s)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\s*\\.)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\bas\\s)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "\\w+(?=\\s*:)" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\blet\\s)\\w+" + }, + { + "name": "support.variable.carbon", + "match": "(?<=\\bvar\\s)\\w+" + }, + { + "name": "support.function.carbon", + "match": "(?<=\\bfn\\s)\\w+" + }, + { + "name": "support.other.carbon", + "match": "(?<=\\bimpl\\s)\\w+" + }, + { + "name": "support.type.property-name.carbon", + "match": "(?<=\\bimport\\s)\\w+" + }, + { + "name": "support.class.carbon", + "match": "(?<=\\bclass\\s)\\w+" + } + ] + }, + "numbers": { + "patterns": [ + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d+\\.\\d+\\b" + }, + { + "name": "constant.numeric.carbon", + "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" + } + ] + } + }, + "scopeName": "source.carbon" } From 3c4dac1d05befa3e9884e71ded62b2e202fba8df Mon Sep 17 00:00:00 2001 From: rohanvashisht Date: Sat, 18 May 2024 04:04:11 +0530 Subject: [PATCH 17/34] ok --- utils/vscode/carbon.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/vscode/carbon.tmLanguage.json b/utils/vscode/carbon.tmLanguage.json index 42fc01b603057..d5c68e61e9e7a 120000 --- a/utils/vscode/carbon.tmLanguage.json +++ b/utils/vscode/carbon.tmLanguage.json @@ -1 +1 @@ -../textmate/Syntaxes/carbon.tmLanguage.json +../textmate/Syntaxes/carbon.tmLanguage.json \ No newline at end of file From cb8585f7dc54aafb60b2624dfbbf97c27afda96f Mon Sep 17 00:00:00 2001 From: rohanvashisht Date: Sat, 18 May 2024 04:24:59 +0530 Subject: [PATCH 18/34] ok --- .../textmate/Syntaxes/carbon.tmLanguage.json | 27 ++++- utils/vscode/language-configuration.json | 99 +++++++++++++------ 2 files changed, 93 insertions(+), 33 deletions(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index bc80055fd2e3a..9298b1a673f13 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -11,6 +11,9 @@ { "include": "#strings" }, + { + "include": "#string-escapes" + }, { "include": "#numbers" }, @@ -24,7 +27,19 @@ "include": "#ctrl-statements" }, { - "include": "#special-keywords" + "name": "string.quoted.triple.carbon", + "begin": "'''([^\\s'#]*\\n)?", + "end": "'''", + "beginCaptures": { + "1": { + "name": "constant.character.escape.carbon" + } + }, + "patterns": [ + { + "include": "#string_escapes" + } + ] }, { "include": "#true-false" @@ -68,11 +83,15 @@ }, { "name": "string.quoted.triple.carbon", - "begin": "\"\"\"", - "end": "\"\"\"" + "begin": "'''", + "end": "'''" } ] }, + "string_escapes": { + "name": "constant.character.escape.carbon", + "match": "\\\\([tnr'\"0\\0]|x[0-9A-F]{2}|u\\{[0-9A-F]{4,}\\})" + }, "special-keywords": { "patterns": [ { @@ -175,4 +194,4 @@ } }, "scopeName": "source.carbon" -} +} \ No newline at end of file diff --git a/utils/vscode/language-configuration.json b/utils/vscode/language-configuration.json index 0bae744c47b59..0b59c8ea70b17 100644 --- a/utils/vscode/language-configuration.json +++ b/utils/vscode/language-configuration.json @@ -1,32 +1,73 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM. // Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception. { - "comments": { - // symbol used for single line comment. Remove this entry if your language does not support line comments - "lineComment": "//", - }, - // symbols used as brackets - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - // symbols that are auto closed when typing - "autoClosingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ], - // symbols that can be used to surround a selection - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] + "comments": { + "lineComment": "//", + }, + // Symbols used as brackets. + "brackets": [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ] + ], + // Symbols that are auto closed when typing. + "autoClosingPairs": [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "\"", + "\"" + ], + [ + "'", + "'" + ] + ], + // Symbols that can be used to surround a selection. + "surroundingPairs": [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "(", + ")" + ], + [ + "\"", + "\"" + ], + [ + "'", + "'" + ], + [ + "'''", + "'''" ] -} + ] +} \ No newline at end of file From 114a36b7963e648cc8438819b5a395ffe0d03ed0 Mon Sep 17 00:00:00 2001 From: rohanvashisht Date: Sat, 18 May 2024 05:02:00 +0530 Subject: [PATCH 19/34] ok --- .../textmate/Syntaxes/carbon.tmLanguage.json | 74 ++++++++++++------- utils/vscode/package.json | 2 +- 2 files changed, 50 insertions(+), 26 deletions(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 9298b1a673f13..91733973bf061 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -1,6 +1,11 @@ { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "carbon", + "foldingStartMarker": "\\{\\s*$", + "foldingStopMarker": "^\\s*\\}", + "fileTypes": [ + "carbon" + ], "patterns": [ { "include": "#comments" @@ -8,11 +13,41 @@ { "include": "#operators" }, + { + "name": "string.quoted.triple.carbon", + "begin": "'''([^\\s'#]*\\n)?", + "end": "'''", + "beginCaptures": { + "1": { + "name": "constant.character.escape.carbon" + } + }, + "patterns": [ + { + "include": "#string_escapes" + } + ] + }, + { + "name": "string.quoted.double", + "begin": "\"([^\\s'#]*\\n)?", + "end": "\"", + "beginCaptures": { + "1": { + "name": "constant.character.escape.carbon" + } + }, + "patterns": [ + { + "include": "#string_escapes" + } + ] + }, { "include": "#strings" }, { - "include": "#string-escapes" + "include": "#special-keywords" }, { "include": "#numbers" @@ -26,21 +61,6 @@ { "include": "#ctrl-statements" }, - { - "name": "string.quoted.triple.carbon", - "begin": "'''([^\\s'#]*\\n)?", - "end": "'''", - "beginCaptures": { - "1": { - "name": "constant.character.escape.carbon" - } - }, - "patterns": [ - { - "include": "#string_escapes" - } - ] - }, { "include": "#true-false" }, @@ -63,7 +83,7 @@ "comments": { "patterns": [ { - "name": "comment.line.double-dash.carbon", + "name": "comment.line.double-slash.carbon", "begin": "//", "end": "\n" } @@ -89,13 +109,17 @@ ] }, "string_escapes": { - "name": "constant.character.escape.carbon", - "match": "\\\\([tnr'\"0\\0]|x[0-9A-F]{2}|u\\{[0-9A-F]{4,}\\})" + "patterns": [ + { + "name": "constant.character.escape.carbon", + "match": "\\\\([tnr'\"0\\0]|x[0-9A-F]{2}|u\\{[0-9A-F]{4,}\\})" + } + ] }, "special-keywords": { "patterns": [ { - "name": "keyword.control.less.carbon", + "name": "keyword.control.carbon", "match": "\\b(break|case|continue|default|else|if|for|match|return|returned|then|while)\\b" } ] @@ -103,7 +127,7 @@ "operator-dedicated-keywords-statements": { "patterns": [ { - "name": "keyword.carbon", + "name": "keyword.operator.new.carbon", "match": "\\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\\b" } ] @@ -119,7 +143,7 @@ "true-false": { "patterns": [ { - "name": "keyword.operator.new.carbon", + "name": "keyword.control.carbon", "match": "\\b(true|false)\\b" } ] @@ -180,15 +204,15 @@ "patterns": [ { "name": "constant.numeric.carbon", - "match": "\\b\\d+\\b" + "match": "0x[_0-9A-F]+(\\.[_0-9A-F]+(p[-+]?[1-9][0-9]*)?)?" }, { "name": "constant.numeric.carbon", - "match": "\\b\\d+\\.\\d+\\b" + "match": "0b[_01]+" }, { "name": "constant.numeric.carbon", - "match": "\\b\\d{1,3}(?:_\\d{3})*\\b" + "match": "[1-9][_0-9]*(\\.[_0-9]+(e[-+]?[1-9][0-9]*)?)?" } ] } diff --git a/utils/vscode/package.json b/utils/vscode/package.json index a80371eacfed5..25d2077491185 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -44,4 +44,4 @@ "dependencies": { "vscode-languageclient": "^8.1.0" } -} +} \ No newline at end of file From 5975efe874c712255082990868a2b285565c0539 Mon Sep 17 00:00:00 2001 From: rohanvashisht Date: Sat, 18 May 2024 05:13:42 +0530 Subject: [PATCH 20/34] ok --- .../textmate/Syntaxes/carbon.tmLanguage.json | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 91733973bf061..0e2b95337b9b8 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -28,21 +28,6 @@ } ] }, - { - "name": "string.quoted.double", - "begin": "\"([^\\s'#]*\\n)?", - "end": "\"", - "beginCaptures": { - "1": { - "name": "constant.character.escape.carbon" - } - }, - "patterns": [ - { - "include": "#string_escapes" - } - ] - }, { "include": "#strings" }, @@ -67,6 +52,21 @@ { "include": "#functions" }, + { + "name": "string.quoted.double", + "begin": "\"([^\\s'#]*\\n)?", + "end": "\"", + "beginCaptures": { + "1": { + "name": "constant.character.escape.carbon" + } + }, + "patterns": [ + { + "include": "#string_escapes" + } + ] + }, { "include": "#customs" } From fc729cbfb5f68d76c43ee40e128cc7fe06a93bb1 Mon Sep 17 00:00:00 2001 From: rohanvashisht Date: Sat, 18 May 2024 05:18:10 +0530 Subject: [PATCH 21/34] ok --- .../textmate/Syntaxes/carbon.tmLanguage.json | 53 +++++-------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 0e2b95337b9b8..2784dcee21461 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -13,24 +13,6 @@ { "include": "#operators" }, - { - "name": "string.quoted.triple.carbon", - "begin": "'''([^\\s'#]*\\n)?", - "end": "'''", - "beginCaptures": { - "1": { - "name": "constant.character.escape.carbon" - } - }, - "patterns": [ - { - "include": "#string_escapes" - } - ] - }, - { - "include": "#strings" - }, { "include": "#special-keywords" }, @@ -53,9 +35,9 @@ "include": "#functions" }, { - "name": "string.quoted.double", - "begin": "\"([^\\s'#]*\\n)?", - "end": "\"", + "name": "string.quoted.triple.carbon", + "begin": "'''([^\\s'#]*\\n)?", + "end": "'''", "beginCaptures": { "1": { "name": "constant.character.escape.carbon" @@ -67,6 +49,16 @@ } ] }, + { + "name": "string.quoted.double.carbon", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "include": "#string_escapes" + } + ] + }, { "include": "#customs" } @@ -89,25 +81,6 @@ } ] }, - "strings": { - "patterns": [ - { - "name": "string.quoted.single.carbon", - "begin": "'", - "end": "'" - }, - { - "name": "string.quoted.double.carbon", - "begin": "\"", - "end": "\"" - }, - { - "name": "string.quoted.triple.carbon", - "begin": "'''", - "end": "'''" - } - ] - }, "string_escapes": { "patterns": [ { From 21674a4d43d2ad21243e35898e8cbdc91d6a839b Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sat, 18 May 2024 12:18:11 +0530 Subject: [PATCH 22/34] Update utils/textmate/Syntaxes/carbon.tmLanguage.json Co-authored-by: Richard Smith --- utils/textmate/Syntaxes/carbon.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 2784dcee21461..5a458ccc0524e 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -67,7 +67,7 @@ "operators": { "patterns": [ { - "name": "keyword.operator.new.carbon", + "name": "keyword.operator.carbon", "match": "\\b(\\+|-|\\*|/|!)\\b" } ] From 94eb0a8a6af13a2203d11fb45c45a67f7b87d06e Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sat, 18 May 2024 12:18:23 +0530 Subject: [PATCH 23/34] Update utils/textmate/Syntaxes/carbon.tmLanguage.json Co-authored-by: Richard Smith --- utils/textmate/Syntaxes/carbon.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 5a458ccc0524e..40c0708d79f26 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -100,7 +100,7 @@ "operator-dedicated-keywords-statements": { "patterns": [ { - "name": "keyword.operator.new.carbon", + "name": "keyword.other.carbon", "match": "\\b(abstract|adapt|addr|alias|and|api|as|auto|base|choice|class|constraint|destructor|extend|final|fn|forall|friend|impl|impls|import|in|interface|let|library|like|namespace|not|observe|or|override|package|partial|private|protected|require|Self|template|type|var|virtual|where|_)\\b" } ] From df5113889eb8f2280962f14ed9aceab0a230d47c Mon Sep 17 00:00:00 2001 From: rohanvashisht Date: Sat, 18 May 2024 13:54:25 +0530 Subject: [PATCH 24/34] ok --- utils/textmate/Syntaxes/carbon.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 40c0708d79f26..324afe7501d43 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -116,7 +116,7 @@ "true-false": { "patterns": [ { - "name": "keyword.control.carbon", + "name": "constant.language.carbon", "match": "\\b(true|false)\\b" } ] From 79da246649c0427c571b4abc8af314949fddc712 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sun, 19 May 2024 14:21:54 +0530 Subject: [PATCH 25/34] Update utils/textmate/Syntaxes/carbon.tmLanguage.json Co-authored-by: Carbon Infra Bot --- utils/textmate/Syntaxes/carbon.tmLanguage.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 324afe7501d43..0132465db16c4 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -3,9 +3,7 @@ "name": "carbon", "foldingStartMarker": "\\{\\s*$", "foldingStopMarker": "^\\s*\\}", - "fileTypes": [ - "carbon" - ], + "fileTypes": ["carbon"], "patterns": [ { "include": "#comments" From 7b68d4767c850ced5d6d2a81a4dbd798319b0ea5 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sun, 19 May 2024 14:22:20 +0530 Subject: [PATCH 26/34] Update utils/vscode/language-configuration.json Co-authored-by: Carbon Infra Bot --- utils/vscode/language-configuration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/vscode/language-configuration.json b/utils/vscode/language-configuration.json index 0b59c8ea70b17..6d27fedaa5a23 100644 --- a/utils/vscode/language-configuration.json +++ b/utils/vscode/language-configuration.json @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception. { "comments": { - "lineComment": "//", + "lineComment": "//" }, // Symbols used as brackets. "brackets": [ From a27500f024f82a8726e9cb30a7938306cef8ed32 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sun, 19 May 2024 14:22:32 +0530 Subject: [PATCH 27/34] Update utils/vscode/language-configuration.json Co-authored-by: Carbon Infra Bot --- utils/vscode/language-configuration.json | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/utils/vscode/language-configuration.json b/utils/vscode/language-configuration.json index 6d27fedaa5a23..fcc11d0c3ca5f 100644 --- a/utils/vscode/language-configuration.json +++ b/utils/vscode/language-configuration.json @@ -7,18 +7,9 @@ }, // Symbols used as brackets. "brackets": [ - [ - "{", - "}" - ], - [ - "[", - "]" - ], - [ - "(", - ")" - ] + ["{", "}"], + ["[", "]"], + ["(", ")"] ], // Symbols that are auto closed when typing. "autoClosingPairs": [ From ddad5e6f3311712c9003be72a8f138778b1e614b Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sun, 19 May 2024 14:22:44 +0530 Subject: [PATCH 28/34] Update utils/vscode/language-configuration.json Co-authored-by: Carbon Infra Bot --- utils/vscode/language-configuration.json | 25 +++++------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/utils/vscode/language-configuration.json b/utils/vscode/language-configuration.json index fcc11d0c3ca5f..bfc1afc7570d8 100644 --- a/utils/vscode/language-configuration.json +++ b/utils/vscode/language-configuration.json @@ -13,26 +13,11 @@ ], // Symbols that are auto closed when typing. "autoClosingPairs": [ - [ - "{", - "}" - ], - [ - "[", - "]" - ], - [ - "(", - ")" - ], - [ - "\"", - "\"" - ], - [ - "'", - "'" - ] + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] ], // Symbols that can be used to surround a selection. "surroundingPairs": [ From 8839ced139b56f1452dba96b728c32b7bb603f33 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Sun, 19 May 2024 14:22:55 +0530 Subject: [PATCH 29/34] Update utils/vscode/language-configuration.json Co-authored-by: Carbon Infra Bot --- utils/vscode/language-configuration.json | 30 +++++------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/utils/vscode/language-configuration.json b/utils/vscode/language-configuration.json index bfc1afc7570d8..85843367c3df7 100644 --- a/utils/vscode/language-configuration.json +++ b/utils/vscode/language-configuration.json @@ -21,29 +21,11 @@ ], // Symbols that can be used to surround a selection. "surroundingPairs": [ - [ - "{", - "}" - ], - [ - "[", - "]" - ], - [ - "(", - ")" - ], - [ - "\"", - "\"" - ], - [ - "'", - "'" - ], - [ - "'''", - "'''" - ] + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"], + ["'''", "'''"] ] } \ No newline at end of file From b4f3e02dfec0535486bd669c068814120c2b50e1 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Mon, 20 May 2024 03:09:54 +0530 Subject: [PATCH 30/34] Update carbon.tmLanguage.json --- utils/textmate/Syntaxes/carbon.tmLanguage.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index 0132465db16c4..a9dd293f30f7d 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -1,3 +1,7 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM. +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception. + { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "carbon", @@ -189,4 +193,4 @@ } }, "scopeName": "source.carbon" -} \ No newline at end of file +} From 97f661c599aaa82dc04f10877b87bd67f986846a Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Mon, 20 May 2024 03:12:04 +0530 Subject: [PATCH 31/34] Update language-configuration.json --- utils/vscode/language-configuration.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/vscode/language-configuration.json b/utils/vscode/language-configuration.json index 85843367c3df7..7ae78a807806d 100644 --- a/utils/vscode/language-configuration.json +++ b/utils/vscode/language-configuration.json @@ -1,6 +1,7 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM. // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception. + { "comments": { "lineComment": "//" @@ -28,4 +29,4 @@ ["'", "'"], ["'''", "'''"] ] -} \ No newline at end of file +} From 5fadaac3b318b6d2666b162626c02062ae05acc2 Mon Sep 17 00:00:00 2001 From: rohanvashisht Date: Mon, 20 May 2024 16:52:27 +0530 Subject: [PATCH 32/34] ok --- utils/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/vscode/package.json b/utils/vscode/package.json index 25d2077491185..a80371eacfed5 100644 --- a/utils/vscode/package.json +++ b/utils/vscode/package.json @@ -44,4 +44,4 @@ "dependencies": { "vscode-languageclient": "^8.1.0" } -} \ No newline at end of file +} From 05a6df64bb59834244f4dcd82cfd85982ec0096b Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Tue, 21 May 2024 00:34:55 +0530 Subject: [PATCH 33/34] Update utils/textmate/Syntaxes/carbon.tmLanguage.json Co-authored-by: Richard Smith --- utils/textmate/Syntaxes/carbon.tmLanguage.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index a9dd293f30f7d..f34fb1070b87d 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -1,6 +1,6 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM. +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", From 17735183151657b7fe11d9fe91fe77ce6c374f92 Mon Sep 17 00:00:00 2001 From: rohanvashisht Date: Tue, 21 May 2024 01:00:14 +0530 Subject: [PATCH 34/34] ok --- utils/textmate/Syntaxes/carbon.tmLanguage.json | 13 +++++++++---- utils/vscode/language-configuration.json | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage.json b/utils/textmate/Syntaxes/carbon.tmLanguage.json index f34fb1070b87d..de3d06bf8b02c 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage.json +++ b/utils/textmate/Syntaxes/carbon.tmLanguage.json @@ -1,7 +1,6 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "carbon", @@ -77,9 +76,15 @@ "comments": { "patterns": [ { - "name": "comment.line.double-slash.carbon", - "begin": "//", - "end": "\n" + "begin": "(^[ \\t]+)?(?=//)", + "end": "(?!\\G)", + "patterns": [ + { + "name": "comment.line.carbon", + "begin": "//", + "end": "$" + } + ] } ] }, diff --git a/utils/vscode/language-configuration.json b/utils/vscode/language-configuration.json index 7ae78a807806d..cc458075583d0 100644 --- a/utils/vscode/language-configuration.json +++ b/utils/vscode/language-configuration.json @@ -1,6 +1,6 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM. +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception { "comments": {