Skip to content

Commit 4a20017

Browse files
authored
[SQL] correctly scope comments stored as part of column definitions in MySQL (#4542)
1 parent d7d5b9d commit 4a20017

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

SQL/MySQL.sublime-syntax

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,9 @@ contexts:
12021202
push: generated-always-as-expression
12031203
- match: \b(?i:stored|virtual)\b
12041204
scope: storage.modifier.sql
1205+
- match: \b(?i:comment)\b
1206+
scope: keyword.other.sql
1207+
push: single-string
12051208

12061209
generated-always-as-expression:
12071210
- include: maybe-group

SQL/tests/syntax/syntax_test_mysql.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,17 @@ create table IF NOT EXISTS `testing123` (
12151215
`fkey` INT UNSIGNED NULL REFERENCES test2(id),
12161216
-- ^^^^^^^^^^ storage.modifier.sql
12171217
`version` tinytext DEFAULT NULL COMMENT 'important clarification',
1218+
-- ^^^^^^^^^ meta.column-name.sql variable.other.member.declaration.sql
1219+
-- ^ punctuation.definition.identifier.begin.sql
1220+
-- ^ punctuation.definition.identifier.end.sql
12181221
-- ^^^^^^^^ storage.type.sql
1222+
-- ^^^^^^^ storage.modifier.sql
1223+
-- ^^^^ constant.language.null.sql
1224+
-- ^^^^^^^ keyword.other.sql
1225+
-- ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.sql string.quoted.single.sql
1226+
-- ^ punctuation.definition.string.begin.sql
1227+
-- ^ punctuation.definition.string.end.sql
1228+
-- ^ punctuation.separator.sequence.sql
12191229
`percentage` float DEFAULT '0',
12201230

12211231
`set` SET ('value1', 'value2') NOT NULL,

0 commit comments

Comments
 (0)