Skip to content

Commit

Permalink
[SQL] remove constant.other.placeholder scope from identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-hall committed Sep 24, 2021
1 parent be2d354 commit be7d7fc
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 81 deletions.
10 changes: 5 additions & 5 deletions SQL/SQL (basic).sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -382,27 +382,27 @@ contexts:
push: [join-on, table-name-or-subquery]

column-name:
- meta_content_scope: meta.column-name.sql constant.other.placeholder.sql
- meta_content_scope: meta.column-name.sql
- match: ''
pop: true

column-alias:
- meta_content_scope: meta.column-alias.sql constant.other.placeholder.sql
- meta_content_scope: meta.column-alias.sql
- match: ''
pop: true

database-name:
- meta_content_scope: meta.database-name.sql constant.other.placeholder.sql
- meta_content_scope: meta.database-name.sql
- match: ''
pop: true

table-name:
- meta_content_scope: meta.table-name.sql constant.other.placeholder.sql
- meta_content_scope: meta.table-name.sql
- match: ''
pop: true

procedure-name:
- meta_content_scope: meta.procedure-name.sql constant.other.placeholder.sql
- meta_content_scope: meta.procedure-name.sql
- match: ''
pop: true

Expand Down
6 changes: 3 additions & 3 deletions SQL/TSQL.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,12 @@ contexts:
push: begin-method-call-paren

label-name:
- meta_content_scope: meta.label-name.sql constant.other.placeholder.sql
- meta_content_scope: meta.label-name.sql
- match: ''
pop: true

cursor-name:
- meta_content_scope: meta.cursor-name.sql constant.other.placeholder.sql
- meta_content_scope: meta.cursor-name.sql
- match: ''
pop: true

Expand Down Expand Up @@ -422,6 +422,6 @@ contexts:
- include: expressions

cte-table-name:
- meta_content_scope: meta.cte-table-name.sql constant.other.placeholder.sql
- meta_content_scope: meta.cte-table-name.sql
- match: ''
pop: true
25 changes: 15 additions & 10 deletions SQL/syntax_test_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ create table fancy_table (
mytime2 timestamp(3) without time zone DEFAULT '2008-01-18 00:00:00'::timestamp(3) without time zone,
-- ^^^^^^^^^^^^^^^^^^^ storage.type.sql
some_number numeric(5, 2) DEFAULT 0,
-- ^^^^^^^^^^^ meta.column-name constant.other.placeholder
-- ^^^^^^^^^^^ meta.column-name
-- ^^^^^^^^^^^^^ storage.type
-- ^ constant.numeric
-- ^ punctuation.separator.sequence
Expand All @@ -118,26 +118,31 @@ create table fancy_table (
-- ^^^^^^^^^^ storage.modifier.sql
-- ^^^^^ storage.modifier.sql
-- ^^^^^^^^^^^^^^^^^^ meta.group meta.group
-- ^^ meta.column-name constant.other.placeholder
-- ^^ meta.column-name
-- ^^ keyword.operator.comparison
-- ^^^^^^^^^^ meta.column-name constant.other.placeholder
-- ^^^^^^^^^^ meta.column-name
);

CREATE INDEX ON fancy_table(mytime);
-- ^^^^^ keyword.other.sql
-- ^^ keyword.other
-- ^^^^^^^^^^^ meta.table-name constant.other.placeholder
-- ^^^^^^^^^^^ meta.table-name

CREATE INDEX ON fancy_table USING gin (fancy_column gin_trgm_ops);
-- ^^^^^ keyword.other.sql
-- ^^ keyword.other
-- ^^^^^^^^^^^ meta.table-name constant.other.placeholder
-- ^^^^^^^^^^^ meta.table-name
-- ^^^^^ keyword.other

CREATE UNIQUE INDEX ON fancy_table(fancy_column,mycount) WHERE myflag IS NULL;
-- ^^^^^^^^^^^^ keyword.other.sql
-- ^^ meta.create keyword.other
-- ^^^^^^^^^^^ meta.table-name constant.other.placeholder
-- ^^^^^^^^^^^ meta.table-name
-- ^ meta.group punctuation.section.group.begin
-- ^^^^^^^^^^^^ meta.group meta.column-name
-- ^ meta.group punctuation.separator.sequence
-- ^^^^^^^ meta.group meta.column-name
-- ^ meta.group punctuation.section.group.end
-- ^^^^^ keyword.other.DML.sql
-- ^^ keyword.operator.logical.sql
-- ^^^^ constant.language.null.sql
Expand All @@ -149,14 +154,14 @@ create fulltext index if not exists `myindex` ON mytable;
-- ^^^^^^ keyword.operator.logical
-- ^^^^^^^^^ meta.toc-list.full-identifier entity.name.function
-- ^^ keyword.other
-- ^^^^^^^ meta.table-name constant.other.placeholder
-- ^^^^^^^ meta.table-name
-- ^ punctuation.terminator.statement

ALTER TABLE dbo.testing123 ADD COLUMN mycolumn longtext;
-- ^^^^^^^^ meta.alter keyword.other.ddl
-- ^^^ keyword.other.ddl.sql
-- ^^^^^^ keyword.other.ddl.sql
-- ^^^^^^^^ meta.column-name constant.other.placeholder
-- ^^^^^^^^ meta.column-name
-- ^^^^^^^^ storage.type.sql

ALTER TABLE testing123 CHANGE COLUMN mycolumn mycolumn ENUM('foo', 'bar');
Expand All @@ -168,7 +173,7 @@ DROP TABLE IF EXISTS testing123;
-- ^^^^^^^ meta.drop keyword.other.ddl
-- ^^ meta.drop keyword.control.flow
-- ^^^^^^ keyword.operator.logical.sql
-- ^^^^^^^^^^ meta.table-name constant.other.placeholder
-- ^^^^^^^^^^ meta.table-name
-- ^ punctuation.terminator.statement

select *
Expand Down Expand Up @@ -215,7 +220,7 @@ SELECT *,
-- ^ variable.language.wildcard.asterisk.sql
f.id AS database_id
-- ^^ keyword.operator.assignment.alias.sql
-- ^^^^^^^^^^^ meta.column-alias constant.other.placeholder
-- ^^^^^^^^^^^ meta.column-alias
FROM foo
WHERE f.a IS NULL
-- ^^ keyword.other.DML.sql
Expand Down
Loading

0 comments on commit be7d7fc

Please sign in to comment.