├── Support ├── src │ ├── .flowconfig │ ├── flow-get-importers.js │ └── flow-check-contents.js ├── _convertCode.command ├── Add Cursor Location to History.sh ├── Flow.sh └── build │ ├── flow-get-importers.js │ └── flow-check-contents.js ├── README.md ├── Proxies ├── Jump to definition 2.tmProxy ├── flow autocomplete manually.tmProxy ├── flow autocomplete esc.tmProxy └── Jump to definition.tmProxy ├── Commands ├── Add Cursor location to History.tmCommand ├── Flow type.tmCommand ├── Goto & Pop Cursor History.tmCommand ├── Flow jump to definition.tmCommand ├── flow autocomplete.tmCommand ├── flow status.tmCommand ├── Flow status 2.tmCommand ├── Flow jump to Module.tmCommand └── Flow get-importers.tmCommand ├── info.plist ├── Snippets └── React Boilerplate.tmSnippet ├── Syntaxes ├── HTML with JSX textContent.tmLanguage ├── JSX attribute values.tmLanguage └── JavaScript with JSX.tmLanguage └── Preferences └── Folding.tmPreferences /Support/src/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | [include] 4 | 5 | [libs] 6 | 7 | [options] 8 | -------------------------------------------------------------------------------- /Support/_convertCode.command: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash -l 2 | cd "$(dirname "$0")" 3 | 4 | babel --watch --out-dir ./build ./src 5 | -------------------------------------------------------------------------------- /Support/Add Cursor Location to History.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | Bookmarks="$TMPDIR/.TextMate_Cursor_History.urls" 4 | 5 | echo "txmt://open?url=file://${TM_FILEPATH// /%20}&line=$TM_LINE_NUMBER&column=$TM_COLUMN_NUMBER" >> "$Bookmarks" 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | JavaScript-with-JSX.tmbundle 2 | ============================ 3 | 4 | Injects XML syntax support into your JavaScript 5 | 6 | 7 | Requires 8 | 9 | 1. https://github.com/subtleGradient/javascript.tmbundle 10 | 2. https://github.com/subtleGradient/html5.tmbundle 11 | -------------------------------------------------------------------------------- /Support/Flow.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash -l 2 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 3 | 4 | cd "$(dirname "$TM_FILEPATH")" 5 | 6 | require_cmd flow 7 | flow "$@" --from TextMate 2> "$TMPDIR/flow-stderr.log" 8 | FlowError="$(<"$TMPDIR/flow-stderr.log")" 9 | 10 | if [[ "$FlowError" == *"Could not find a .flowconfig"* ]]; then 11 | exit_show_tool_tip "$FlowErrorMessage 12 | Flow couldn't find a .flowconfig" 13 | else 14 | echo "$FlowError" 1>&2 15 | fi 16 | 17 | exit $? 18 | -------------------------------------------------------------------------------- /Proxies/Jump to definition 2.tmProxy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | flow.jump-to-def 7 | keyEquivalent 8 | ~@ 9 | name 10 | Jump to definition (⌥⌘↩) 11 | scope 12 | source.js 13 | uuid 14 | C7E00D5E-FCDD-4A54-B32C-0096E9CDAEA4 15 | 16 | 17 | -------------------------------------------------------------------------------- /Proxies/flow autocomplete manually.tmProxy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | flow.autocomplete 7 | keyEquivalent 8 | ^ 9 | name 10 | flow autocomplete manually 11 | scope 12 | source.js 13 | uuid 14 | C8335665-8453-47AD-BA33-7C3EF56DAF12 15 | 16 | 17 | -------------------------------------------------------------------------------- /Support/src/flow-get-importers.js: -------------------------------------------------------------------------------- 1 | var importers = JSON.parse(process.env.FlowResponse || '{}'); 2 | var paths = importers[Object.keys(importers)[0]]; 3 | if (!paths) { 4 | process.exit(); 5 | } 6 | 7 | var pathToName = path => path.split('/').reverse()[0].split('.')[0]; 8 | 9 | var menuItemsPlist = paths.map(pathToName).map(name => `{ title = ${name}; }`); 10 | 11 | console.log( 12 | `( 13 | {header = 1; title = 'Modules that import "${process.env.FILENAME}"';}, 14 | ${menuItemsPlist.join(',')} 15 | )` 16 | ) 17 | 18 | console.warn( 19 | paths.join('\n') 20 | ) 21 | -------------------------------------------------------------------------------- /Proxies/flow autocomplete esc.tmProxy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | flow.autocomplete 7 | keyEquivalent 8 |  9 | name 10 | flow autocomplete esc 11 | scope 12 | source.js meta.complete.method 13 | uuid 14 | 76295ADA-F3E6-4049-9E90-4E925DF5F01F 15 | 16 | 17 | -------------------------------------------------------------------------------- /Proxies/Jump to definition.tmProxy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | flow.jump-to-def 7 | name 8 | Jump to definition (⌥⌘ click) 9 | scope 10 | (dyn.modifier.option & dyn.modifier.command) & source.js 11 | semanticClass 12 | callback.mouse-click 13 | uuid 14 | 9B5D27E2-3F33-41CA-A497-D5A9BEF05275 15 | 16 | 17 | -------------------------------------------------------------------------------- /Support/build/flow-get-importers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var importers = JSON.parse(process.env.FlowResponse || '{}'); 4 | var paths = importers[Object.keys(importers)[0]]; 5 | if (!paths) { 6 | process.exit(); 7 | } 8 | 9 | var pathToName = function pathToName(path) { 10 | return path.split('/').reverse()[0].split('.')[0]; 11 | }; 12 | 13 | var menuItemsPlist = paths.map(pathToName).map(function (name) { 14 | return '{ title = ' + name + '; }'; 15 | }); 16 | 17 | console.log('(\n {header = 1; title = \'Modules that import "' + process.env.FILENAME + '"\';},\n ' + menuItemsPlist.join(',') + '\n )'); 18 | 19 | console.warn(paths.join('\n')); -------------------------------------------------------------------------------- /Commands/Add Cursor location to History.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/bin/bash 9 | "$TM_BUNDLE_SUPPORT/Add Cursor Location to History.sh" 10 | 11 | input 12 | none 13 | inputFormat 14 | text 15 | name 16 | Add Cursor location to History 17 | outputCaret 18 | afterOutput 19 | outputFormat 20 | text 21 | outputLocation 22 | discard 23 | uuid 24 | DD0DDC06-35C0-4F3D-A2CE-8981E965C7BD 25 | version 26 | 2 27 | 28 | 29 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | boyvivbhf@fhogyrtenqvrag.pbz 7 | contactName 8 | Thomas Aylott 9 | description 10 | JSX Syntax for JavaScript. See http://facebook.github.io/react/ 11 | name 12 | JavaScript with JSX 13 | require 14 | 15 | 16 | name 17 | HTML5 — SubtleGradient 18 | uuid 19 | 630DEED4-EA5C-4592-9C06-6F9823C50718 20 | 21 | 22 | name 23 | JavaScript — SubtleGradient 24 | uuid 25 | 5B49710E-9A49-4BE0-BD45-6A9CB683C191 26 | 27 | 28 | uuid 29 | 4BA07E1A-2EA6-49F3-9F14-8A6ACA3F9617 30 | 31 | 32 | -------------------------------------------------------------------------------- /Snippets/React Boilerplate.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script> 7 | <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.min.js"></script> 8 | <script src="http://fb.me/react-with-addons-0.13.3.js"></script> 9 | 10 | <div id="${1:${TM_FILENAME/\..*|\W//g}}Root"></div> 11 | 12 | <script type="text/babel"> 13 | /* @flow */ 14 | 15 | var $1 = React.$0 16 | 17 | React.render( 18 | <$1 />, 19 | document.getElementById('$1Root') 20 | ); 21 | 22 | </script> 23 | 24 | name 25 | React Boilerplate 26 | scope 27 | text.html 28 | semanticClass 29 | react.snippet 30 | uuid 31 | 1B7CE152-0B5B-462C-B709-FDA7F744726A 32 | 33 | 34 | -------------------------------------------------------------------------------- /Commands/Flow type.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | cd "$(dirname "$TM_FILEPATH")" 10 | 11 | cat | flow type-at-pos "$TM_FILEPATH" $TM_LINE_NUMBER $TM_COLUMN_NUMBER | head -n 1 12 | 13 | input 14 | document 15 | inputFormat 16 | text 17 | name 18 | Flow type 19 | outputCaret 20 | afterOutput 21 | outputFormat 22 | text 23 | outputLocation 24 | toolTip 25 | scope 26 | (dyn.modifier.option -dyn.modifier.command) & source.js 27 | semanticClass 28 | callback.mouse-click 29 | uuid 30 | D28B319D-C2E7-41A4-BCCD-8C31029FCB7C 31 | version 32 | 2 33 | 34 | 35 | -------------------------------------------------------------------------------- /Commands/Goto & Pop Cursor History.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash 9 | Bookmarks="$TMPDIR/.TextMate_Cursor_History.urls" 10 | 11 | if [[ ! -f "$Bookmarks" ]]; then 12 | echo "No history yet" 13 | exit 14 | fi 15 | 16 | URL="$(tail -n 1 "$Bookmarks")" 17 | if [[ "$URL" == "" ]]; then 18 | echo "No history" 19 | exit 20 | fi 21 | open "$URL" 22 | 23 | cat "$Bookmarks" | awk 'NR>1{print p}{p=$0}' > "$Bookmarks.NEXT" 24 | rm "$Bookmarks" 25 | mv "$Bookmarks.NEXT" "$Bookmarks" 26 | 27 | input 28 | none 29 | inputFormat 30 | text 31 | keyEquivalent 32 | ~$@ 33 | name 34 | Goto & Pop Cursor History 35 | outputCaret 36 | afterOutput 37 | outputFormat 38 | text 39 | outputLocation 40 | toolTip 41 | scope 42 | source.js 43 | uuid 44 | EA0766C5-C3D4-42EB-8794-C889D811EAE7 45 | version 46 | 2 47 | 48 | 49 | -------------------------------------------------------------------------------- /Commands/Flow jump to definition.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | cd "$(dirname "$TM_FILEPATH")" 10 | 11 | Definition="$(cat | flow get-def "$TM_FILEPATH" $TM_LINE_NUMBER $TM_COLUMN_NUMBER --from TextMate)" 12 | 13 | File="$(echo $Definition | cut -d ':' -f 1)" 14 | Line="$(echo $Definition | cut -d ':' -f 2-999 | tr ',' '-')" 15 | 16 | # echo "$TM_MATE" --line "$Line" "$File" 17 | 18 | if [[ ! -e "$File" ]]; then 19 | echo "Not found" 20 | exit 21 | fi 22 | 23 | "$TM_MATE" --line "$Line" "$File" 24 | 25 | "$TM_BUNDLE_SUPPORT/Add Cursor Location to History.sh" 26 | 27 | input 28 | document 29 | inputFormat 30 | text 31 | name 32 | Flow jump to definition 33 | outputCaret 34 | afterOutput 35 | outputFormat 36 | text 37 | outputLocation 38 | toolTip 39 | scope 40 | source.js 41 | semanticClass 42 | flow.jump-to-def 43 | uuid 44 | F1359C61-C51B-42A9-9828-69E6F5A20160 45 | version 46 | 2 47 | 48 | 49 | -------------------------------------------------------------------------------- /Syntaxes/HTML with JSX textContent.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | injectionSelector 8 | source.js.jsx meta.tag.block.begin$, meta.scope.jsx$ 9 | name 10 | HTML with JSX textContent 11 | patterns 12 | 13 | 14 | begin 15 | \{ 16 | beginCaptures 17 | 18 | 0 19 | 20 | name 21 | punctuation.section.embedded.begin.jsx 22 | 23 | 24 | contentName 25 | source.js.jsx 26 | end 27 | } 28 | endCaptures 29 | 30 | 0 31 | 32 | name 33 | punctuation.section.embedded.end.jsx 34 | 35 | 36 | name 37 | meta.embedded.expression.jsx 38 | patterns 39 | 40 | 41 | include 42 | source.js.jsx 43 | 44 | 45 | 46 | 47 | scopeName 48 | source.js.jsx.react 49 | uuid 50 | 82F0C794-92B6-4F54-9D7C-C9F37FFD1460 51 | 52 | 53 | -------------------------------------------------------------------------------- /Commands/flow autocomplete.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | cd "$(dirname "$TM_FILEPATH")" 10 | 11 | # echo "cat '$TM_FILEPATH' | flow autocomplete '$TM_FILEPATH' $TM_LINE_NUMBER $TM_COLUMN_NUMBER" | pbcopy 12 | 13 | suggestions_raw="$( 14 | cat \ 15 | | flow autocomplete "$TM_FILEPATH" $TM_LINE_NUMBER $TM_COLUMN_NUMBER \ 16 | | cut -d ' ' -f 1 \ 17 | | sed -E 's/(.+)/{display=\1;},/' 18 | )" 19 | 20 | if [[ "$suggestions_raw" == '' ]]; then 21 | "$DIALOG" tooltip --text "No suggestions :'(" & 22 | exit 23 | fi 24 | 25 | "$DIALOG" popup --suggestions "($suggestions_raw)" 26 | 27 | input 28 | document 29 | inputFormat 30 | text 31 | name 32 | flow autocomplete 33 | outputCaret 34 | afterOutput 35 | outputFormat 36 | text 37 | outputLocation 38 | toolTip 39 | scope 40 | source.js 41 | semanticClass 42 | flow.autocomplete 43 | uuid 44 | D0AF8296-0D72-45BF-80C5-DBEF623D3076 45 | version 46 | 2 47 | 48 | 49 | -------------------------------------------------------------------------------- /Commands/flow status.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | . "${TM_SUPPORT_PATH}/lib/html.sh" 11 | . "${TM_SUPPORT_PATH}/lib/webpreview.sh" 12 | 13 | cd "$(dirname "$TM_FILEPATH")" 14 | 15 | export FlowResponse="$( 16 | cat | flow check-contents "$TM_FILEPATH" --json 2> "$TMPDIR/flow-stderr.log" 17 | )" 18 | export FlowError="$(<"$TMPDIR/flow-stderr.log")" 19 | 20 | html_header "Flow Check Contents" 21 | 22 | require_cmd node 23 | node "$TM_BUNDLE_SUPPORT/build/flow-check-contents.js" 24 | 25 | html_footer 26 | 27 | input 28 | document 29 | inputFormat 30 | text 31 | keyEquivalent 32 | ^V 33 | name 34 | Flow check contents 35 | outputCaret 36 | afterOutput 37 | outputFormat 38 | html 39 | outputLocation 40 | newWindow 41 | scope 42 | source.js.jsx 43 | uuid 44 | 3FFCE570-C99D-4626-84AE-1CE39329AB85 45 | version 46 | 2 47 | 48 | 49 | -------------------------------------------------------------------------------- /Commands/Flow status 2.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | . "${TM_SUPPORT_PATH}/lib/html.sh" 11 | . "${TM_SUPPORT_PATH}/lib/webpreview.sh" 12 | 13 | cd "$(dirname "$TM_FILEPATH")" 14 | 15 | # export FlowResponse="$( 16 | # cat | flow check-contents "$TM_FILEPATH" --json 2> "$TMPDIR/flow-stderr.log" 17 | # )" 18 | export FlowResponse="$( 19 | flow status --json 2> "$TMPDIR/flow-stderr.log" 20 | )" 21 | export FlowError="$(<"$TMPDIR/flow-stderr.log")" 22 | 23 | html_header "Flow Status" 24 | 25 | require_cmd node 26 | node "$TM_BUNDLE_SUPPORT/build/flow-check-contents.js" 27 | 28 | html_footer 29 | 30 | input 31 | none 32 | inputFormat 33 | text 34 | name 35 | Flow status 36 | outputCaret 37 | afterOutput 38 | outputFormat 39 | html 40 | outputLocation 41 | newWindow 42 | scope 43 | source.js.jsx 44 | semanticClass 45 | callback.document.did-save 46 | uuid 47 | FA79F210-7974-4400-AC50-B2105628D8BA 48 | version 49 | 2 50 | 51 | 52 | -------------------------------------------------------------------------------- /Commands/Flow jump to Module.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | cd "$(dirname "$TM_FILEPATH")" 10 | 11 | if [[ "$TM_SELECTED_TEXT" != "" ]]; then 12 | ModuleName="$TM_SELECTED_TEXT" 13 | else 14 | ModuleName="$(cat | sed -E 's;\.\.?/|\.js;;g')" 15 | fi 16 | 17 | File="$(flow find-module "$ModuleName" | cut -d "'" -f 4)" 18 | 19 | if [[ ! -f "$File" ]]; then 20 | File="/$(flow get-imports "$TM_FILEPATH" | grep "/$ModuleName\." | cut -d'@' -f1 | cut -d'/' -f2-999)" 21 | fi 22 | 23 | if [[ ! -f "$File" ]]; then 24 | if [[ "$File" != "/" ]]; then 25 | echo "File '$File' not found" 26 | else 27 | echo "Module '$ModuleName' not found" 28 | fi 29 | exit 30 | fi 31 | 32 | "$TM_MATE" "$File" 33 | 34 | "$TM_BUNDLE_SUPPORT/Add Cursor Location to History.sh" 35 | 36 | input 37 | scope 38 | inputFormat 39 | text 40 | name 41 | Flow jump to Module 42 | outputCaret 43 | afterOutput 44 | outputFormat 45 | text 46 | outputLocation 47 | toolTip 48 | scope 49 | source.js string -punctuation, source.js entity.name.tag 50 | semanticClass 51 | flow.jump-to-def 52 | uuid 53 | 9366AFC6-1AA2-478C-8E0C-9B86A92EC488 54 | version 55 | 2 56 | 57 | 58 | -------------------------------------------------------------------------------- /Preferences/Folding.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | JSX Settings 7 | scope 8 | source.js.jsx meta.scope.tag.block 9 | settings 10 | 11 | foldingStartMarker 12 | (?x)(?i) 13 | (?: 14 | < 15 | [_$a-z][-.:_$a-z0-9]* 16 | [^>]* 17 | >? 18 | (?<whatever> 19 | [^<>] 20 | | 21 | <[^>]*> 22 | )* 23 | $ 24 | ) 25 | | 26 | (?: 27 | \{\s*$ 28 | ) 29 | 30 | foldingStopMarker 31 | (?x)(?i) 32 | (?: 33 | /> 34 | (?<noTags> 35 | [^<>] 36 | | 37 | <(?!/)[^>]*> 38 | )* 39 | $ 40 | ) 41 | | 42 | (?: 43 | ^ 44 | (?<noCloseTags> 45 | [^<>] 46 | | 47 | <(?!/)[^>]*> 48 | )* 49 | </ 50 | [_$a-z][-.:_$a-z0-9]* 51 | > 52 | ) 53 | | 54 | (?: 55 | ^\s*\} 56 | ) 57 | 58 | highlightPairs 59 | 60 | 61 | ` 62 | ` 63 | 64 | 65 | ' 66 | ' 67 | 68 | 69 | " 70 | " 71 | 72 | 73 | ( 74 | ) 75 | 76 | 77 | /(\w+=)?\{/ 78 | } 79 | 80 | 81 | [ 82 | ] 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | /<\w+/ 94 | /\/>/ 95 | 96 | 97 | /<(\w+)[^>]*(?<!/)>/ 98 | /</\w+>/ 99 | 100 | 101 | 102 | uuid 103 | C561EFD8-4078-49A3-9F13-FF6AF2F52CFF 104 | 105 | 106 | -------------------------------------------------------------------------------- /Support/src/flow-check-contents.js: -------------------------------------------------------------------------------- 1 | if (process.env.FlowError) { 2 | console.log(process.env.FlowError) 3 | process.exit() 4 | } 5 | var response = JSON.parse(process.env.FlowResponse || '{}'); 6 | var {passed, errors, version} = response; 7 | if (passed && errors.length === 0) { 8 | console.log("No Flow errors!", new Date) 9 | process.exit() 10 | } 11 | 12 | var doesThisFileHaveIssues 13 | 14 | process.stdout.write(` 15 | 16 | 25 | 26 | 27 | `); 28 | 29 | function getName(path, line){ 30 | if (path === process.env.TM_FILEPATH) { 31 | return ':' + line; 32 | } 33 | return path.split('/').reverse()[0].split('.')[0] 34 | } 35 | 36 | errors.forEach(({message}, errorIndex) => { 37 | message.forEach(function({descr, level, path, line, endline, start, end}, index){ 38 | if (path === process.env.TM_FILEPATH) { 39 | doesThisFileHaveIssues = true; 40 | } 41 | var name = getName(path, line); 42 | var href = `txmt://open?url=file://${encodeURIComponent(path)}&line=${encodeURIComponent(line)}&column=${encodeURIComponent(start)}` 43 | var body = descr.split('\n').map((line, descrIndex) => ` 44 | ${line.replace(/`([^`]*)`/g, '$1')} 45 | `).join('
') 46 | var link = path && ` 47 | ${name} 48 | ` || '' 49 | process.stdout.write(` 50 | 51 |
${index === 0 && errorIndex + 1 || ''} 52 | 53 | ${link} 54 | 55 |
56 | ${body} 57 |
58 | `); 59 | // console.log({descr, level, path, line, endline, start, end}) 60 | }) 61 | }) 62 | 63 | process.stdout.write(`
`); 64 | 65 | process.stdout.write(` 66 |

${process.env.TM_FILENAME} ${doesThisFileHaveIssues ? 'has errors' : 'has no errors'}

67 | `); 68 | 69 | process.stdout.write(` 70 | ${new Date} 71 | `); 72 | 73 | // process.stdout.write(` 74 | //
${JSON.stringify(response, null, 2)}
75 | // `); 76 | -------------------------------------------------------------------------------- /Commands/Flow get-importers.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env bash -l 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | cd "${TM_PROJECT_DIRECTORY:-$TM_DIRECTORY}" 11 | 12 | export FILENAME="$(echo "$TM_FILENAME" | cut -d'.' -f1)" 13 | require_cmd flow 14 | export FlowResponse="$( 15 | flow get-importers "$TM_FILEPATH" "$FILENAME" --json --from TextMate 16 | )" 17 | # echo "FlowResponse='$FlowResponse'" 18 | # if [[ $? != 0 ]]; then 19 | # echo "flow get-importers didn't get any importers :'(" 20 | # exit 21 | # fi 22 | 23 | require_cmd node 24 | FlowMenuItems="$( 25 | node "$TM_BUNDLE_SUPPORT/build/flow-get-importers.js" 2> "$TMPDIR/.flow-get-importers-result" 26 | )" 27 | FlowPaths="$(<"$TMPDIR/.flow-get-importers-result")" 28 | # echo "FlowPaths='$FlowPaths'" 29 | 30 | Choice="$( 31 | "$DIALOG" menu --items "$FlowMenuItems" | plutil -convert json - -o - | cut -d'"' -f4 32 | )" 33 | 34 | File="$( 35 | echo "$FlowPaths" | grep "$Choice" 36 | )" 37 | 38 | if [[ ! -f "$File" ]]; then 39 | File="$(flow find-module "$File" | cut -d "'" -f 4)" 40 | fi 41 | 42 | if [[ ! -f "$File" ]]; then 43 | if [[ "$File" == "" ]]; then 44 | echo "flow get-importers didn't get any importers :'(" 45 | else 46 | echo "File '$File' not found" 47 | fi 48 | # echo " 49 | # FlowPaths='$FlowPaths' 50 | # FlowResponse='$FlowResponse' 51 | # " 52 | exit 53 | fi 54 | 55 | "$TM_MATE" "$File" 56 | 57 | "$TM_BUNDLE_SUPPORT/Add Cursor Location to History.sh" 58 | 59 | contentMatch 60 | flow.get-importers 61 | input 62 | none 63 | inputFormat 64 | text 65 | keyEquivalent 66 | ~@ 67 | name 68 | Flow jump to importers 69 | outputCaret 70 | afterOutput 71 | outputFormat 72 | text 73 | outputLocation 74 | toolTip 75 | scope 76 | source.js 77 | uuid 78 | B01C8EC1-876C-4C96-80A7-AAC6E2E1B38C 79 | version 80 | 2 81 | 82 | 83 | -------------------------------------------------------------------------------- /Support/build/flow-check-contents.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | if (process.env.FlowError) { 4 | console.log(process.env.FlowError); 5 | process.exit(); 6 | } 7 | var response = JSON.parse(process.env.FlowResponse || '{}'); 8 | var passed = response.passed; 9 | var errors = response.errors; 10 | var version = response.version; 11 | 12 | if (passed && errors.length === 0) { 13 | console.log("No Flow errors!", new Date()); 14 | process.exit(); 15 | } 16 | 17 | var doesThisFileHaveIssues; 18 | 19 | process.stdout.write('\n \n \n \n \n'); 20 | 21 | function getName(path, line) { 22 | if (path === process.env.TM_FILEPATH) { 23 | return ':' + line; 24 | } 25 | return path.split('/').reverse()[0].split('.')[0]; 26 | } 27 | 28 | errors.forEach(function (_ref, errorIndex) { 29 | var message = _ref.message; 30 | 31 | message.forEach(function (_ref2, index) { 32 | var descr = _ref2.descr; 33 | var level = _ref2.level; 34 | var path = _ref2.path; 35 | var line = _ref2.line; 36 | var endline = _ref2.endline; 37 | var start = _ref2.start; 38 | var end = _ref2.end; 39 | 40 | if (path === process.env.TM_FILEPATH) { 41 | doesThisFileHaveIssues = true; 42 | } 43 | var name = getName(path, line); 44 | var href = 'txmt://open?url=file://' + encodeURIComponent(path) + '&line=' + encodeURIComponent(line) + '&column=' + encodeURIComponent(start); 45 | var body = descr.split('\n').map(function (line, descrIndex) { 46 | return '\n ' + line.replace(/`([^`]*)`/g, '$1') + '\n '; 47 | }).join('
'); 48 | var link = path && '\n ' + name + '\n ' || ''; 49 | process.stdout.write('\n \n
' + (index === 0 && errorIndex + 1 || '') + '\n \n ' + link + '\n \n
\n ' + body + '\n
\n '); 50 | // console.log({descr, level, path, line, endline, start, end}) 51 | }); 52 | }); 53 | 54 | process.stdout.write('
'); 55 | 56 | process.stdout.write('\n

' + process.env.TM_FILENAME + ' ' + (doesThisFileHaveIssues ? 'has errors' : 'has no errors') + '

\n'); 57 | 58 | process.stdout.write('\n ' + new Date() + '\n'); 59 | 60 | // process.stdout.write(` 61 | //
${JSON.stringify(response, null, 2)}
62 | // `); -------------------------------------------------------------------------------- /Syntaxes/JSX attribute values.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | injectionSelector 8 | source.js.jsx meta.tag.block.begin$ 9 | name 10 | JSX attribute values 11 | patterns 12 | 13 | 14 | begin 15 | \s*([_$a-zA-Z0-9][-_$a-zA-Z0-9]*)(=)(\{) 16 | beginCaptures 17 | 18 | 1 19 | 20 | name 21 | entity.other.attribute-name.$1.jsx 22 | 23 | 2 24 | 25 | name 26 | punctuation.separator.key-value.attribute.jsx 27 | 28 | 3 29 | 30 | name 31 | punctuation.section.embedded.begin.jsx 32 | 33 | 34 | contentName 35 | source.js.jsx 36 | end 37 | } 38 | endCaptures 39 | 40 | 0 41 | 42 | name 43 | punctuation.section.embedded.end.jsx 44 | 45 | 46 | name 47 | meta.embedded.expression.$1.jsx 48 | patterns 49 | 50 | 51 | include 52 | source.js.jsx 53 | 54 | 55 | 56 | 57 | match 58 | ([_$a-zA-Z0-9][-_$a-zA-Z0-9]*) 59 | name 60 | entity.other.attribute-name.$1.jsx 61 | 62 | 63 | begin 64 | " 65 | beginCaptures 66 | 67 | 0 68 | 69 | name 70 | punctuation.definition.string.begin.jsx 71 | 72 | 73 | contentName 74 | meta.scope.inner 75 | end 76 | " 77 | endCaptures 78 | 79 | 0 80 | 81 | name 82 | punctuation.definition.string.end.jsx 83 | 84 | 85 | name 86 | string.quoted.double.jsx 87 | 88 | 89 | begin 90 | ' 91 | beginCaptures 92 | 93 | 0 94 | 95 | name 96 | punctuation.definition.string.begin.jsx 97 | 98 | 99 | contentName 100 | meta.scope.inner 101 | end 102 | ' 103 | endCaptures 104 | 105 | 0 106 | 107 | name 108 | punctuation.definition.string.end.jsx 109 | 110 | 111 | name 112 | string.quoted.single.jsx 113 | 114 | 115 | scopeName 116 | source.js.jsx.attribute-values 117 | uuid 118 | 4E87F1E0-BFD2-4857-8548-1E29D04D8B54 119 | 120 | 121 | -------------------------------------------------------------------------------- /Syntaxes/JavaScript with JSX.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | jsx 8 | react.js 9 | 10 | firstLineMatch 11 | @jsx 12 | keyEquivalent 13 | ^~J 14 | name 15 | JavaScript with JSX 16 | patterns 17 | 18 | 19 | captures 20 | 21 | 1 22 | 23 | name 24 | keyword.control 25 | 26 | 27 | match 28 | (return)\s*(?=<) 29 | 30 | 31 | begin 32 | (return) 33 | beginCaptures 34 | 35 | 1 36 | 37 | name 38 | keyword.control 39 | 40 | 41 | end 42 | (?=;)|$ 43 | name 44 | meta.expression.es 45 | patterns 46 | 47 | 48 | include 49 | #object 50 | 51 | 52 | include 53 | $self 54 | 55 | 56 | 57 | 58 | include 59 | #square 60 | 61 | 62 | begin 63 | ` 64 | beginCaptures 65 | 66 | 0 67 | 68 | name 69 | punctuation.definition.string.begin.es6 70 | 71 | 72 | end 73 | ` 74 | endCaptures 75 | 76 | 0 77 | 78 | name 79 | punctuation.definition.string.end.es6 80 | 81 | 82 | name 83 | string.quoted.other.es6 84 | patterns 85 | 86 | 87 | match 88 | \\[\s\S] 89 | name 90 | constant.character.escape.es 91 | 92 | 93 | begin 94 | \$\{ 95 | beginCaptures 96 | 97 | 0 98 | 99 | name 100 | punctuation.section.embedded.begin.es6 101 | 102 | 103 | contentName 104 | source.js.jsx 105 | end 106 | } 107 | endCaptures 108 | 109 | 0 110 | 111 | name 112 | punctuation.section.embedded.begin.es6 113 | 114 | 115 | name 116 | meta.embedded.expression.es6 117 | patterns 118 | 119 | 120 | include 121 | $self 122 | 123 | 124 | 125 | 126 | 127 | 128 | captures 129 | 130 | 1 131 | 132 | name 133 | punctuation.definition.preprocessor.begin.hack 134 | 135 | 2 136 | 137 | name 138 | punctuation.definition.preprocessor.end.hack 139 | 140 | 141 | match 142 | (/\*)(?:\??[_$a-zA-Z0-9]+(?:<[^>]+>)?\|?)+(\*/ ) 143 | name 144 | storage.type.class.hack 145 | 146 | 147 | match 148 | (?<=[_$a-zA-Z0-9\)\]\}>])\s*< 149 | name 150 | keyword.operator.comparison.js 151 | 152 | 153 | include 154 | #block_tag 155 | 156 | 157 | begin 158 | { 159 | beginCaptures 160 | 161 | 0 162 | 163 | name 164 | punctuation.section.group.begin.es 165 | 166 | 167 | comment 168 | 12.1 Block http://es5.github.com/#x12.1 169 | contentName 170 | meta.block.es 171 | end 172 | } 173 | endCaptures 174 | 175 | 0 176 | 177 | name 178 | punctuation.section.group.end.es 179 | 180 | 181 | patterns 182 | 183 | 184 | include 185 | $self 186 | 187 | 188 | 189 | 190 | begin 191 | (class) 192 | beginCaptures 193 | 194 | 1 195 | 196 | name 197 | storage.type.class.es 198 | 199 | 200 | contentName 201 | meta.class.es 202 | end 203 | (?<=}) 204 | patterns 205 | 206 | 207 | begin 208 | { 209 | beginCaptures 210 | 211 | 0 212 | 213 | name 214 | punctuation.definition.function.begin.es 215 | 216 | 217 | comment 218 | class body 219 | contentName 220 | meta.class.body.es 221 | end 222 | } 223 | endCaptures 224 | 225 | 0 226 | 227 | name 228 | punctuation.definition.function.end.es 229 | 230 | 231 | patterns 232 | 233 | 234 | begin 235 | < 236 | end 237 | > 238 | name 239 | storage.modifier.flow 240 | 241 | 242 | include 243 | #method 244 | 245 | 246 | include 247 | #class-property 248 | 249 | 250 | include 251 | $self 252 | 253 | 254 | 255 | 256 | include 257 | $self 258 | 259 | 260 | 261 | 262 | captures 263 | 264 | 1 265 | 266 | name 267 | entity.name.function.$1.es 268 | 269 | 2 270 | 271 | name 272 | punctuation.definition.function.es 273 | 274 | 3 275 | 276 | name 277 | meta.function.parameters 278 | 279 | 4 280 | 281 | name 282 | variable.parameter.function.es 283 | 284 | 5 285 | 286 | name 287 | punctuation.definition.function.arrow.es 288 | 289 | 290 | comment 291 | 14.2 Arrow Function Definitions http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions 292 | match 293 | (?:((?:[_$a-z]|@@)[_$a-z0-9]*)\s*(=)\s*)?(?i)(((?:[_$a-z]|@@)[_$a-z0-9]*))\b\s*(=>)\s? 294 | name 295 | meta.function.arrow.${1:-unnamed}.with-only-one-arg 296 | 297 | 298 | begin 299 | (=>) ({) 300 | beginCaptures 301 | 302 | 1 303 | 304 | name 305 | punctuation.definition.function.arrow.es 306 | 307 | 2 308 | 309 | name 310 | punctuation.definition.function.begin.es 311 | 312 | 313 | contentName 314 | meta.function.arrow.innards.es 315 | end 316 | (}) 317 | endCaptures 318 | 319 | 1 320 | 321 | name 322 | punctuation.definition.function.end.es 323 | 324 | 325 | name 326 | meta.function.arrow.es 327 | patterns 328 | 329 | 330 | include 331 | $self 332 | 333 | 334 | 335 | 336 | begin 337 | \b(function|(?:get|set)(?=\s+[_$a-zA-Z]))(?:\s+((?i)(?:[_$a-z]|@@)[_$a-z0-9]*)\b(<[^>]*>)?)? 338 | beginCaptures 339 | 340 | 1 341 | 342 | name 343 | keyword.control.def.es 344 | 345 | 2 346 | 347 | name 348 | entity.name.function.$1.es 349 | 350 | 3 351 | 352 | name 353 | storage.type.flow 354 | 355 | 356 | comment 357 | 13 Function Definition http://es5.github.com/#x13 358 | end 359 | (?<=})|(?=[;,]) 360 | name 361 | meta.$1.${2:-unnamed} 362 | patterns 363 | 364 | 365 | begin 366 | \G 367 | end 368 | (?<=\)) 369 | patterns 370 | 371 | 372 | begin 373 | \G(?!\() 374 | end 375 | (?=\() 376 | patterns 377 | 378 | 379 | include 380 | source.js#comments 381 | 382 | 383 | match 384 | \b(?i)(?:[_$a-z]|@@)[_$a-z0-9]*\b 385 | name 386 | entity.name.function.$1.es 387 | 388 | 389 | 390 | 391 | include 392 | #function-params 393 | 394 | 395 | 396 | 397 | include 398 | source.js#comments 399 | 400 | 401 | include 402 | #return-type 403 | 404 | 405 | begin 406 | { 407 | beginCaptures 408 | 409 | 0 410 | 411 | name 412 | punctuation.definition.function.begin.es 413 | 414 | 415 | comment 416 | function body 417 | contentName 418 | meta.function.body 419 | end 420 | } 421 | endCaptures 422 | 423 | 0 424 | 425 | name 426 | punctuation.definition.function.end.es 427 | 428 | 429 | patterns 430 | 431 | 432 | include 433 | $self 434 | 435 | 436 | 437 | 438 | 439 | 440 | captures 441 | 442 | 1 443 | 444 | name 445 | punctuation.definition.function.arrow.es 446 | 447 | 448 | match 449 | (=>)\s+ 450 | 451 | 452 | captures 453 | 454 | 1 455 | 456 | name 457 | keyword.control 458 | 459 | 460 | match 461 | (return)\s+ 462 | 463 | 464 | include 465 | #var 466 | 467 | 468 | begin 469 | (\.)?(\b(?i)(?:[_$a-z]|@@)[_$a-z0-9]*\b)(\() 470 | beginCaptures 471 | 472 | 1 473 | 474 | name 475 | punctuation.separator.continuation.method.call.es 476 | 477 | 2 478 | 479 | name 480 | entity.name.function.call.$2.es 481 | 482 | 3 483 | 484 | name 485 | punctuation.definition.arguments.begin.es 486 | 487 | 488 | end 489 | (\)) 490 | endCaptures 491 | 492 | 1 493 | 494 | name 495 | punctuation.definition.arguments.end.es 496 | 497 | 498 | name 499 | meta.function-call.$2.es 500 | patterns 501 | 502 | 503 | include 504 | #round 505 | 506 | 507 | include 508 | $self 509 | 510 | 511 | 512 | 513 | include 514 | source.js 515 | 516 | 517 | repository 518 | 519 | block_tag 520 | 521 | patterns 522 | 523 | 524 | match 525 | </([^>]*)> 526 | name 527 | invalid.illegal.tag.end.${1/[:.]/-/g}.jsx 528 | 529 | 530 | begin 531 | (?=(<)([a-zA-Z0-9_$][^\s</>]*)) 532 | end 533 | (?x) 534 | ( 535 | </(\2)> 536 | | 537 | /> # cannot be a lookbehind :( 538 | ) 539 | (?:(\s*)\n)? # allows code folding to work for top level JSX tags 540 | 541 | endCaptures 542 | 543 | 1 544 | 545 | name 546 | meta.tag.block.end.${2/[:.]/-/g}.jsx 547 | 548 | 2 549 | 550 | name 551 | entity.name.tag.${2/[:.]/-/g}.jsx 552 | 553 | 3 554 | 555 | name 556 | punctuation.whitespace.embedded.trailing 557 | 558 | 559 | name 560 | meta.scope.tag.block.${2/[:.]/-/g}.jsx 561 | patterns 562 | 563 | 564 | begin 565 | \G(<)([^\s</>]+) 566 | beginCaptures 567 | 568 | 2 569 | 570 | name 571 | entity.name.tag.${2/[:.]/-/g}.jsx 572 | 573 | 574 | end 575 | (?=/>)|> 576 | name 577 | meta.tag.block.begin.${2/[:.]/-/g}.jsx 578 | patterns 579 | 580 | 581 | include 582 | #attr 583 | 584 | 585 | 586 | 587 | match 588 | </([^>]*)> 589 | name 590 | invalid.illegal.tag.end.${1/[:.]/-/g}.jsx 591 | 592 | 593 | match 594 | <(/[a-zA-Z0-9_$.]*)?($|\s) 595 | name 596 | invalid.illegal.tag.end.jsx 597 | 598 | 599 | begin 600 | (?<=>)(?!<$)(?!<\s)(?!</) 601 | end 602 | (?=</) 603 | name 604 | meta.scope.jsx 605 | patterns 606 | 607 | 608 | include 609 | #block_tag 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | class-property 618 | 619 | patterns 620 | 621 | 622 | begin 623 | ((?i)(?:[_$a-z]|@@)[_$a-z0-9]*)(:) 624 | beginCaptures 625 | 626 | 1 627 | 628 | name 629 | variable.other.property.class.es 630 | 631 | 2 632 | 633 | name 634 | punctuation.definition.type.flow 635 | 636 | 637 | end 638 | (?=[,);]) 639 | patterns 640 | 641 | 642 | include 643 | #types 644 | 645 | 646 | 647 | 648 | 649 | destructured-whatever 650 | 651 | patterns 652 | 653 | 654 | begin 655 | \{ 656 | beginCaptures 657 | 658 | 0 659 | 660 | name 661 | punctuation.definition.parameters.begin.destructured.es 662 | 663 | 664 | end 665 | \} 666 | endCaptures 667 | 668 | 0 669 | 670 | name 671 | punctuation.definition.parameters.end.destructured.es 672 | 673 | 674 | name 675 | meta.block.destructured.es 676 | patterns 677 | 678 | 679 | match 680 | , 681 | name 682 | punctuation.definition.parameters.separator.destructured.es 683 | 684 | 685 | include 686 | #var-name 687 | 688 | 689 | include 690 | #destructured-whatever 691 | 692 | 693 | 694 | 695 | 696 | function-params 697 | 698 | begin 699 | \( 700 | beginCaptures 701 | 702 | 0 703 | 704 | name 705 | punctuation.definition.parameters.begin.function.es 706 | 707 | 708 | comment 709 | function parameters 710 | end 711 | \) 712 | endCaptures 713 | 714 | 0 715 | 716 | name 717 | punctuation.definition.parameters.end.function.es 718 | 719 | 720 | name 721 | meta.function.parameters 722 | patterns 723 | 724 | 725 | include 726 | source.js#comments 727 | 728 | 729 | match 730 | \b(?i)(?:[_$a-z]|@@)[_$a-z0-9]*\b 731 | name 732 | variable.parameter.function.es 733 | 734 | 735 | include 736 | #type-def 737 | 738 | 739 | match 740 | , 741 | name 742 | punctuation.separator.parameters.function.es 743 | 744 | 745 | match 746 | \.\.\. 747 | name 748 | keyword.other.rest-args.es 749 | 750 | 751 | 752 | method 753 | 754 | begin 755 | (?:(static)\s*)?((?i)(?:[_$a-z]|@@)[_$a-z0-9]*)\b(<[^>]*>)?(?=\() 756 | beginCaptures 757 | 758 | 1 759 | 760 | name 761 | storage.modifier.static.es 762 | 763 | 2 764 | 765 | name 766 | entity.name.function.method.es 767 | 768 | 769 | end 770 | (?<=})|(?=[;,]) 771 | name 772 | meta.function.method.$2.es 773 | patterns 774 | 775 | 776 | begin 777 | \G(?=\() 778 | end 779 | (?<=\))|(?=[;,]) 780 | patterns 781 | 782 | 783 | include 784 | #function-params 785 | 786 | 787 | include 788 | #nested-brackets 789 | 790 | 791 | 792 | 793 | include 794 | #return-type 795 | 796 | 797 | begin 798 | { 799 | beginCaptures 800 | 801 | 0 802 | 803 | name 804 | punctuation.definition.function.begin.es 805 | 806 | 807 | comment 808 | function body 809 | contentName 810 | meta.function.body 811 | end 812 | } 813 | endCaptures 814 | 815 | 0 816 | 817 | name 818 | punctuation.definition.function.end.es 819 | 820 | 821 | patterns 822 | 823 | 824 | include 825 | $self 826 | 827 | 828 | include 829 | #nested-brackets 830 | 831 | 832 | 833 | 834 | match 835 | \} 836 | name 837 | invalid.illegal.brace 838 | 839 | 840 | 841 | nested-brackets 842 | 843 | patterns 844 | 845 | 846 | begin 847 | { 848 | end 849 | } 850 | patterns 851 | 852 | 853 | include 854 | #nested-brackets 855 | 856 | 857 | 858 | 859 | 860 | object 861 | 862 | begin 863 | { 864 | beginCaptures 865 | 866 | 0 867 | 868 | name 869 | punctuation.definition.object.begin.es 870 | 871 | 872 | end 873 | } 874 | endCaptures 875 | 876 | 0 877 | 878 | name 879 | punctuation.definition.object.end.es 880 | 881 | 882 | name 883 | meta.structure.object.es 884 | patterns 885 | 886 | 887 | include 888 | $self 889 | 890 | 891 | 892 | return-type 893 | 894 | begin 895 | (?<=\))(?!\{) 896 | end 897 | (?=[\{;]) 898 | name 899 | meta.directive.return-type.flow 900 | patterns 901 | 902 | 903 | include 904 | source.js#comments 905 | 906 | 907 | include 908 | #type-def 909 | 910 | 911 | 912 | round 913 | 914 | begin 915 | \( 916 | end 917 | \) 918 | patterns 919 | 920 | 921 | include 922 | #round 923 | 924 | 925 | include 926 | $self 927 | 928 | 929 | 930 | square 931 | 932 | begin 933 | \[ 934 | beginCaptures 935 | 936 | 0 937 | 938 | name 939 | punctuation.definition.array.begin.es 940 | 941 | 942 | end 943 | \] 944 | endCaptures 945 | 946 | 0 947 | 948 | name 949 | punctuation.definition.array.end.es 950 | 951 | 952 | name 953 | meta.array.es 954 | patterns 955 | 956 | 957 | include 958 | $self 959 | 960 | 961 | 962 | type-def 963 | 964 | patterns 965 | 966 | 967 | begin 968 | (\??:) 969 | beginCaptures 970 | 971 | 1 972 | 973 | name 974 | punctuation.definition.type.flow 975 | 976 | 977 | end 978 | (?=[,;)\]{}=]) 979 | name 980 | meta.scope 981 | patterns 982 | 983 | 984 | include 985 | #types 986 | 987 | 988 | 989 | 990 | 991 | types 992 | 993 | patterns 994 | 995 | 996 | include 997 | source.js#comments 998 | 999 | 1000 | begin 1001 | (?=\??\() 1002 | end 1003 | (?=[,;)\]{}=]) 1004 | name 1005 | storage.type.function.flow 1006 | patterns 1007 | 1008 | 1009 | begin 1010 | \??(\() 1011 | end 1012 | (\))(\s*=>)? 1013 | patterns 1014 | 1015 | 1016 | include 1017 | #types 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | begin 1025 | (\??)((?i)(?:[_$a-z]|@@)[_$a-z0-9]*)(<) 1026 | beginCaptures 1027 | 1028 | 2 1029 | 1030 | name 1031 | punctuation.definition.arguments.begin.es 1032 | 1033 | 1034 | end 1035 | (>) 1036 | endCaptures 1037 | 1038 | 1 1039 | 1040 | name 1041 | punctuation.definition.arguments.end.es 1042 | 1043 | 1044 | name 1045 | storage.type.${1-unnamed}.flow 1046 | patterns 1047 | 1048 | 1049 | include 1050 | #types 1051 | 1052 | 1053 | 1054 | 1055 | begin 1056 | (?<=:)\s*(\??)\{ 1057 | beginCaptures 1058 | 1059 | 1 1060 | 1061 | name 1062 | punctuation.definition.arguments.begin.es 1063 | 1064 | 1065 | end 1066 | } 1067 | name 1068 | storage.type.flow 1069 | patterns 1070 | 1071 | 1072 | include 1073 | #types 1074 | 1075 | 1076 | 1077 | 1078 | begin 1079 | \[ 1080 | end 1081 | \] 1082 | name 1083 | storage.type.flow 1084 | patterns 1085 | 1086 | 1087 | include 1088 | #types 1089 | 1090 | 1091 | 1092 | 1093 | captures 1094 | 1095 | 1 1096 | 1097 | name 1098 | punctuation.definition.optional.flow 1099 | 1100 | 1101 | match 1102 | (\??)((?i)(?:[_$a-z]|@@)[_$a-z0-9]*) 1103 | name 1104 | storage.type.${0-unnamed}.flow 1105 | 1106 | 1107 | 1108 | var 1109 | 1110 | patterns 1111 | 1112 | 1113 | begin 1114 | (?:(export)\s*)?(?<!import )\b(var|const|let|type)\b(?=\s*[@_$a-zA-Z0-9{\[]) 1115 | beginCaptures 1116 | 1117 | 1 1118 | 1119 | name 1120 | storage.modifier.exports.es 1121 | 1122 | 2 1123 | 1124 | name 1125 | storage.type.$1.es 1126 | 1127 | 1128 | end 1129 | (?=[;})])|$|(?=\b(in|of)\b) 1130 | name 1131 | meta.expression.es 1132 | patterns 1133 | 1134 | 1135 | begin 1136 | (\G|,) 1137 | beginCaptures 1138 | 1139 | 1 1140 | 1141 | name 1142 | punctuation.definition.variable.es 1143 | 1144 | 1145 | end 1146 | (?=[;})])|$|(?=\b(in|of)\b) 1147 | name 1148 | meta.scope.var 1149 | patterns 1150 | 1151 | 1152 | include 1153 | #var-part 1154 | 1155 | 1156 | 1157 | 1158 | include 1159 | #nested-brackets 1160 | 1161 | 1162 | 1163 | 1164 | 1165 | var-name 1166 | 1167 | captures 1168 | 1169 | 1 1170 | 1171 | name 1172 | variable.other.readwrite.js 1173 | 1174 | 2 1175 | 1176 | name 1177 | storage.type.flow 1178 | 1179 | 3 1180 | 1181 | name 1182 | punctuation.definition.arguments.begin.flow.es 1183 | 1184 | 4 1185 | 1186 | patterns 1187 | 1188 | 1189 | match 1190 | ((?i)(?:[_$a-z]|@@)[_$a-z0-9]*)\b 1191 | name 1192 | variable.parameter.flow 1193 | 1194 | 1195 | 1196 | 5 1197 | 1198 | name 1199 | punctuation.definition.arguments.end.flow.es 1200 | 1201 | 1202 | match 1203 | ((?i)(?:[_$a-z]|@@)[_$a-z0-9]*)((<)([^>]*)(>))? 1204 | 1205 | var-part 1206 | 1207 | patterns 1208 | 1209 | 1210 | include 1211 | #destructured-whatever 1212 | 1213 | 1214 | include 1215 | #var-name 1216 | 1217 | 1218 | include 1219 | #type-def 1220 | 1221 | 1222 | begin 1223 | (=) 1224 | beginCaptures 1225 | 1226 | 1 1227 | 1228 | name 1229 | keyword.operator.assignment.$1.es 1230 | 1231 | 1232 | end 1233 | (?=[,;}])|$ 1234 | name 1235 | meta.scope.var.right-side 1236 | patterns 1237 | 1238 | 1239 | include 1240 | #object 1241 | 1242 | 1243 | include 1244 | #round 1245 | 1246 | 1247 | include 1248 | $self 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | scopeName 1256 | source.js.jsx 1257 | uuid 1258 | 6DAD38D9-0DCB-4F22-9EE6-4D1F3BBE3C5B 1259 | 1260 | 1261 | --------------------------------------------------------------------------------