Skip to content

Commit

Permalink
fix(tsx) after grammar rename (source.ts.tsx -> source.tsx), rules fo…
Browse files Browse the repository at this point in the history
…r completions need to be in tsx grammar + ts grammar

/cc @blakeembrey there might be a better way but this works for now :)
refs #458
  • Loading branch information
basarat committed Oct 23, 2015
1 parent c632047 commit 0cc6fc8
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions grammars/tsx.cson
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,80 @@ repository:
jsx:
name: "meta.jsx.tsx"
patterns: [
####
# Rules that no one should change
# These are used by code to provide fancy completions
####

{
'comment': 'Match debugger statement'
'match': '\\s*(debugger)[\\s;]+'
'captures':
'1':
'name':'keyword.debugger.ts'
}
{
'comment': 'Match full triple slash reference comments'
'match': '(\\/\\/\\/\\s*<reference\\s*path\\s*=)(.*)(\\/>)'
'captures':
'1':
'name':'keyword.other.ts'
'2':
'name':'reference.path.string'
'3':
'name':'keyword.other.ts'
}
{
'comment': 'Match <amd-dependency'
'match': '(\\/\\/\\/\\s*<amd-dependency\\s*path\\s*=)(.*)(\\/>)'
'captures':
'1':
'name':'keyword.other.ts'
'2':
'name':'amd.path.string'
'3':
'name':'keyword.other.ts'
}
{
'comment': 'Match <amd-module'
'match': '(\\/\\/\\/\\s*<amd-module\\s*name\\s*=)(.*)(\\/>)'
'captures':
'1':
'name':'keyword.other.ts'
'2':
'name':'amd.path.string'
'3':
'name':'keyword.other.ts'
}
{
'comment': 'Match import = require'
'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*\\((.*)\\)'
'captures':
'1':
'name':'keyword.other.ts'
'2':
'name':'variable.type.ts'
'3':
'name':'keyword.other.ts'
'4':
'name':'require.path.string'
}
{
'comment': 'Match ES6 "import from" syntax'
'match': '(import).*(from)\\s*(.*[\'"])'
'captures':
'1':
'name':'keyword.other.ts'
'2':
'name':'keyword.other.ts'
'3':
'name':'es6import.path.string'
}

####
# Other rules
####

{
include: "#jsx-tag-without-attributes"
}
Expand Down

0 comments on commit 0cc6fc8

Please sign in to comment.