Skip to content

Commit 0cc6fc8

Browse files
committed
fix(tsx) after grammar rename (source.ts.tsx -> source.tsx), rules for completions need to be in tsx grammar + ts grammar
/cc @blakeembrey there might be a better way but this works for now :) refs #458
1 parent c632047 commit 0cc6fc8

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

grammars/tsx.cson

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,80 @@ repository:
10701070
jsx:
10711071
name: "meta.jsx.tsx"
10721072
patterns: [
1073+
####
1074+
# Rules that no one should change
1075+
# These are used by code to provide fancy completions
1076+
####
1077+
1078+
{
1079+
'comment': 'Match debugger statement'
1080+
'match': '\\s*(debugger)[\\s;]+'
1081+
'captures':
1082+
'1':
1083+
'name':'keyword.debugger.ts'
1084+
}
1085+
{
1086+
'comment': 'Match full triple slash reference comments'
1087+
'match': '(\\/\\/\\/\\s*<reference\\s*path\\s*=)(.*)(\\/>)'
1088+
'captures':
1089+
'1':
1090+
'name':'keyword.other.ts'
1091+
'2':
1092+
'name':'reference.path.string'
1093+
'3':
1094+
'name':'keyword.other.ts'
1095+
}
1096+
{
1097+
'comment': 'Match <amd-dependency'
1098+
'match': '(\\/\\/\\/\\s*<amd-dependency\\s*path\\s*=)(.*)(\\/>)'
1099+
'captures':
1100+
'1':
1101+
'name':'keyword.other.ts'
1102+
'2':
1103+
'name':'amd.path.string'
1104+
'3':
1105+
'name':'keyword.other.ts'
1106+
}
1107+
{
1108+
'comment': 'Match <amd-module'
1109+
'match': '(\\/\\/\\/\\s*<amd-module\\s*name\\s*=)(.*)(\\/>)'
1110+
'captures':
1111+
'1':
1112+
'name':'keyword.other.ts'
1113+
'2':
1114+
'name':'amd.path.string'
1115+
'3':
1116+
'name':'keyword.other.ts'
1117+
}
1118+
{
1119+
'comment': 'Match import = require'
1120+
'match': '(import)\\s*([\\p{L}\\p{Nl}$_][\\p{L}\\p{Nl}$\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\x{200C}\\x{200D}]*)?\\s*=\\s*(require)\\s*\\((.*)\\)'
1121+
'captures':
1122+
'1':
1123+
'name':'keyword.other.ts'
1124+
'2':
1125+
'name':'variable.type.ts'
1126+
'3':
1127+
'name':'keyword.other.ts'
1128+
'4':
1129+
'name':'require.path.string'
1130+
}
1131+
{
1132+
'comment': 'Match ES6 "import from" syntax'
1133+
'match': '(import).*(from)\\s*(.*[\'"])'
1134+
'captures':
1135+
'1':
1136+
'name':'keyword.other.ts'
1137+
'2':
1138+
'name':'keyword.other.ts'
1139+
'3':
1140+
'name':'es6import.path.string'
1141+
}
1142+
1143+
####
1144+
# Other rules
1145+
####
1146+
10731147
{
10741148
include: "#jsx-tag-without-attributes"
10751149
}

0 commit comments

Comments
 (0)