├── .gitignore ├── .travis.yml ├── Commands ├── Format Code.tmCommand ├── Run Focused Test.tmCommand ├── Run.tmCommand └── Toggle EEx Tags.tmCommand ├── Default.sublime-keymap ├── Elixir - elixir $file.sublime-build ├── Elixir - mix test $file.sublime-build ├── Elixir - mix test.sublime-build ├── LICENSE ├── Macros └── Overwrite } in #{ .. }.tmMacro ├── Menus └── Main.sublime-menu ├── Preferences ├── Comments.tmPreferences ├── EExComments.tmPreferences ├── Indent.tmPreferences ├── Symbol List - Module.tmPreferences ├── Symbol List - Private Function.tmPreferences ├── Symbol List - Protocol Definition.tmPreferences ├── Symbol List - Protocol Implementation.tmPreferences ├── Symbol List - Public Function.tmPreferences └── Typing Pairs.tmPreferences ├── README.markdown ├── Settings └── Elixir.sublime-settings ├── Snippets ├── Embedded String.tmSnippet ├── Insert Tag.tmSnippet ├── case.tmSnippet ├── cond.tmSnippet ├── def.tmSnippet ├── def_one_line.tmSnippet ├── defcallback.tmSnippet ├── defdelegate.tmSnippet ├── defexception.tmSnippet ├── defimpl.tmSnippet ├── defmacro.tmSnippet ├── defmacrocallback.tmSnippet ├── defmacrop.tmSnippet ├── defmodule.tmSnippet ├── defp.tmSnippet ├── defprotocol.tmSnippet ├── defstruct.tmSnippet ├── describe.tmSnippet ├── do.tmSnippet ├── doc.tmSnippet ├── fn.tmSnippet ├── for.tmSnippet ├── if.tmSnippet ├── if_else.tmSnippet ├── if_else_one_line.tmSnippet ├── if_one_line.tmSnippet ├── import.tmSnippet ├── inspect.tmSnippet ├── io_inspect.tmSnippet ├── key_arrow_value.tmSnippet ├── map_struct.tmSnippet ├── moduledoc.tmSnippet ├── pry.tmSnippet ├── receive.tmSnippet ├── require.tmSnippet ├── setup.tmSnippet ├── test.tmSnippet ├── unless.tmSnippet ├── unless_else.tmSnippet ├── unless_else_one_line.tmSnippet └── unless_one_line.tmSnippet ├── Syntaxes ├── EEx.tmLanguage ├── Elixir.tmLanguage └── HTML (EEx).tmLanguage ├── info.plist ├── mix_format_file.py └── syntax_test.elixir /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .DS_Store 3 | *.cache -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | global: 3 | - PACKAGE="Elixir" # Package name 4 | - SUBLIME_TEXT_VERSION="3" 5 | 6 | services: 7 | # enable gui, see https://docs.travis-ci.com/user/gui-and-headless-browsers 8 | - xvfb 9 | 10 | # mutliple os matrix 11 | # https://docs.travis-ci.com/user/multi-os/#Python-example-(unsupported-languages) 12 | matrix: 13 | include: 14 | - os: linux 15 | language: python 16 | python: 3.4 17 | - os: osx 18 | language: generic 19 | 20 | before_install: 21 | - curl -OL https://raw.githubusercontent.com/SublimeText/UnitTesting/master/sbin/travis.sh 22 | 23 | install: 24 | # bootstrap the testing environment 25 | - sh travis.sh bootstrap 26 | 27 | script: 28 | # testing syntax_test files 29 | - sh travis.sh run_syntax_tests 30 | 31 | notifications: 32 | email: false 33 | -------------------------------------------------------------------------------- /Commands/Format Code.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveModifiedFiles 7 | command 8 | #!/usr/bin/env ruby18 9 | require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/executor" 10 | TextMate::Executor.run(e_sh(ENV['TM_MIX'] || 'mix'), 'format', ENV['TM_FILEPATH']) 11 | 12 | input 13 | document 14 | inputFormat 15 | text 16 | keyEquivalent 17 | @e 18 | name 19 | Format Code 20 | outputCaret 21 | afterOutput 22 | outputFormat 23 | html 24 | outputLocation 25 | newWindow 26 | scope 27 | source.elixir 28 | uuid 29 | C5F486D4-4EB3-434C-BCE5-6E741FF8893F 30 | version 31 | 2 32 | 33 | 34 | -------------------------------------------------------------------------------- /Commands/Run Focused Test.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveModifiedFiles 7 | command 8 | #!/usr/bin/env ruby18 9 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/save_current_document" 10 | require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/executor" 11 | 12 | TextMate.save_if_untitled('exs') 13 | 14 | if ENV['TM_FILEPATH'].match(/\/test\/.*_test.exs$/) 15 | TextMate::Executor.run(e_sh(ENV['TM_MIX'] || 'mix'), 'test', "#{ENV['TM_FILEPATH']}:#{ENV['TM_LINE_NUMBER']}") 16 | else 17 | puts "Not a test" 18 | end 19 | 20 | input 21 | document 22 | inputFormat 23 | text 24 | keyEquivalent 25 | @R 26 | name 27 | Run Focused Test 28 | outputCaret 29 | afterOutput 30 | outputFormat 31 | html 32 | outputLocation 33 | newWindow 34 | scope 35 | source.elixir 36 | uuid 37 | CE857198-BBB1-4AF2-AA99-87740503390F 38 | version 39 | 2 40 | 41 | 42 | -------------------------------------------------------------------------------- /Commands/Run.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveModifiedFiles 7 | command 8 | #!/usr/bin/env ruby18 9 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/save_current_document" 10 | require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/executor" 11 | 12 | TextMate.save_if_untitled('exs') 13 | 14 | if ENV['TM_FILEPATH'].match(/\/test\/.*_test.exs$/) 15 | TextMate::Executor.run(e_sh(ENV['TM_MIX'] || 'mix'), 'test', ENV['TM_FILEPATH']) 16 | else 17 | TextMate::Executor.run(e_sh(ENV['TM_ELIXIR'] || 'elixir'), ENV['TM_FILEPATH']) 18 | end 19 | 20 | input 21 | document 22 | inputFormat 23 | text 24 | keyEquivalent 25 | @r 26 | name 27 | Run 28 | outputCaret 29 | afterOutput 30 | outputFormat 31 | html 32 | outputLocation 33 | newWindow 34 | scope 35 | source.elixir 36 | uuid 37 | 06E4B9F0-06CD-4B95-822F-2CC67E3802C2 38 | version 39 | 2 40 | 41 | 42 | -------------------------------------------------------------------------------- /Commands/Toggle EEx Tags.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 -w 9 | 10 | # Originally from the Ruby bundle for ERB tags 11 | 12 | require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape" 13 | require "enumerator" 14 | 15 | TAGS = %w[<%# <%% <%= <%].freeze 16 | 17 | # locate caret (Allan's code) 18 | line = ENV['TM_LINE_NUMBER'].to_i - ENV['TM_INPUT_START_LINE'].to_i 19 | col = ENV['TM_LINE_INDEX'].to_i 20 | if ENV['TM_LINE_NUMBER'].to_i == ENV['TM_INPUT_START_LINE'].to_i 21 | col -= ENV['TM_INPUT_START_LINE_INDEX'].to_i 22 | end 23 | 24 | # read input 25 | input = $stdin.read 26 | 27 | # snippetize output 28 | lines = RUBY_VERSION < "1.9" ? input.to_a : input.lines.to_a 29 | lines[line] = e_sn(lines[line][0...col]) + "${0}" + e_sn(lines[line][col..-1]) 30 | enum = RUBY_VERSION < "1.9" ? lines.enum_with_index : 31 | lines.each.with_index 32 | output = enum.inject(String.new) do |out, (l, i)| 33 | i == line ? out + l : out + e_sn(l) 34 | end 35 | 36 | # swap EEx tags 37 | result = output.sub(/\A<%[%#=]?/) { |match| TAGS[TAGS.index(match) - 1] } 38 | print result 39 | disableOutputAutoIndent 40 | 41 | fallbackInput 42 | scope 43 | hideFromUser 44 | 45 | input 46 | selection 47 | inputFormat 48 | text 49 | keyEquivalent 50 | ^> 51 | name 52 | Toggle EEx Tags 53 | outputCaret 54 | afterOutput 55 | outputFormat 56 | snippet 57 | outputLocation 58 | replaceInput 59 | scope 60 | text.html.elixir meta.embedded.line.elixir, text.elixir meta.embedded.line.elixir,text.html.elixir comment.block.elixir, text.elixir comment.block.elixir 61 | uuid 62 | 038A0943-8456-4592-B9AD-F62D295613FE 63 | version 64 | 2 65 | 66 | 67 | -------------------------------------------------------------------------------- /Default.sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "keys": ["super+shift+c"], 4 | "caption": "mix format $file", 5 | "command": "mix_format_file", 6 | "selector": "source.elixir" 7 | }, 8 | 9 | { 10 | "keys": ["{"], 11 | "command": "insert_snippet", 12 | "args": {"contents": "{$0}"}, 13 | "context": [ 14 | { 15 | "key": "setting.auto_match_enabled", 16 | "operator": "equal", 17 | "operand": true 18 | }, 19 | { 20 | "key": "selection_empty", 21 | "operator": "equal", 22 | "operand": true, 23 | "match_all": true 24 | }, 25 | { 26 | "key": "preceding_text", 27 | "operator": "regex_contains", 28 | "operand": "#$", 29 | "match_all": true 30 | }, 31 | { 32 | "key": "selector", 33 | "operand": "(string.quoted.double.elixir | string.interpolated.elixir) - string source", 34 | "operator": "equal", 35 | "match_all": true 36 | } 37 | ] 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /Elixir - elixir $file.sublime-build: -------------------------------------------------------------------------------- 1 | { 2 | "cmd": ["elixir", "$file"], 3 | "selector": "source.elixir", 4 | "windows": { 5 | "working_dir": "$file_path", 6 | "cmd": ["elixir.bat", "$file_name"] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Elixir - mix test $file.sublime-build: -------------------------------------------------------------------------------- 1 | { 2 | "shell_cmd": "cd \"$folder\" && mix test $file", 3 | "working_dir": "${project_path}", 4 | "selector": "source.elixir" 5 | } 6 | -------------------------------------------------------------------------------- /Elixir - mix test.sublime-build: -------------------------------------------------------------------------------- 1 | { 2 | "shell_cmd": "cd \"$folder\" && mix test", 3 | "working_dir": "${project_path}", 4 | "selector": "source.elixir" 5 | } 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Plataformatec. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /Macros/Overwrite } in #{ .. }.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | command 9 | moveRight: 10 | 11 | 12 | hideFromUser 13 | 14 | keyEquivalent 15 | } 16 | name 17 | Overwrite '}' in #{ .. } 18 | scope 19 | source.elixir string meta.embedded.line.elixir punctuation.section.embedded.end 20 | uuid 21 | 483CCCEC-3489-4599-A401-4771FF8E7321 22 | 23 | 24 | -------------------------------------------------------------------------------- /Menus/Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "preferences", 4 | "children": 5 | [{ 6 | "id": "package-settings", 7 | "children": 8 | [ 9 | { 10 | "caption": "Elixir", 11 | "children": 12 | [ 13 | { 14 | "caption": "Settings", 15 | "command": "edit_settings", 16 | "args": { 17 | "base_file": "${packages}/Elixir/Settings/Elixir.sublime-settings", 18 | "default": "// Settings in here override those in \"Elixir/Settings/Elixir.sublime-settings\",\n\n{\n\t$0\n}\n" 19 | } 20 | } 21 | ] 22 | } 23 | ] 24 | }] 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /Preferences/Comments.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments 7 | scope 8 | source.elixir 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | # 18 | 19 | 20 | 21 | uuid 22 | BC7C8178-FD4F-4F5F-9F5A-07FDC25FE899 23 | 24 | 25 | -------------------------------------------------------------------------------- /Preferences/EExComments.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments (EEx) 7 | scope 8 | text.elixir,text.html.elixir 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | <%# 18 | 19 | 20 | name 21 | TM_COMMENT_END 22 | value 23 | %> 24 | 25 | 26 | 27 | uuid 28 | 69f84a99-1023-4731-a543-460dd057d749 29 | 30 | 31 | -------------------------------------------------------------------------------- /Preferences/Indent.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Indent 7 | scope 8 | source.elixir 9 | settings 10 | 11 | decreaseIndentPattern 12 | ^\s*((\}|\])\s*$|(after|else|catch|rescue|end)\b) 13 | increaseIndentPattern 14 | ^\s*(after|else|catch|rescue|^.*(do|<\-|\->|\{|\[))\s*$ 15 | 16 | uuid 17 | 313112A0-FC40-4025-97AE-3E85DC0DB08F 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Symbol List - Module.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: Module 7 | scope 8 | source.elixir meta.module.elixir 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | showInIndexedSymbolList 14 | 1 15 | symbolTransformation 16 | 17 | s/defmodule\s+//; 18 | s/do//; 19 | s/\s//g; 20 | 21 | symbolIndexTransformation 22 | 23 | s/(defmodule|do)//g; 24 | 25 | 26 | uuid 27 | 7FF38726-C866-419E-A79C-1323948E6800 28 | 29 | 30 | -------------------------------------------------------------------------------- /Preferences/Symbol List - Private Function.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: Private Function 7 | scope 8 | source.elixir entity.name.function.private 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | showInIndexedSymbolList 14 | 1 15 | symbolTransformation 16 | s/(.*)/ $1 (private)/ 17 | 18 | uuid 19 | 1B80EE06-9121-4D37-8413-554C33E3FA29 20 | 21 | 22 | -------------------------------------------------------------------------------- /Preferences/Symbol List - Protocol Definition.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: Protocol declaration 7 | scope 8 | source.elixir meta.protocol_declaration.elixir 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | showInIndexedSymbolList 14 | 1 15 | symbolIndexTransformation 16 | 17 | s/(defprotocol|do)//g; 18 | s/(.+)\s+/$1 \(declaration\)/ 19 | 20 | 21 | uuid 22 | FAB806EF-5B7B-4886-B966-A503A2063122 23 | 24 | 25 | -------------------------------------------------------------------------------- /Preferences/Symbol List - Protocol Implementation.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: Protocol implementation 7 | scope 8 | source.elixir meta.protocol_implementation.elixir 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | showInIndexedSymbolList 14 | 1 15 | symbolIndexTransformation 16 | 17 | s/(defimpl|do)//g; 18 | s/(.+), for: (.+)\s+/$1 \(implementation for $2\)/ 19 | 20 | 21 | uuid 22 | 9A0F9FEB-96FF-4967-B654-053F87E10C95 23 | 24 | 25 | -------------------------------------------------------------------------------- /Preferences/Symbol List - Public Function.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: Public Function 7 | scope 8 | source.elixir entity.name.function.public 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | symbolTransformation 14 | s// / 15 | 16 | uuid 17 | 8FDBB14D-D541-4C4C-BADB-02A518F04826 18 | 19 | 20 | -------------------------------------------------------------------------------- /Preferences/Typing Pairs.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Typing Pairs 7 | scope 8 | source.elixir 9 | settings 10 | 11 | smartTypingPairs 12 | 13 | 14 | " 15 | " 16 | 17 | 18 | ( 19 | ) 20 | 21 | 22 | { 23 | } 24 | 25 | 26 | [ 27 | ] 28 | 29 | 30 | << 31 | >> 32 | 33 | 34 | 35 | uuid 36 | 78D9FEF5-7439-4DAE-AEAC-E99E476CA7DF 37 | 38 | 39 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # Elixir.tmbundle 2 | 3 | A **TextMate / Sublime Text Bundle** for the [**Elixir**](http://github.com/elixir-lang/elixir) programming language. 4 | 5 | It provides syntax highlighting, snippets, and keybindings. Contributions and extensions are welcome! 6 | 7 | > **Note:** For a package that provides tighter and more up-to-date integration with Sublime Text 4, see [ElixirSyntax](https://packagecontrol.io/packages/ElixirSyntax). 8 | 9 | ## Installation 10 | 11 | If you are using **TextMate 2** you can install from Preferences → Bundles. To install manually type the following commands in your shell: 12 | 13 | mkdir -p ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles 14 | cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles 15 | git clone git://github.com/elixir-lang/elixir-tmbundle Elixir.tmbundle 16 | 17 | If you are using **Sublime Text 3**, type the following commands in your shell: 18 | 19 | cd ~/.config/sublime-text-3/Packages # If you are on Linux 20 | cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages # If you are on OS X 21 | cd %HOMEPATH%\AppData\Roaming\Sublime^ Text^ 3\Packages # If you are on Windows Vista or above 22 | cd %HOMEPATH%\Application^ Data\Sublime^ Text^ 3\Packages # If you are on Windows XP 23 | git clone git://github.com/elixir-lang/elixir-tmbundle Elixir 24 | 25 | You can now use Elixir's color syntax in files. In some cases, you should restart Sublime Text to make changes work. 26 | 27 | ## Installation for outdated editors 28 | 29 | Type the following commands to setup the bundle for **TextMate 1**: 30 | 31 | mkdir -p ~/Library/Application\ Support/TextMate/Bundles 32 | cd !$ 33 | git clone git://github.com/elixir-lang/elixir-tmbundle Elixir.tmbundle 34 | cd Elixir.tmbundle 35 | git checkout tm1 36 | osascript -e 'tell app "TextMate" to reload bundles' 37 | 38 | If you are using **Sublime Text 2**, type the following commands in your shell: 39 | 40 | cd ~/.config/sublime-text-2/Packages # If you are on Linux 41 | cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages # If you are on OS X 42 | cd %HOMEPATH%\AppData\Roaming\Sublime^ Text^ 2\Packages # If you are on Windows Vista or above 43 | cd %HOMEPATH%\Application^ Data\Sublime^ Text^ 2\Packages # If you are on Windows XP 44 | git clone git://github.com/elixir-lang/elixir-tmbundle Elixir 45 | cd Elixir 46 | git checkout tm1 47 | 48 | ## Code formatting for Sublime Text 3 49 | 50 | Elixir v1.6 includes a code formatter. This package includes `super+shift+c` as a keybinding to automatically save and format the current file you are working on. If the file has invalid syntax, an alert will appear. 51 | 52 | You can also add your own keybindings as follows: 53 | 54 | { "keys": ["super+e"], "command": "mix_format_file" } 55 | 56 | You can also set up the package to automatically format the file on save. To do this, 57 | go to Preferences -> Package Settings -> Elixir -> Settings and add 58 | `"mix_format_on_save": true`. 59 | 60 | -------------------------------------------------------------------------------- /Settings/Elixir.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "mix_format_command": "mix format", 3 | "make_path_relative": false, 4 | "mix_format_on_save": false, 5 | "reload_after_mix_format": false, 6 | "use_root_dir": false 7 | } 8 | -------------------------------------------------------------------------------- /Snippets/Embedded String.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | #{${1:$TM_SELECTED_TEXT}} 7 | hideFromUser 8 | 9 | keyEquivalent 10 | # 11 | name 12 | Embedded Code — #{…} 13 | scope 14 | source.elixir & B:(string.quoted.single.heredoc.elixir|string.quoted.single.elixir|string.quoted.double.heredoc.elixir|string.quoted.double.elixir|string.quoted.other.sigil.heredoc.elixir|string.quoted.other.sigil.elixir) - string source 15 | uuid 16 | B998866C-7FFE-4826-A924-72F0C3942F4A 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Insert Tag.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <% ${0:$TM_SELECTED_TEXT} %> 7 | keyEquivalent 8 | ^> 9 | name 10 | Insert EEx Tag 11 | scope 12 | text.elixir,text.html.elixir 13 | tabTrigger 14 | ee 15 | uuid 16 | ED063C3E-E58C-4877-868F-2717EE7512CB 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/case.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | case $1 do 7 | $2 -> 8 | $0 9 | end 10 | name 11 | case 12 | scope 13 | source.elixir 14 | tabTrigger 15 | case 16 | uuid 17 | 23A6FE3D-FF3C-40ED-ABA0-716C30F65631 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/cond.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | cond do 7 | $1 -> 8 | $0 9 | end 10 | name 11 | cond 12 | scope 13 | source.elixir 14 | tabTrigger 15 | cond 16 | uuid 17 | 8A6D2B29-7780-42B2-BC12-F53BBD4725DD 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/def.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | def $1 do 7 | $0 8 | end 9 | name 10 | def 11 | scope 12 | source.elixir 13 | tabTrigger 14 | def 15 | uuid 16 | B84C6EFA-2343-473E-84EC-78F8FBA7F54F 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/def_one_line.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | def $1, do: $0 7 | name 8 | def (one line) 9 | scope 10 | source.elixir 11 | tabTrigger 12 | df 13 | uuid 14 | 70D885A3-B612-4B5D-842E-D94474C8C8CA 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/defcallback.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defcallback $1 :: $0 7 | name 8 | defcallback 9 | scope 10 | source.elixir 11 | tabTrigger 12 | defc 13 | uuid 14 | EB8EAB9A-F9A8-495F-A59F-44A95A127666 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/defdelegate.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defdelegate $1 to: $0 7 | name 8 | defdelegate 9 | scope 10 | source.elixir 11 | tabTrigger 12 | defd 13 | uuid 14 | C716B59F-52CC-4FF5-A7A6-3B641BFA8BAE 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/defexception.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defexception [${1::message}] 7 | name 8 | defexception 9 | scope 10 | source.elixir 11 | tabTrigger 12 | defe 13 | uuid 14 | AE70A3F4-DFE8-46E9-8156-BF70A5AD382D 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/defimpl.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defimpl $1, for: $2 do 7 | $0 8 | end 9 | name 10 | defimpl 11 | scope 12 | source.elixir 13 | tabTrigger 14 | defi 15 | uuid 16 | 0F19FC07-C543-4E3E-BA08-6C7860E13686 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/defmacro.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defmacro $1 do 7 | $0 8 | end 9 | name 10 | defmacro 11 | scope 12 | source.elixir 13 | tabTrigger 14 | defm 15 | uuid 16 | BA860DCC-170C-44FE-8E9A-D05034152952 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/defmacrocallback.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defmacrocallback $1 :: $0 7 | name 8 | defmacrocallback 9 | scope 10 | source.elixir 11 | tabTrigger 12 | defmc 13 | uuid 14 | E7B7CFAE-188B-4B7F-B556-BE58D5C54215 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/defmacrop.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defmacrop $1 do 7 | $0 8 | end 9 | name 10 | defmacrop 11 | scope 12 | source.elixir 13 | tabTrigger 14 | defmp 15 | uuid 16 | 6402A657-B3B1-4DB4-9C9B-708716AD0DC4 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/defmodule.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defmodule ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.[a-z]+)*/(?2::\u$1)/g}} do 7 | $0 8 | end 9 | name 10 | defmodule 11 | scope 12 | source.elixir 13 | tabTrigger 14 | defmod 15 | uuid 16 | 1BAFD05F-558D-4B18-95BF-7399E84A8E39 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/defp.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defp $1 do 7 | $0 8 | end 9 | name 10 | defp 11 | scope 12 | source.elixir 13 | tabTrigger 14 | defp 15 | uuid 16 | 22297559-5C12-4EDC-913B-423C1E1740D8 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/defprotocol.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defprotocol $1 do 7 | $0 8 | end 9 | name 10 | defprotocol 11 | scope 12 | source.elixir 13 | tabTrigger 14 | defpro 15 | uuid 16 | 61BFD2AA-EDBB-44D5-B09B-C66C506D3EE0 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/defstruct.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | defstruct $1: $2 7 | name 8 | defstruct 9 | scope 10 | source.elixir 11 | tabTrigger 12 | defs 13 | uuid 14 | 4B3DD799-8C49-48C3-B392-38DA059BBC83 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/describe.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | describe "$1" do 7 | $0 8 | end 9 | name 10 | describe 11 | scope 12 | source.elixir 13 | tabTrigger 14 | describe 15 | uuid 16 | DC883D65-C4F6-484C-A7A7-4C08BA9DC0AB 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/do.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | do 7 | $0 8 | end 9 | name 10 | do 11 | scope 12 | source.elixir 13 | tabTrigger 14 | do 15 | uuid 16 | 87F5A82D-F956-4708-9E4B-098B66E57DA2 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/doc.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | @doc """ 7 | $0 8 | """ 9 | name 10 | doc 11 | scope 12 | source.elixir 13 | tabTrigger 14 | doc 15 | uuid 16 | 79481DC6-D14E-4FFD-B4AC-1680139047B3 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/fn.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | fn ${1:args}${1/(.+)/(?1: )/}-> $2 end$0 7 | name 8 | fn 9 | scope 10 | source.elixir 11 | tabTrigger 12 | fn 13 | uuid 14 | 1BDECB09-0FBE-4DE0-B154-B87A0A7BC31F 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/for.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | for ${1:item} <- ${2:items} do 7 | $0 8 | end 9 | name 10 | for 11 | scope 12 | source.elixir 13 | tabTrigger 14 | for 15 | uuid 16 | 7FBF1166-6B5B-4B98-AAAD-023FA3D97D11 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/if.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | if $1 do 7 | $0 8 | end 9 | name 10 | if 11 | scope 12 | source.elixir 13 | tabTrigger 14 | if 15 | uuid 16 | 24304A3D-9877-488F-B030-6FD021E80462 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/if_else.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | if $1 do 7 | $2 8 | else 9 | $0 10 | end 11 | name 12 | if else 13 | scope 14 | source.elixir 15 | tabTrigger 16 | ife 17 | uuid 18 | 9577138E-4F81-459D-BB53-55EAA733814A 19 | 20 | 21 | -------------------------------------------------------------------------------- /Snippets/if_else_one_line.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | if $1, do: $2, else: $0 7 | name 8 | if else (one line) 9 | scope 10 | source.elixir 11 | tabTrigger 12 | ife: 13 | uuid 14 | 23403EDF-D1B5-444D-B53B-6F4BD6575D13 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/if_one_line.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | if $1, do: $0 7 | name 8 | if (one line) 9 | scope 10 | source.elixir 11 | tabTrigger 12 | if: 13 | uuid 14 | 107D111F-5B1A-4C1F-9797-C78327994A33 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/import.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | import $0 7 | name 8 | import 9 | scope 10 | source.elixir 11 | tabTrigger 12 | imp 13 | uuid 14 | C950FE7C-5277-4954-9D96-A7ACDECE9BC1 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/inspect.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | inspect($0) 7 | name 8 | inspect 9 | scope 10 | source.elixir 11 | tabTrigger 12 | i 13 | uuid 14 | 93A56CC9-F0E0-40ED-8029-D435D2261EC6 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/io_inspect.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | IO.inspect($0) 7 | name 8 | IO.inspect 9 | scope 10 | source.elixir 11 | tabTrigger 12 | ii 13 | uuid 14 | 93B56CC9-F0E0-40ED-8029-D435D2261EC6 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/key_arrow_value.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${1:key} => ${2:value}$0 7 | name 8 | key => value 9 | scope 10 | source.elixir 11 | tabTrigger 12 | :: 13 | uuid 14 | AB492DEE-2168-40EE-B2F9-B293C18C6250 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/map_struct.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | %${1:Struct}{$2}$0 7 | name 8 | map/struct 9 | scope 10 | source.elixir 11 | tabTrigger 12 | % 13 | uuid 14 | 9A27D450-377A-498B-8A76-CF6F757EA82C 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/moduledoc.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | @moduledoc """ 7 | $0 8 | """ 9 | name 10 | moduledoc 11 | scope 12 | source.elixir 13 | tabTrigger 14 | mdoc 15 | uuid 16 | F0413B1A-CDD9-4425-BA63-09BE5CF37CBC 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/pry.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | require IEx; IEx.pry() 7 | name 8 | pry 9 | scope 10 | source.elixir 11 | tabTrigger 12 | pry 13 | uuid 14 | 0834347B-D4FA-448C-990E-61DD94897BA3 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/receive.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | receive do 7 | ${1:{${2::${3:message_type}}, ${4:value}\}} -> 8 | ${0:# code} 9 | end 10 | name 11 | receive 12 | scope 13 | source.elixir 14 | tabTrigger 15 | rec 16 | uuid 17 | 0E030583-E0AC-4E7A-B795-0AB594BB66AA 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snippets/require.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | require $0 7 | name 8 | require 9 | scope 10 | source.elixir 11 | tabTrigger 12 | req 13 | uuid 14 | A43F022B-1B16-49D8-89A8-1A2DA9F7D0DB 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/setup.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | setup do 7 | $0 8 | 9 | :ok 10 | end 11 | name 12 | setup 13 | scope 14 | source.elixir 15 | tabTrigger 16 | setup 17 | uuid 18 | E4770543-5096-462E-88BF-4F4A0F24EF13 19 | 20 | 21 | -------------------------------------------------------------------------------- /Snippets/test.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | test "$1" do 7 | $0 8 | end 9 | name 10 | test 11 | scope 12 | source.elixir 13 | tabTrigger 14 | test 15 | uuid 16 | AC5F6B5B-8672-46B6-A3DE-C1898F86D404 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/unless.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | unless $1 do 7 | $0 8 | end 9 | name 10 | unless 11 | scope 12 | source.elixir 13 | tabTrigger 14 | unless 15 | uuid 16 | 0AE60466-9C59-4FCD-97B3-3BB40A61BFC4 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/unless_else.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | unless $1 do 7 | $2 8 | else 9 | $0 10 | end 11 | name 12 | unless else 13 | scope 14 | source.elixir 15 | tabTrigger 16 | unlesse 17 | uuid 18 | 79F7CEF9-C157-4366-AF02-4818F7DA817C 19 | 20 | 21 | -------------------------------------------------------------------------------- /Snippets/unless_else_one_line.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | unless $1, do: $2, else: $0 7 | name 8 | unless else (one line) 9 | scope 10 | source.elixir 11 | tabTrigger 12 | unlesse: 13 | uuid 14 | A7A6CCF0-E8E8-4CB5-B379-93B24736FE02 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/unless_one_line.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | unless $1, do: $0 7 | name 8 | unless (one line) 9 | scope 10 | source.elixir 11 | tabTrigger 12 | unless: 13 | uuid 14 | 8478937E-E333-4CA3-8F17-52A781A89263 15 | 16 | 17 | -------------------------------------------------------------------------------- /Syntaxes/EEx.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | eex 8 | 9 | keyEquivalent 10 | ^~X 11 | name 12 | EEx 13 | patterns 14 | 15 | 16 | begin 17 | <%+# 18 | captures 19 | 20 | 0 21 | 22 | name 23 | punctuation.definition.comment.eex 24 | 25 | 26 | end 27 | %> 28 | name 29 | comment.block.elixir 30 | 31 | 32 | begin 33 | <%+(?!>)[-=]* 34 | beginCaptures 35 | 36 | 0 37 | 38 | name 39 | punctuation.section.embedded.begin.elixir 40 | 41 | 42 | contentName 43 | source.elixir 44 | end 45 | (-)%>|(%)> 46 | endCaptures 47 | 48 | 0 49 | 50 | name 51 | punctuation.section.embedded.end.elixir 52 | 53 | 1 54 | 55 | name 56 | source.elixir 57 | 58 | 2 59 | 60 | name 61 | source.elixir 62 | 63 | 64 | name 65 | meta.embedded.line.elixir 66 | patterns 67 | 68 | 69 | captures 70 | 71 | 1 72 | 73 | name 74 | punctuation.definition.comment.elixir 75 | 76 | 77 | match 78 | (#).*?(?=-?%>) 79 | name 80 | comment.line.number-sign.elixir 81 | 82 | 83 | include 84 | source.elixir 85 | 86 | 87 | 88 | 89 | scopeName 90 | text.elixir 91 | uuid 92 | B1393067-A26A-4BAD-9D0F-42DF21FEB1C2 93 | 94 | 95 | -------------------------------------------------------------------------------- /Syntaxes/Elixir.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | comment 6 | Textmate bundle for Elixir Programming Language. 7 | fileTypes 8 | 9 | ex 10 | exs 11 | 12 | firstLineMatch 13 | ^#!/.*\belixir 14 | foldingStartMarker 15 | (after|else|catch|rescue|\-\>|\{|\[|do)\s*$ 16 | foldingStopMarker 17 | ^\s*((\}|\]|after|else|catch|rescue)\s*$|end\b) 18 | keyEquivalent 19 | ^~E 20 | name 21 | Elixir 22 | patterns 23 | 24 | 25 | begin 26 | \b(fn)\b(?!.*->) 27 | beginCaptures 28 | 29 | 1 30 | 31 | name 32 | keyword.control.elixir 33 | 34 | 35 | end 36 | $ 37 | patterns 38 | 39 | 40 | include 41 | #core_syntax 42 | 43 | 44 | 45 | 46 | captures 47 | 48 | 1 49 | 50 | name 51 | entity.name.type.class.elixir 52 | 53 | 2 54 | 55 | name 56 | punctuation.separator.method.elixir 57 | 58 | 3 59 | 60 | name 61 | entity.name.function.elixir 62 | 63 | 64 | match 65 | ([A-Z]\w+)\s*(\.)\s*([a-z_]\w*[!?]?) 66 | 67 | 68 | captures 69 | 70 | 1 71 | 72 | name 73 | constant.other.symbol.elixir 74 | 75 | 2 76 | 77 | name 78 | punctuation.separator.method.elixir 79 | 80 | 3 81 | 82 | name 83 | entity.name.function.elixir 84 | 85 | 86 | match 87 | (\:\w+)\s*(\.)\s*([_]?\w*[!?]?) 88 | 89 | 90 | captures 91 | 92 | 1 93 | 94 | name 95 | keyword.operator.other.elixir 96 | 97 | 2 98 | 99 | name 100 | entity.name.function.elixir 101 | 102 | 103 | match 104 | (\|\>)\s*([a-z_]\w*[!?]?) 105 | 106 | 107 | match 108 | \b[a-z_]\w*[!?]?(?=\s*\.?\s*\() 109 | name 110 | entity.name.function.elixir 111 | 112 | 113 | begin 114 | \b(fn)\b(?=.*->) 115 | beginCaptures 116 | 117 | 1 118 | 119 | name 120 | keyword.control.elixir 121 | 122 | 123 | end 124 | (?>(->)|(when)|(\))) 125 | endCaptures 126 | 127 | 1 128 | 129 | name 130 | keyword.operator.other.elixir 131 | 132 | 2 133 | 134 | name 135 | keyword.control.elixir 136 | 137 | 3 138 | 139 | name 140 | punctuation.section.function.elixir 141 | 142 | 143 | patterns 144 | 145 | 146 | include 147 | #core_syntax 148 | 149 | 150 | 151 | 152 | include 153 | #core_syntax 154 | 155 | 156 | begin 157 | ^(?=.*->)((?![^"']*("|')[^"']*->)|(?=.*->[^"']*("|')[^"']*->))((?!.*\([^\)]*->)|(?=[^\(\)]*->)|(?=\s*\(.*\).*->))((?!.*\b(fn)\b)|(?=.*->.*\bfn\b)) 158 | beginCaptures 159 | 160 | 1 161 | 162 | name 163 | keyword.control.elixir 164 | 165 | 166 | end 167 | (?>(->)|(when)|(\))) 168 | endCaptures 169 | 170 | 1 171 | 172 | name 173 | keyword.operator.other.elixir 174 | 175 | 2 176 | 177 | name 178 | keyword.control.elixir 179 | 180 | 3 181 | 182 | name 183 | punctuation.section.function.elixir 184 | 185 | 186 | patterns 187 | 188 | 189 | include 190 | #core_syntax 191 | 192 | 193 | 194 | 195 | repository 196 | 197 | core_syntax 198 | 199 | patterns 200 | 201 | 202 | begin 203 | ^\s*(defmodule)\b 204 | beginCaptures 205 | 206 | 1 207 | 208 | name 209 | keyword.control.module.elixir 210 | 211 | 212 | end 213 | \b(do)\b 214 | endCaptures 215 | 216 | 1 217 | 218 | name 219 | keyword.control.module.elixir 220 | 221 | 222 | name 223 | meta.module.elixir 224 | patterns 225 | 226 | 227 | match 228 | \b[A-Z]\w*(?=\.) 229 | name 230 | entity.other.inherited-class.elixir 231 | 232 | 233 | match 234 | \b[A-Z]\w*\b 235 | name 236 | entity.name.type.class.elixir 237 | 238 | 239 | 240 | 241 | begin 242 | ^\s*(defprotocol)\b 243 | beginCaptures 244 | 245 | 1 246 | 247 | name 248 | keyword.control.protocol.elixir 249 | 250 | 251 | end 252 | \b(do)\b 253 | endCaptures 254 | 255 | 1 256 | 257 | name 258 | keyword.control.protocol.elixir 259 | 260 | 261 | name 262 | meta.protocol_declaration.elixir 263 | patterns 264 | 265 | 266 | match 267 | \b[A-Z]\w*\b 268 | name 269 | entity.name.type.protocol.elixir 270 | 271 | 272 | 273 | 274 | begin 275 | ^\s*(defimpl)\b 276 | beginCaptures 277 | 278 | 1 279 | 280 | name 281 | keyword.control.protocol.elixir 282 | 283 | 284 | end 285 | \b(do)\b 286 | endCaptures 287 | 288 | 1 289 | 290 | name 291 | keyword.control.protocol.elixir 292 | 293 | 294 | name 295 | meta.protocol_implementation.elixir 296 | patterns 297 | 298 | 299 | match 300 | \b[A-Z]\w*\b 301 | name 302 | entity.name.type.protocol.elixir 303 | 304 | 305 | 306 | 307 | begin 308 | ^\s*(def|defmacro|defdelegate|defguard)\s+((?>[a-zA-Z_]\w*(?>\.|::))?(?>[a-zA-Z_]\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?))((\()|\s*) 309 | beginCaptures 310 | 311 | 1 312 | 313 | name 314 | keyword.control.module.elixir 315 | 316 | 2 317 | 318 | name 319 | entity.name.function.public.elixir 320 | 321 | 4 322 | 323 | name 324 | punctuation.section.function.elixir 325 | 326 | 327 | end 328 | (\bdo:)|(\bdo\b)|(?=\s+(def|defn|defmacro|defdelegate|defguard)\b) 329 | endCaptures 330 | 331 | 1 332 | 333 | name 334 | constant.other.keywords.elixir 335 | 336 | 2 337 | 338 | name 339 | keyword.control.module.elixir 340 | 341 | 342 | name 343 | meta.function.public.elixir 344 | patterns 345 | 346 | 347 | include 348 | $self 349 | 350 | 351 | begin 352 | \s(\\\\) 353 | beginCaptures 354 | 355 | 1 356 | 357 | name 358 | keyword.operator.other.elixir 359 | 360 | 361 | end 362 | ,|\)|$ 363 | patterns 364 | 365 | 366 | include 367 | $self 368 | 369 | 370 | 371 | 372 | match 373 | \b(is_atom|is_binary|is_bitstring|is_boolean|is_float|is_function|is_integer|is_list|is_map|is_nil|is_number|is_pid|is_port|is_record|is_reference|is_tuple|is_exception|abs|bit_size|byte_size|div|elem|hd|length|map_size|node|rem|round|tl|trunc|tuple_size)\b 374 | name 375 | keyword.control.elixir 376 | 377 | 378 | 379 | 380 | begin 381 | ^\s*(defp|defnp|defmacrop|defguardp)\s+((?>[a-zA-Z_]\w*(?>\.|::))?(?>[a-zA-Z_]\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?))((\()|\s*) 382 | beginCaptures 383 | 384 | 1 385 | 386 | name 387 | keyword.control.module.elixir 388 | 389 | 2 390 | 391 | name 392 | entity.name.function.private.elixir 393 | 394 | 4 395 | 396 | name 397 | punctuation.section.function.elixir 398 | 399 | 400 | end 401 | (\bdo:)|(\bdo\b)|(?=\s+(defp|defmacrop|defguardp)\b) 402 | endCaptures 403 | 404 | 1 405 | 406 | name 407 | constant.other.keywords.elixir 408 | 409 | 2 410 | 411 | name 412 | keyword.control.module.elixir 413 | 414 | 415 | name 416 | meta.function.private.elixir 417 | patterns 418 | 419 | 420 | include 421 | $self 422 | 423 | 424 | begin 425 | \s(\\\\) 426 | beginCaptures 427 | 428 | 1 429 | 430 | name 431 | keyword.operator.other.elixir 432 | 433 | 434 | end 435 | ,|\)|$ 436 | patterns 437 | 438 | 439 | include 440 | $self 441 | 442 | 443 | 444 | 445 | match 446 | \b(is_atom|is_binary|is_bitstring|is_boolean|is_float|is_function|is_integer|is_list|is_map|is_nil|is_number|is_pid|is_port|is_record|is_reference|is_tuple|is_exception|abs|bit_size|byte_size|div|elem|hd|length|map_size|node|rem|round|tl|trunc|tuple_size)\b 447 | name 448 | keyword.control.elixir 449 | 450 | 451 | 452 | 453 | begin 454 | \s*~L""" 455 | comment 456 | Leex Sigil 457 | end 458 | \s*""" 459 | name 460 | sigil.leex 461 | patterns 462 | 463 | 464 | include 465 | text.elixir 466 | 467 | 468 | include 469 | text.html.basic 470 | 471 | 472 | 473 | 474 | begin 475 | \s*~H""" 476 | comment 477 | HEEx Sigil 478 | end 479 | \s*""" 480 | name 481 | sigil.heex 482 | patterns 483 | 484 | 485 | include 486 | text.elixir 487 | 488 | 489 | include 490 | text.html.basic 491 | 492 | 493 | 494 | 495 | begin 496 | @(module|type)?doc (~[a-z])?""" 497 | comment 498 | @doc with heredocs is treated as documentation 499 | end 500 | \s*""" 501 | name 502 | comment.block.documentation.heredoc 503 | patterns 504 | 505 | 506 | include 507 | #interpolated_elixir 508 | 509 | 510 | include 511 | #escaped_char 512 | 513 | 514 | 515 | 516 | begin 517 | @(module|type)?doc ~[A-Z]""" 518 | comment 519 | @doc with heredocs is treated as documentation 520 | end 521 | \s*""" 522 | name 523 | comment.block.documentation.heredoc 524 | 525 | 526 | begin 527 | @(module|type)?doc (~[a-z])?''' 528 | comment 529 | @doc with heredocs is treated as documentation 530 | end 531 | \s*''' 532 | name 533 | comment.block.documentation.heredoc 534 | patterns 535 | 536 | 537 | include 538 | #interpolated_elixir 539 | 540 | 541 | include 542 | #escaped_char 543 | 544 | 545 | 546 | 547 | begin 548 | @(module|type)?doc ~[A-Z]''' 549 | comment 550 | @doc with heredocs is treated as documentation 551 | end 552 | \s*''' 553 | name 554 | comment.block.documentation.heredoc 555 | 556 | 557 | comment 558 | @doc false is treated as documentation 559 | match 560 | @(module|type)?doc false 561 | name 562 | comment.block.documentation.false 563 | 564 | 565 | begin 566 | @(module|type)?doc " 567 | comment 568 | @doc with string is treated as documentation 569 | end 570 | " 571 | name 572 | comment.block.documentation.string 573 | patterns 574 | 575 | 576 | include 577 | #interpolated_elixir 578 | 579 | 580 | include 581 | #escaped_char 582 | 583 | 584 | 585 | 586 | match 587 | (?<!\.)\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defnp?|defmacrop?|defguardp?|defdelegate|defexception|defoverridable|exit|after|rescue|catch|else|raise|reraise|throw|import|require|alias|use|quote|unquote|super|with)\b(?![?!:]) 588 | name 589 | keyword.control.elixir 590 | 591 | 592 | comment 593 | as above, just doesn't need a 'end' and does a logic operation 594 | match 595 | (?<!\.)\b(and|not|or|when|xor|in)\b 596 | name 597 | keyword.operator.elixir 598 | 599 | 600 | match 601 | \b[A-Z]\w*\b 602 | name 603 | entity.name.type.class.elixir 604 | 605 | 606 | match 607 | \b(nil|true|false)\b(?![?!]) 608 | name 609 | constant.language.elixir 610 | 611 | 612 | match 613 | \b(__(CALLER|ENV|MODULE|DIR|STACKTRACE)__)\b(?![?!]) 614 | name 615 | variable.language.elixir 616 | 617 | 618 | captures 619 | 620 | 1 621 | 622 | name 623 | punctuation.definition.variable.elixir 624 | 625 | 626 | match 627 | (@)[a-zA-Z_]\w* 628 | name 629 | variable.other.readwrite.module.elixir 630 | 631 | 632 | captures 633 | 634 | 1 635 | 636 | name 637 | punctuation.definition.variable.elixir 638 | 639 | 640 | match 641 | (&)\d+ 642 | name 643 | variable.other.anonymous.elixir 644 | 645 | 646 | match 647 | &(?![&]) 648 | name 649 | variable.other.anonymous.elixir 650 | 651 | 652 | captures 653 | 654 | 1 655 | 656 | name 657 | punctuation.definition.variable.elixir 658 | 659 | 660 | match 661 | \^[a-z_]\w* 662 | name 663 | variable.other.capture.elixir 664 | 665 | 666 | match 667 | \b0x[0-9A-Fa-f](?>_?[0-9A-Fa-f])*\b 668 | name 669 | constant.numeric.hex.elixir 670 | 671 | 672 | match 673 | \b\d(?>_?\d)*(\.(?![^[:space:][:digit:]])(?>_?\d)+)([eE][-+]?\d(?>_?\d)*)?\b 674 | name 675 | constant.numeric.float.elixir 676 | 677 | 678 | match 679 | \b\d(?>_?\d)*\b 680 | name 681 | constant.numeric.integer.elixir 682 | 683 | 684 | match 685 | \b0b[01](?>_?[01])*\b 686 | name 687 | constant.numeric.binary.elixir 688 | 689 | 690 | match 691 | \b0o[0-7](?>_?[0-7])*\b 692 | name 693 | constant.numeric.octal.elixir 694 | 695 | 696 | begin 697 | :' 698 | captures 699 | 700 | 0 701 | 702 | name 703 | punctuation.definition.constant.elixir 704 | 705 | 706 | end 707 | ' 708 | name 709 | constant.other.symbol.single-quoted.elixir 710 | patterns 711 | 712 | 713 | include 714 | #interpolated_elixir 715 | 716 | 717 | include 718 | #escaped_char 719 | 720 | 721 | 722 | 723 | begin 724 | :" 725 | captures 726 | 727 | 0 728 | 729 | name 730 | punctuation.definition.constant.elixir 731 | 732 | 733 | end 734 | " 735 | name 736 | constant.other.symbol.double-quoted.elixir 737 | patterns 738 | 739 | 740 | include 741 | #interpolated_elixir 742 | 743 | 744 | include 745 | #escaped_char 746 | 747 | 748 | 749 | 750 | begin 751 | (?>''') 752 | beginCaptures 753 | 754 | 0 755 | 756 | name 757 | punctuation.definition.string.begin.elixir 758 | 759 | 760 | comment 761 | Single-quoted heredocs 762 | end 763 | ^\s*''' 764 | endCaptures 765 | 766 | 0 767 | 768 | name 769 | punctuation.definition.string.end.elixir 770 | 771 | 772 | name 773 | string.quoted.single.heredoc.elixir 774 | patterns 775 | 776 | 777 | include 778 | #interpolated_elixir 779 | 780 | 781 | include 782 | #escaped_char 783 | 784 | 785 | 786 | 787 | begin 788 | ' 789 | beginCaptures 790 | 791 | 0 792 | 793 | name 794 | punctuation.definition.string.begin.elixir 795 | 796 | 797 | comment 798 | single quoted string (allows for interpolation) 799 | end 800 | ' 801 | endCaptures 802 | 803 | 0 804 | 805 | name 806 | punctuation.definition.string.end.elixir 807 | 808 | 809 | name 810 | string.quoted.single.elixir 811 | patterns 812 | 813 | 814 | include 815 | #interpolated_elixir 816 | 817 | 818 | include 819 | #escaped_char 820 | 821 | 822 | 823 | 824 | begin 825 | (?>""") 826 | beginCaptures 827 | 828 | 0 829 | 830 | name 831 | punctuation.definition.string.begin.elixir 832 | 833 | 834 | comment 835 | Double-quoted heredocs 836 | end 837 | ^\s*""" 838 | endCaptures 839 | 840 | 0 841 | 842 | name 843 | punctuation.definition.string.end.elixir 844 | 845 | 846 | name 847 | string.quoted.double.heredoc.elixir 848 | patterns 849 | 850 | 851 | include 852 | #interpolated_elixir 853 | 854 | 855 | include 856 | #escaped_char 857 | 858 | 859 | 860 | 861 | begin 862 | " 863 | beginCaptures 864 | 865 | 0 866 | 867 | name 868 | punctuation.definition.string.begin.elixir 869 | 870 | 871 | comment 872 | double quoted string (allows for interpolation) 873 | end 874 | " 875 | endCaptures 876 | 877 | 0 878 | 879 | name 880 | punctuation.definition.string.end.elixir 881 | 882 | 883 | name 884 | string.quoted.double.elixir 885 | patterns 886 | 887 | 888 | include 889 | #interpolated_elixir 890 | 891 | 892 | include 893 | #escaped_char 894 | 895 | 896 | 897 | 898 | begin 899 | ~[a-z](?>""") 900 | beginCaptures 901 | 902 | 0 903 | 904 | name 905 | punctuation.definition.string.begin.elixir 906 | 907 | 908 | comment 909 | Double-quoted heredocs sigils 910 | end 911 | ^\s*""" 912 | endCaptures 913 | 914 | 0 915 | 916 | name 917 | punctuation.definition.string.end.elixir 918 | 919 | 920 | name 921 | string.quoted.other.sigil.heredoc.elixir 922 | patterns 923 | 924 | 925 | include 926 | #interpolated_elixir 927 | 928 | 929 | include 930 | #escaped_char 931 | 932 | 933 | 934 | 935 | begin 936 | ~[a-z]\{ 937 | beginCaptures 938 | 939 | 0 940 | 941 | name 942 | punctuation.definition.string.begin.elixir 943 | 944 | 945 | comment 946 | sigil (allow for interpolation) 947 | end 948 | \}[a-z]* 949 | endCaptures 950 | 951 | 0 952 | 953 | name 954 | punctuation.definition.string.end.elixir 955 | 956 | 957 | name 958 | string.quoted.other.sigil.elixir 959 | patterns 960 | 961 | 962 | include 963 | #interpolated_elixir 964 | 965 | 966 | include 967 | #escaped_char 968 | 969 | 970 | 971 | 972 | begin 973 | ~[a-z]\[ 974 | beginCaptures 975 | 976 | 0 977 | 978 | name 979 | punctuation.definition.string.begin.elixir 980 | 981 | 982 | comment 983 | sigil (allow for interpolation) 984 | end 985 | \][a-z]* 986 | endCaptures 987 | 988 | 0 989 | 990 | name 991 | punctuation.definition.string.end.elixir 992 | 993 | 994 | name 995 | string.quoted.other.sigil.elixir 996 | patterns 997 | 998 | 999 | include 1000 | #interpolated_elixir 1001 | 1002 | 1003 | include 1004 | #escaped_char 1005 | 1006 | 1007 | 1008 | 1009 | begin 1010 | ~[a-z]\< 1011 | beginCaptures 1012 | 1013 | 0 1014 | 1015 | name 1016 | punctuation.definition.string.begin.elixir 1017 | 1018 | 1019 | comment 1020 | sigil (allow for interpolation) 1021 | end 1022 | \>[a-z]* 1023 | endCaptures 1024 | 1025 | 0 1026 | 1027 | name 1028 | punctuation.definition.string.end.elixir 1029 | 1030 | 1031 | name 1032 | string.quoted.other.sigil.elixir 1033 | patterns 1034 | 1035 | 1036 | include 1037 | #interpolated_elixir 1038 | 1039 | 1040 | include 1041 | #escaped_char 1042 | 1043 | 1044 | 1045 | 1046 | begin 1047 | ~[a-z]\( 1048 | beginCaptures 1049 | 1050 | 0 1051 | 1052 | name 1053 | punctuation.definition.string.begin.elixir 1054 | 1055 | 1056 | comment 1057 | sigil (allow for interpolation) 1058 | end 1059 | \)[a-z]* 1060 | endCaptures 1061 | 1062 | 0 1063 | 1064 | name 1065 | punctuation.definition.string.end.elixir 1066 | 1067 | 1068 | name 1069 | string.quoted.other.sigil.elixir 1070 | patterns 1071 | 1072 | 1073 | include 1074 | #interpolated_elixir 1075 | 1076 | 1077 | include 1078 | #escaped_char 1079 | 1080 | 1081 | 1082 | 1083 | begin 1084 | ~[a-z]([^\w]) 1085 | beginCaptures 1086 | 1087 | 0 1088 | 1089 | name 1090 | punctuation.definition.string.begin.elixir 1091 | 1092 | 1093 | comment 1094 | sigil (allow for interpolation) 1095 | end 1096 | \1[a-z]* 1097 | endCaptures 1098 | 1099 | 0 1100 | 1101 | name 1102 | punctuation.definition.string.end.elixir 1103 | 1104 | 1105 | name 1106 | string.quoted.other.sigil.elixir 1107 | patterns 1108 | 1109 | 1110 | include 1111 | #interpolated_elixir 1112 | 1113 | 1114 | include 1115 | #escaped_char 1116 | 1117 | 1118 | 1119 | 1120 | begin 1121 | ~[A-Z](?>""") 1122 | beginCaptures 1123 | 1124 | 0 1125 | 1126 | name 1127 | punctuation.definition.string.begin.elixir 1128 | 1129 | 1130 | comment 1131 | Double-quoted heredocs sigils 1132 | end 1133 | ^\s*""" 1134 | endCaptures 1135 | 1136 | 0 1137 | 1138 | name 1139 | punctuation.definition.string.end.elixir 1140 | 1141 | 1142 | name 1143 | string.quoted.other.sigil.heredoc.literal.elixir 1144 | 1145 | 1146 | begin 1147 | ~[A-Z]\{ 1148 | beginCaptures 1149 | 1150 | 0 1151 | 1152 | name 1153 | punctuation.definition.string.begin.elixir 1154 | 1155 | 1156 | comment 1157 | sigil (without interpolation) 1158 | end 1159 | \}[a-z]* 1160 | endCaptures 1161 | 1162 | 0 1163 | 1164 | name 1165 | punctuation.definition.string.end.elixir 1166 | 1167 | 1168 | name 1169 | string.quoted.other.sigil.literal.elixir 1170 | 1171 | 1172 | begin 1173 | ~[A-Z]\[ 1174 | beginCaptures 1175 | 1176 | 0 1177 | 1178 | name 1179 | punctuation.definition.string.begin.elixir 1180 | 1181 | 1182 | comment 1183 | sigil (without interpolation) 1184 | end 1185 | \][a-z]* 1186 | endCaptures 1187 | 1188 | 0 1189 | 1190 | name 1191 | punctuation.definition.string.end.elixir 1192 | 1193 | 1194 | name 1195 | string.quoted.other.sigil.literal.elixir 1196 | 1197 | 1198 | begin 1199 | ~[A-Z]\< 1200 | beginCaptures 1201 | 1202 | 0 1203 | 1204 | name 1205 | punctuation.definition.string.begin.elixir 1206 | 1207 | 1208 | comment 1209 | sigil (without interpolation) 1210 | end 1211 | \>[a-z]* 1212 | endCaptures 1213 | 1214 | 0 1215 | 1216 | name 1217 | punctuation.definition.string.end.elixir 1218 | 1219 | 1220 | name 1221 | string.quoted.other.sigil.literal.elixir 1222 | 1223 | 1224 | begin 1225 | ~[A-Z]\( 1226 | beginCaptures 1227 | 1228 | 0 1229 | 1230 | name 1231 | punctuation.definition.string.begin.elixir 1232 | 1233 | 1234 | comment 1235 | sigil (without interpolation) 1236 | end 1237 | \)[a-z]* 1238 | endCaptures 1239 | 1240 | 0 1241 | 1242 | name 1243 | punctuation.definition.string.end.elixir 1244 | 1245 | 1246 | name 1247 | string.quoted.other.sigil.literal.elixir 1248 | 1249 | 1250 | begin 1251 | ~[A-Z]([^\w]) 1252 | beginCaptures 1253 | 1254 | 0 1255 | 1256 | name 1257 | punctuation.definition.string.begin.elixir 1258 | 1259 | 1260 | comment 1261 | sigil (without interpolation) 1262 | end 1263 | \1[a-z]* 1264 | endCaptures 1265 | 1266 | 0 1267 | 1268 | name 1269 | punctuation.definition.string.end.elixir 1270 | 1271 | 1272 | name 1273 | string.quoted.other.sigil.literal.elixir 1274 | 1275 | 1276 | captures 1277 | 1278 | 1 1279 | 1280 | name 1281 | punctuation.definition.constant.elixir 1282 | 1283 | 1284 | comment 1285 | symbols 1286 | match 1287 | (?<!:)(:)(?>[a-zA-Z_][\w@]*(?>[?!]|=(?![>=]))?|\<\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\-|\|>|=>|=~|=|/|\\\\|\*\*?|\.\.?\.?|\.\.//|>=?|<=?|&&?&?|\+\+?|\-\-?|\|\|?\|?|\!|@|\%?\{\}|%|\[\]|\^(\^\^)?) 1288 | name 1289 | constant.other.symbol.elixir 1290 | 1291 | 1292 | captures 1293 | 1294 | 1 1295 | 1296 | name 1297 | punctuation.definition.constant.elixir 1298 | 1299 | 1300 | comment 1301 | symbols 1302 | match 1303 | (?>[a-zA-Z_][\w@]*(?>[?!])?)(:)(?!:) 1304 | name 1305 | constant.other.keywords.elixir 1306 | 1307 | 1308 | begin 1309 | (^[ \t]+)?(?=##) 1310 | beginCaptures 1311 | 1312 | 1 1313 | 1314 | name 1315 | punctuation.whitespace.comment.leading.elixir 1316 | 1317 | 1318 | end 1319 | (?!#) 1320 | patterns 1321 | 1322 | 1323 | begin 1324 | ## 1325 | beginCaptures 1326 | 1327 | 0 1328 | 1329 | name 1330 | punctuation.definition.comment.elixir 1331 | 1332 | 1333 | end 1334 | \n 1335 | name 1336 | comment.line.section.elixir 1337 | 1338 | 1339 | 1340 | 1341 | begin 1342 | (^[ \t]+)?(?=#) 1343 | beginCaptures 1344 | 1345 | 1 1346 | 1347 | name 1348 | punctuation.whitespace.comment.leading.elixir 1349 | 1350 | 1351 | end 1352 | (?!#) 1353 | patterns 1354 | 1355 | 1356 | begin 1357 | # 1358 | beginCaptures 1359 | 1360 | 0 1361 | 1362 | name 1363 | punctuation.definition.comment.elixir 1364 | 1365 | 1366 | end 1367 | \n 1368 | name 1369 | comment.line.number-sign.elixir 1370 | 1371 | 1372 | 1373 | 1374 | match 1375 | \b_([^_][\w]+[?!]?) 1376 | name 1377 | comment.unused.elixir 1378 | 1379 | 1380 | match 1381 | \b_\b 1382 | name 1383 | comment.wildcard.elixir 1384 | 1385 | 1386 | comment 1387 | 1388 | matches questionmark-letters. 1389 | 1390 | examples (1st alternation = hex): 1391 | ?\x1 ?\x61 1392 | 1393 | examples (2rd alternation = escaped): 1394 | ?\n ?\b 1395 | 1396 | examples (3rd alternation = normal): 1397 | ?a ?A ?0 1398 | ?* ?" ?( 1399 | ?. ?# 1400 | 1401 | the negative lookbehind prevents against matching 1402 | p(42.tainted?) 1403 | 1404 | match 1405 | (?<!\w)\?(\\(x[0-9A-Fa-f]{1,2}(?![0-9A-Fa-f])\b|[^xMC])|[^\s\\]) 1406 | name 1407 | constant.numeric.elixir 1408 | 1409 | 1410 | match 1411 | \+\+|\-\-|<\|> 1412 | name 1413 | keyword.operator.concatenation.elixir 1414 | 1415 | 1416 | match 1417 | \|\>|<~>|<>|<<<|>>>|~>>|<<~|~>|<~|<\|> 1418 | name 1419 | keyword.operator.sigils_1.elixir 1420 | 1421 | 1422 | match 1423 | &&&|&& 1424 | name 1425 | keyword.operator.sigils_2.elixir 1426 | 1427 | 1428 | match 1429 | <\-|\\\\ 1430 | name 1431 | keyword.operator.sigils_3.elixir 1432 | 1433 | 1434 | match 1435 | ===?|!==?|<=?|>=? 1436 | name 1437 | keyword.operator.comparison.elixir 1438 | 1439 | 1440 | match 1441 | (\|\|\||&&&|\^\^\^|<<<|>>>|~~~) 1442 | name 1443 | keyword.operator.bitwise.elixir 1444 | 1445 | 1446 | match 1447 | (?<=[ \t])!+|\bnot\b|&&|\band\b|\|\||\bor\b|\bxor\b 1448 | name 1449 | keyword.operator.logical.elixir 1450 | 1451 | 1452 | match 1453 | (\*|\+|\-|/) 1454 | name 1455 | keyword.operator.arithmetic.elixir 1456 | 1457 | 1458 | match 1459 | \||\+\+|\-\-|\*\*|\\\\|\<\-|\<\>|\<\<|\>\>|\:\:|\.\.|//|\|>|~|=>|& 1460 | name 1461 | keyword.operator.other.elixir 1462 | 1463 | 1464 | match 1465 | = 1466 | name 1467 | keyword.operator.assignment.elixir 1468 | 1469 | 1470 | match 1471 | : 1472 | name 1473 | punctuation.separator.other.elixir 1474 | 1475 | 1476 | match 1477 | \; 1478 | name 1479 | punctuation.separator.statement.elixir 1480 | 1481 | 1482 | match 1483 | , 1484 | name 1485 | punctuation.separator.object.elixir 1486 | 1487 | 1488 | match 1489 | \. 1490 | name 1491 | punctuation.separator.method.elixir 1492 | 1493 | 1494 | match 1495 | \{|\} 1496 | name 1497 | punctuation.section.scope.elixir 1498 | 1499 | 1500 | match 1501 | \[|\] 1502 | name 1503 | punctuation.section.array.elixir 1504 | 1505 | 1506 | match 1507 | \(|\) 1508 | name 1509 | punctuation.section.function.elixir 1510 | 1511 | 1512 | 1513 | escaped_char 1514 | 1515 | match 1516 | \\(x[\da-fA-F]{1,2}|.) 1517 | name 1518 | constant.character.escaped.elixir 1519 | 1520 | interpolated_elixir 1521 | 1522 | begin 1523 | #\{ 1524 | beginCaptures 1525 | 1526 | 0 1527 | 1528 | name 1529 | punctuation.section.embedded.begin.elixir 1530 | 1531 | 1532 | contentName 1533 | source.elixir 1534 | end 1535 | \} 1536 | endCaptures 1537 | 1538 | 0 1539 | 1540 | name 1541 | punctuation.section.embedded.end.elixir 1542 | 1543 | 1544 | name 1545 | meta.embedded.line.elixir 1546 | patterns 1547 | 1548 | 1549 | include 1550 | #nest_curly_and_self 1551 | 1552 | 1553 | include 1554 | $self 1555 | 1556 | 1557 | 1558 | nest_curly_and_self 1559 | 1560 | patterns 1561 | 1562 | 1563 | begin 1564 | \{ 1565 | captures 1566 | 1567 | 0 1568 | 1569 | name 1570 | punctuation.section.scope.elixir 1571 | 1572 | 1573 | end 1574 | \} 1575 | patterns 1576 | 1577 | 1578 | include 1579 | #nest_curly_and_self 1580 | 1581 | 1582 | 1583 | 1584 | include 1585 | $self 1586 | 1587 | 1588 | 1589 | 1590 | scopeName 1591 | source.elixir 1592 | uuid 1593 | D00C06B9-71B2-4FEB-A0E3-37237F579456 1594 | 1595 | 1596 | -------------------------------------------------------------------------------- /Syntaxes/HTML (EEx).tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | html.eex 8 | .heex 9 | .leex 10 | .neex 11 | 12 | foldingStartMarker 13 | (?x) 14 | (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?> 15 | |<!--(?!.*-->) 16 | |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) 17 | ) 18 | foldingStopMarker 19 | (?x) 20 | (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)> 21 | |^\s*--> 22 | |(^|\s)\} 23 | ) 24 | injections 25 | 26 | R:text.html.elixir meta.tag meta.attribute string.quoted 27 | 28 | comment 29 | Uses R: to ensure this matches after any other injections. 30 | patterns 31 | 32 | 33 | include 34 | text.elixir 35 | 36 | 37 | 38 | 39 | name 40 | HTML (EEx) 41 | patterns 42 | 43 | 44 | include 45 | text.elixir 46 | 47 | 48 | include 49 | text.html.basic 50 | 51 | 52 | scopeName 53 | text.html.elixir 54 | uuid 55 | 206E7013-2252-41AA-99A3-E8B3F4C2CC98 56 | 57 | 58 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | ohaqyrf@grkgzngr.bet 7 | contactName 8 | Michael Sheets 9 | description 10 | A dynamic, functional language designed for building scalable and maintainable applications. 11 | mainMenu 12 | 13 | items 14 | 15 | 06E4B9F0-06CD-4B95-822F-2CC67E3802C2 16 | CE857198-BBB1-4AF2-AA99-87740503390F 17 | C5F486D4-4EB3-434C-BCE5-6E741FF8893F 18 | ------------------------------------ 19 | BC8E67F4-BC03-4BED-AE09-34C7BB61F19E 20 | 690E4DB8-89CB-48ED-A515-04B3DC0D0F64 21 | 6A7177E2-1220-408E-84D9-48BF934A684E 22 | ------------------------------------ 23 | ED063C3E-E58C-4877-868F-2717EE7512CB 24 | 25 | submenus 26 | 27 | BC8E67F4-BC03-4BED-AE09-34C7BB61F19E 28 | 29 | items 30 | 31 | 23A6FE3D-FF3C-40ED-ABA0-716C30F65631 32 | 8A6D2B29-7780-42B2-BC12-F53BBD4725DD 33 | 24304A3D-9877-488F-B030-6FD021E80462 34 | 107D111F-5B1A-4C1F-9797-C78327994A33 35 | 9577138E-4F81-459D-BB53-55EAA733814A 36 | 23403EDF-D1B5-444D-B53B-6F4BD6575D13 37 | 0AE60466-9C59-4FCD-97B3-3BB40A61BFC4 38 | 8478937E-E333-4CA3-8F17-52A781A89263 39 | 79F7CEF9-C157-4366-AF02-4818F7DA817C 40 | A7A6CCF0-E8E8-4CB5-B379-93B24736FE02 41 | 42 | name 43 | Conditionals 44 | 45 | 690E4DB8-89CB-48ED-A515-04B3DC0D0F64 46 | 47 | items 48 | 49 | B84C6EFA-2343-473E-84EC-78F8FBA7F54F 50 | 70D885A3-B612-4B5D-842E-D94474C8C8CA 51 | EB8EAB9A-F9A8-495F-A59F-44A95A127666 52 | C716B59F-52CC-4FF5-A7A6-3B641BFA8BAE 53 | AE70A3F4-DFE8-46E9-8156-BF70A5AD382D 54 | 0F19FC07-C543-4E3E-BA08-6C7860E13686 55 | BA860DCC-170C-44FE-8E9A-D05034152952 56 | E7B7CFAE-188B-4B7F-B556-BE58D5C54215 57 | 6402A657-B3B1-4DB4-9C9B-708716AD0DC4 58 | 1BAFD05F-558D-4B18-95BF-7399E84A8E39 59 | 22297559-5C12-4EDC-913B-423C1E1740D8 60 | 61BFD2AA-EDBB-44D5-B09B-C66C506D3EE0 61 | 4B3DD799-8C49-48C3-B392-38DA059BBC83 62 | DC883D65-C4F6-484C-A7A7-4C08BA9DC0AB 63 | AC5F6B5B-8672-46B6-A3DE-C1898F86D404 64 | E4770543-5096-462E-88BF-4F4A0F24EF13 65 | 66 | name 67 | Definitions 68 | 69 | 6A7177E2-1220-408E-84D9-48BF934A684E 70 | 71 | items 72 | 73 | C950FE7C-5277-4954-9D96-A7ACDECE9BC1 74 | A43F022B-1B16-49D8-89A8-1A2DA9F7D0DB 75 | ------------------------------------ 76 | 79481DC6-D14E-4FFD-B4AC-1680139047B3 77 | F0413B1A-CDD9-4425-BA63-09BE5CF37CBC 78 | ------------------------------------ 79 | 87F5A82D-F956-4708-9E4B-098B66E57DA2 80 | 1BDECB09-0FBE-4DE0-B154-B87A0A7BC31F 81 | 7FBF1166-6B5B-4B98-AAAD-023FA3D97D11 82 | 93A56CC9-F0E0-40ED-8029-D435D2261EC6 83 | 93B56CC9-F0E0-40ED-8029-D435D2261EC6 84 | AB492DEE-2168-40EE-B2F9-B293C18C6250 85 | 9A27D450-377A-498B-8A76-CF6F757EA82C 86 | 0834347B-D4FA-448C-990E-61DD94897BA3 87 | 0E030583-E0AC-4E7A-B795-0AB594BB66AA 88 | 89 | name 90 | Structure 91 | 92 | 93 | 94 | name 95 | Elixir 96 | uuid 97 | E65BAFA0-39BA-458F-8D85-ECE6BF9EDF69 98 | 99 | 100 | -------------------------------------------------------------------------------- /mix_format_file.py: -------------------------------------------------------------------------------- 1 | import os 2 | from os import path 3 | import sublime 4 | import sublime_plugin 5 | import subprocess 6 | 7 | class MixFormatFileCommand(sublime_plugin.TextCommand): 8 | def run(self, edit): 9 | window = self.view.window() 10 | window.run_command("save") 11 | window.run_command("mix_format_file_without_save") 12 | 13 | class MixFormatOnSave(sublime_plugin.EventListener): 14 | def on_post_save(self, view): 15 | syntax = view.settings().get('syntax') 16 | 17 | if syntax.find('Elixir.tmLanguage') != -1: 18 | settings = sublime.load_settings('Elixir.sublime-settings') 19 | 20 | if settings.get('mix_format_on_save', False): 21 | view.run_command('mix_format_file_without_save') 22 | 23 | if settings.get('reload_after_mix_format', False): 24 | view.run_command("revert") 25 | 26 | class MixFormatFileWithoutSaveCommand(sublime_plugin.TextCommand): 27 | def run(self, edit): 28 | window = self.view.window() 29 | settings = sublime.load_settings('Elixir.sublime-settings') 30 | 31 | # Hide the console window on Windows 32 | shell = False 33 | path_separator = ':' 34 | if os.name == 'nt': 35 | shell = True 36 | path_separator = ';' 37 | 38 | file_name = self.view.file_name() 39 | cwd = self.find_cwd(window, settings, file_name) 40 | 41 | if settings.get('make_path_relative', False): 42 | file_name = self.make_path_relative(file_name, cwd) 43 | 44 | cmd = settings.get('mix_format_command', 'mix format').split(' ') + [file_name] 45 | 46 | p = subprocess.Popen( 47 | cmd, 48 | stdout=subprocess.PIPE, 49 | stderr=subprocess.PIPE, 50 | shell=shell, 51 | cwd=cwd 52 | ) 53 | 54 | _, stderrdata = p.communicate() 55 | 56 | stderrdata = stderrdata.strip() 57 | 58 | if stderrdata: 59 | panel_view = window.create_output_panel('mix_format') 60 | panel_view.set_read_only(False) 61 | 62 | panel_view.run_command('erase_view') 63 | panel_view.run_command('append', {'characters': stderrdata.decode()}) 64 | 65 | panel_view.set_read_only(True) 66 | window.run_command('show_panel', {'panel': 'output.mix_format'}) 67 | else: 68 | window.run_command('hide_panel', {'panel': 'output.mix_format'}) 69 | window.status_message('Formatting successful!') 70 | 71 | def find_cwd(self, window, settings, file_name): 72 | cur_dir = path.dirname(file_name) 73 | cwd = os.path.expanduser("~") 74 | for root_path in window.folders(): 75 | if cur_dir.startswith(root_path): 76 | cwd = root_path 77 | break 78 | 79 | if settings.get('use_root_dir', False): 80 | cwd 81 | else: 82 | while cwd != cur_dir: 83 | if path.isfile(path.join(cur_dir, 'mix.exs')): 84 | cwd = cur_dir 85 | break 86 | else: 87 | cur_dir = path.dirname(cur_dir) 88 | if cur_dir == "/": 89 | cwd 90 | break 91 | 92 | return cwd 93 | 94 | def make_path_relative(self, file_name, cwd): 95 | return file_name.replace(cwd, '.') 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /syntax_test.elixir: -------------------------------------------------------------------------------- 1 | // SYNTAX TEST "Elixir.tmLanguage" 2 | "Hello, World! # not a comment" 3 | // ^ string.quoted.double 4 | // ^ string.quoted.double - comment 5 | 6 | # Comment 7 | import Foo 8 | // ^ source.elixir keyword.control.elixir 9 | --------------------------------------------------------------------------------