├── Commands
├── Align Assignments.tmCommand
├── Compile and run.tmCommand
├── Double quoute to triple quote.tmCommand
├── Javadoc for line.tmCommand
├── Package for file.tmCommand
├── Run as script.tmCommand
├── SBT Code Completion.tmCommand
├── Scala Library Documentation.tmCommand
├── Scala REPL.tmCommand
├── Scala REPL: Paste selection.tmCommand
├── Scala REPL: Preload file.tmCommand
└── new javadoc line.tmCommand
├── LICENSE
├── Preferences
├── Comments.tmPreferences
├── Disable Spellchecking.tmPreferences
├── Enable spellchecking.tmPreferences
├── Highlight pairs (comments).tmPreferences
├── Highlight pairs.tmPreferences
├── Indention rules.tmPreferences
├── Simple Build Tool Symbol List.tmPreferences
├── Standard completions.tmPreferences
├── Symbol List.tmPreferences
├── Typing pairs (comments).tmPreferences
├── Typing pairs.tmPreferences
└── Valid Scaladoc annotations.tmPreferences
├── README.markdown
├── Snippets
├── case class scaffolding.tmSnippet
├── case class.tmSnippet
├── case.tmSnippet
├── class.tmSnippet
├── enumeration.tmSnippet
├── for - Block.tmSnippet
├── for - Yield.tmSnippet
├── if.tmSnippet
├── import mutable:immutable.tmSnippet
├── lambda.tmSnippet
├── left arrow.tmSnippet
├── main.tmSnippet
├── match.tmSnippet
├── method.tmSnippet
├── object with main method.tmSnippet
├── object.tmSnippet
├── println.tmSnippet
├── right arrow.tmSnippet
├── script header.tmSnippet
├── shortcut - case class.tmSnippet
├── shortcut - class.tmSnippet
├── shortcut - enumeration.tmSnippet
├── shortcut - match.tmSnippet
├── shortcut - object.tmSnippet
├── shortcut - trait.tmSnippet
├── toString.tmSnippet
├── trait.tmSnippet
├── try:catch.tmSnippet
└── with.tmSnippet
├── Support
├── scala_repl.sh
└── tests
│ ├── README
│ ├── gtm
│ ├── input
│ ├── class.scala
│ ├── identifiers.scala
│ ├── import.scala
│ ├── import2.scala
│ ├── import3.scala
│ └── method.scala
│ ├── output
│ ├── class.output
│ ├── identifiers.output
│ ├── import.output
│ ├── import2.output
│ ├── import3.output
│ └── method.output
│ └── run_tests.rb
├── Syntaxes
├── Scala.tmLanguage
└── Simple Build Tool.tmLanguage
└── info.plist
/Commands/Align Assignments.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | bundleUUID
8 | 452017E8-0065-49EF-AB9D-7849B27D9367
9 | command
10 | #!/usr/bin/env ruby18
11 | #
12 | # ----------------------------------------------------------------
13 | # MODIFIED BY MADS HARTMANN JENSEN TO MATCH THE NEEDS OF THE SCALA
14 | # PROGRAMMING LANGUAGE
15 | # ----------------------------------------------------------------
16 | #
17 | # Assignment block tidier, version 0.1.
18 | #
19 | # Copyright Chris Poirier 2006.
20 | # Licensed under the Academic Free License version 3.0.
21 | #
22 | # This script can be used as a command for TextMate to align all
23 | # of the equal signs within a block of text. When using it with
24 | # TextMate, set the command input to "Selected Text" or "Document",
25 | # and the output to "Replace Selected Text". Map it to a key
26 | # equivalent, and any time you want to tidy up a block, either
27 | # select it, or put your cursor somewhere within it; then hit the
28 | # key equivalent. Voila.
29 | #
30 | # Note that this is the first version of the script, and it hasn't
31 | # been heavily tested. You might encounter a bug or two.
32 | #
33 | # Per the license, use of this script is ENTIRELY at your own risk.
34 | # See the license for full details (they override anything I've
35 | # said here).
36 |
37 | lines = STDIN.readlines()
38 | selected_text = ENV.member?("TM_SELECTED_TEXT")
39 |
40 |
41 | pattern, column_pattern, split_pattern, symbol = begin
42 | line = ENV['TM_CURRENT_LINE']
43 |
44 | arrow_line_pattern = /^[^=]+[^-+<>=!%\/|&*^]->(?!=|~)/
45 | arrow_left_line_pattern = /^[^=]+[^-+<>=!%\/|&*^]<-(?!=|~)/
46 | assignment_line_pattern = /^[^=]+[^-+<>=!%\/|&*^]=([^>]|(?=.*=))/
47 | function_line_pattern = /^[^=]+[^-+<>=!%\/|&*^]=>(?!=|~)/
48 |
49 | arrow_column_search_pattern = /[\t ]*->/
50 | arrow_left_column_search_pattern = /[\t ]*<-/
51 | assignment_column_search_pattern = /[\t ]*=[^>]/
52 | function_column_search_pattern = /[\t ]*=>/
53 |
54 | assignment_split_pattern = /[\t ]*=(?!>)[\t ]*/
55 | function_split_pattern = /[\t ]*=>[\t ]*/
56 | arrow_split_pattern = /[\t ]*->[\t ]*/
57 | arrow_left_split_pattern = /[\t ]*<-[\t ]*/
58 |
59 | arrow_symbol = "->"
60 | arrow_left_symbol = "<-"
61 | assignment_symbol = "="
62 | function_symbol = "=>"
63 |
64 | if !line.match(function_line_pattern).nil?
65 | [function_line_pattern, function_column_search_pattern, function_split_pattern, function_symbol]
66 | elsif !line.match(assignment_line_pattern).nil?
67 | [assignment_line_pattern, assignment_column_search_pattern, assignment_split_pattern, assignment_symbol]
68 | elsif !line.match(arrow_line_pattern).nil?
69 | [arrow_line_pattern, arrow_column_search_pattern, arrow_split_pattern, arrow_symbol]
70 | elsif !line.match(arrow_left_line_pattern).nil?
71 | [arrow_left_line_pattern, arrow_left_column_search_pattern, arrow_left_split_pattern, arrow_left_symbol]
72 | end
73 |
74 | end
75 |
76 | #
77 | # If called on a selection, every assignment statement
78 | # is in the block. If called on the document, we start on the
79 | # current line and look up and down for the start and end of the
80 | # block.
81 |
82 | if selected_text then
83 | block_top = 1
84 | block_bottom = lines.length
85 | else
86 |
87 | #
88 | # We start looking on the current line. However, if the
89 | # current line doesn't match the pattern, we may be just
90 | # after or just before a block, and we should check. If
91 | # neither, we are done.
92 |
93 | start_on = ENV["TM_LINE_NUMBER"].to_i
94 | block_top = lines.length + 1
95 | block_bottom = 0
96 | search_top = 1
97 | search_bottom = lines.length
98 | search_failed = false
99 |
100 | if lines[start_on - 1] !~ pattern then
101 | if lines[start_on - 2] =~ pattern then
102 | search_bottom = start_on = start_on - 1
103 | elsif lines[start_on] =~ pattern then
104 | search_top = start_on = start_on
105 | else
106 | search_failed = true
107 | end
108 | end
109 |
110 | #
111 | # Now with the search boundaries set, start looking for
112 | # the block top and bottom.
113 |
114 | unless search_failed
115 | start_on.downto(search_top) do |number|
116 | if lines[number-1] =~ pattern then
117 | block_top = number
118 | else
119 | break
120 | end
121 | end
122 |
123 | start_on.upto(search_bottom) do |number|
124 | if lines[number-1] =~ pattern then
125 | block_bottom = number
126 | else
127 | break
128 | end
129 | end
130 | end
131 | end
132 |
133 |
134 | # First off, make sure that the indentation is the same for each line.
135 | # The smallest indentation is used.
136 |
137 | indentation = nil ## some number that
138 | block_top.upto(block_bottom) do |number|
139 | line = lines[number - 1]
140 | if line =~ pattern then
141 | _indentation = line.match(/^\s*/).to_s
142 | indentation = _indentation if indentation.nil?
143 | indentation = _indentation if _indentation.size < indentation.size
144 | end
145 | end
146 |
147 | block_top.upto(block_bottom) do |number|
148 | if lines[number-1] =~ pattern then
149 | symbol, before, after = begin
150 | line = lines[number-1]
151 | if !line.match(split_pattern).nil?
152 | [symbol] | line.split(split_pattern,2)
153 | end
154 | end
155 |
156 | lines[number-1] = indentation + lines[number-1].gsub(/^\s*/,"")
157 |
158 | end
159 | end
160 |
161 | #
162 | # Now, iterate over the block and find the best column number
163 | # for the = sign. The pattern will tell us the position of the
164 | # first bit of whitespace before the equal sign. We put the
165 | # equals sign to the right of the furthest-right one. Note that
166 | # we cannot assume every line in the block is relevant.
167 |
168 | best_column = 0
169 | block_top.upto(block_bottom) do |number|
170 | line = lines[number - 1]
171 | if line =~ pattern then
172 | m = column_pattern.match(line)
173 | best_column = m.begin(0) if m.begin(0) > best_column
174 | end
175 | end
176 |
177 | #
178 | # Reformat the block. Again, we cannot assume all lines in the
179 | # block are relevant.
180 |
181 | block_top.upto(block_bottom) do |number|
182 | if lines[number-1] =~ pattern then
183 | symbol, before, after = begin
184 | line = lines[number-1]
185 | if !line.match(split_pattern).nil?
186 | [symbol] | line.split(split_pattern,2)
187 | end
188 | end
189 | lines[number-1] = [before.ljust(best_column), after].join(after[0,1] == '>' ? " #{symbol}" : " #{symbol} ")
190 | end
191 | end
192 |
193 | #
194 | # Output the replacement text
195 |
196 | lines.each do |line|
197 | puts line
198 | end
199 |
200 | input
201 | selection
202 | keyEquivalent
203 | ~@]
204 | name
205 | Align Assignments
206 | output
207 | replaceSelectedText
208 | scope
209 | source.scala
210 | uuid
211 | 04D3E42F-4497-4D65-AE50-E7F261D25158
212 |
213 |
214 |
--------------------------------------------------------------------------------
/Commands/Compile and run.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env bash
9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
10 |
11 | . "$TM_SUPPORT_PATH/lib/webpreview.sh"
12 |
13 | html_header "Compile and run ${TM_FILENAME}"
14 |
15 | cd "$TM_DIRECTORY"
16 |
17 | "$TM_SCALAC" -unchecked -deprecation "$TM_FILENAME" &> >("ruby18" -rtm_parser -eTextMate.parse_errors)
18 | if (($? >= 1)); then exit; fi
19 |
20 | main=`basename "$TM_FILENAME" .scala`
21 |
22 | echo "<pre>"
23 | "$TM_SCALA" "${main}"
24 | echo "</pre>"
25 |
26 | html_footer "Done."
27 | input
28 | none
29 | inputFormat
30 | text
31 | keyEquivalent
32 | @b
33 | name
34 | Compile and Run
35 | outputCaret
36 | afterOutput
37 | outputFormat
38 | html
39 | outputLocation
40 | newWindow
41 | requiredCommands
42 |
43 |
44 | command
45 | scala
46 | locations
47 |
48 | /usr/local/bin/scala
49 | /opt/local/bin/scala
50 |
51 | variable
52 | TM_SCALA
53 |
54 |
55 | command
56 | scalac
57 | locations
58 |
59 | /usr/local/bin/scalac
60 | /opt/local/bin/scalac
61 |
62 | variable
63 | TM_SCALAC
64 |
65 |
66 | scope
67 | source.scala
68 | uuid
69 | 8C82E10C-A830-4647-B98F-957018D47C9C
70 | version
71 | 2
72 |
73 |
74 |
--------------------------------------------------------------------------------
/Commands/Double quoute to triple quote.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby18 -wKU
9 |
10 | print '"""${0}"""'
11 | fallbackInput
12 | scope
13 | input
14 | selection
15 | name
16 | Double quoute to triple quote
17 | output
18 | insertAsSnippet
19 | scope
20 | string.quoted.double.scala
21 | tabTrigger
22 | "
23 | uuid
24 | 8DD4BB8E-C09D-4BC2-90F6-B4248892F325
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Commands/Javadoc for line.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | bundleUUID
8 | 452017E8-0065-49EF-AB9D-7849B27D9367
9 | command
10 | #!/usr/bin/env ruby18 -wKU
11 |
12 | require 'stringio'
13 | require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'
14 |
15 | # ===========
16 | # = Helpers =
17 | # ===========
18 |
19 | def largest_argument(arguments)
20 | size = 0
21 | arguments.each do |arg|
22 | size = arg.size if arg.size > size
23 | end
24 | return size
25 | end
26 |
27 | def pretty_print(annotation, arguments, msg, size, spacing, initial_tab_stop_count)
28 | new_tab_stop_count = initial_tab_stop_count
29 | str = arguments.collect do |arg|
30 | new_tab_stop_count = new_tab_stop_count+1
31 | if arg == ""
32 | "#{spacing} * #{annotation} ${#{new_tab_stop_count}:#{msg}}\n"
33 | else
34 | "#{spacing} * #{annotation} #{arg} ${#{new_tab_stop_count}:#{msg}}\n"
35 | end
36 |
37 | end
38 | return str.to_s , new_tab_stop_count
39 | end
40 |
41 | # ==========
42 | # = Script =
43 | # ==========
44 |
45 | tab_stop_count = 1
46 | line_number = ENV['TM_LINE_NUMBER'].to_i
47 | current_line = ENV['TM_CURRENT_LINE']
48 | lines = STDIN.readlines().to_a
49 |
50 | if current_line.match(/def|class|object|trait/) != nil
51 | before, middle, after = begin
52 | before = lines.slice(0,line_number-1)
53 | middle = lines.slice(line_number-1,lines.size).take_while { |line|
54 | line.match(/\{/).nil?
55 | }
56 | middle = middle | lines.slice(line_number-1+middle.size,1)
57 | after = lines.slice(line_number-1+middle.size,lines.size)
58 | [before, middle, after]
59 | end
60 |
61 | initial_spacing = current_line.scan(/^\s*/).to_s
62 | arguments = middle.to_s.scan(/[^)](\w*\s?:\s?\w*)/).collect do |arg| arg.to_s.split(":").first end
63 | size = largest_argument(arguments)
64 |
65 | comments = StringIO.new
66 | comments << "#{initial_spacing}/** \n"
67 | comments << "#{initial_spacing} * ${#{tab_stop_count}:I really should get around to writing some documentation} \n"
68 |
69 | tab_stop_count = tab_stop_count + 1
70 |
71 | comments << "${#{tab_stop_count}:"
72 |
73 | params, tab_stop_count = pretty_print("@param",arguments, "well isn't it obvious", size, initial_spacing, tab_stop_count)
74 | returns, tab_stop_count = pretty_print("@return",[""], "dunno", size, initial_spacing, tab_stop_count)
75 |
76 | comments << "#{initial_spacing} * \n"
77 | comments << params.to_s
78 | comments << returns.to_s
79 | comments << "}"
80 | comments << "#{initial_spacing} */\n"
81 |
82 | tab_stop_count = tab_stop_count+1
83 |
84 | before.each do | line | puts line.gsub(/`/,'\\\`') end
85 | print comments.string.to_s
86 | print "${0:}" + middle.to_s
87 | after.each do | line | puts line.gsub(/`/,'\\\`') end
88 | else
89 | TextMate::UI.tool_tip("Place the caret at a line that declares something")
90 | lines[line_number-1] = "${0:}" + lines[line_number-1]
91 | puts lines.to_s
92 | end
93 | fallbackInput
94 | document
95 | input
96 | selection
97 | keyEquivalent
98 | @D
99 | name
100 | Javadoc for line
101 | output
102 | insertAsSnippet
103 | scope
104 | source.scala
105 | uuid
106 | F56949E3-B311-4BD8-898C-7316E4134785
107 |
108 |
109 |
--------------------------------------------------------------------------------
/Commands/Package for file.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | bundleUUID
8 | 452017E8-0065-49EF-AB9D-7849B27D9367
9 | command
10 | #!/usr/bin/env ruby18 -wKU
11 |
12 | project = ENV['TM_PROJECT_DIRECTORY']
13 | name = ENV['TM_FILENAME']
14 | file = ENV['TM_FILEPATH']
15 | packageName = file.gsub(project+"/","").gsub("/"+name,"").gsub("src/","").gsub("main/","").gsub("test/","").gsub("scala/","").gsub("/",".")
16 |
17 | print "package " + packageName
18 |
19 |
20 | input
21 | none
22 | name
23 | Package for file
24 | output
25 | insertAsSnippet
26 | scope
27 | source.scala
28 | tabTrigger
29 | package
30 | uuid
31 | CF8424AF-D081-49BF-A535-FAF593584F86
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Commands/Run as script.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | saveModifiedFiles
7 | command
8 | #!/usr/bin/env ruby18
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/executor"
11 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/save_current_document"
12 |
13 | TextMate.save_if_untitled('scala')
14 | TextMate::Executor.run(ENV['TM_SCALA'], '-nocompdaemon', '-howtorun:script', ENV['TM_FILEPATH'], :version_args => ["-version"], :version_regex => /\AScala code runner version ([^\s]*).*/m)
15 |
16 | input
17 | document
18 | inputFormat
19 | text
20 | keyEquivalent
21 | @r
22 | name
23 | Run
24 | outputCaret
25 | afterOutput
26 | outputFormat
27 | html
28 | outputLocation
29 | newWindow
30 | requiredCommands
31 |
32 |
33 | command
34 | scala
35 | locations
36 |
37 | /usr/local/bin/scala
38 | /opt/local/bin/scala
39 |
40 | variable
41 | TM_SCALA
42 |
43 |
44 | scope
45 | source.scala
46 | uuid
47 | DDFBBCF9-D333-4077-8D4F-EF6F2CA62220
48 | version
49 | 2
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Commands/SBT Code Completion.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby18 -wKU
9 | require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'
10 |
11 | choices = [{ "display" => 'logLevel', },
12 | { "display" => 'persistLogLevel', },
13 | { "display" => 'traceLevel', },
14 | { "display" => 'persistTraceLevel', },
15 | { "display" => 'showSuccess', },
16 | { "display" => 'showTiming', },
17 | { "display" => 'timingFormat', },
18 | { "display" => 'logManager', },
19 | { "display" => 'logBuffered', },
20 | { "display" => 'projectCommand', },
21 | { "display" => 'sessionSettings', },
22 | { "display" => 'stateBuildStructure', },
23 | { "display" => 'buildStructure', },
24 | { "display" => 'appConfiguration', },
25 | { "display" => 'thisProject', },
26 | { "display" => 'thisProjectRef', },
27 | { "display" => 'configuration', },
28 | { "display" => 'commands', },
29 | { "display" => 'initialize', },
30 | { "display" => 'onLoad', },
31 | { "display" => 'onUnload', },
32 | { "display" => 'logged', },
33 | { "display" => 'historyPath', },
34 | { "display" => 'shellPrompt', },
35 | { "display" => 'analysis', },
36 | { "display" => 'watch', },
37 | { "display" => 'pollInterval', },
38 | { "display" => 'watchSources', },
39 | { "display" => 'watchTransitiveSources', },
40 | { "display" => 'baseDirectory', },
41 | { "display" => 'target', },
42 | { "display" => 'crossTarget', },
43 | { "display" => 'sourceDirectory', },
44 | { "display" => 'sourceManaged', },
45 | { "display" => 'scalaSource', },
46 | { "display" => 'javaSource', },
47 | { "display" => 'sourceDirectories', },
48 | { "display" => 'unmanagedSourceDirectories', },
49 | { "display" => 'unmanagedSources', },
50 | { "display" => 'managedSourceDirectories', },
51 | { "display" => 'managedSources', },
52 | { "display" => 'sources', },
53 | { "display" => 'sourceFilter', },
54 | { "display" => 'defaultExcludes', },
55 | { "display" => 'resourceDirectory', },
56 | { "display" => 'resourceManaged', },
57 | { "display" => 'unmanagedResourceDirectories', },
58 | { "display" => 'unmanagedResources', },
59 | { "display" => 'managedResourceDirectories', },
60 | { "display" => 'managedResources', },
61 | { "display" => 'resourceDirectories', },
62 | { "display" => 'resources', },
63 | { "display" => 'classDirectory', },
64 | { "display" => 'docDirectory', },
65 | { "display" => 'cacheDirectory', },
66 | { "display" => 'cleanFiles', },
67 | { "display" => 'cleanKeepFiles', },
68 | { "display" => 'crossPaths', },
69 | { "display" => 'sourceGenerators', },
70 | { "display" => 'resourceGenerators', },
71 | { "display" => 'autoCompilerPlugins', },
72 | { "display" => 'maxErrors', },
73 | { "display" => 'scaladocOptions', },
74 | { "display" => 'scalacOptions', },
75 | { "display" => 'javacOptions', },
76 | { "display" => 'compileOrder', },
77 | { "display" => 'initialCommands', },
78 | { "display" => 'compileInputs', },
79 | { "display" => 'scalaHome', },
80 | { "display" => 'scalaInstance', },
81 | { "display" => 'scalaVersion', },
82 | { "display" => 'crossScalaVersions', },
83 | { "display" => 'classpathOptions', },
84 | { "display" => 'definedSbtPlugins', },
85 | { "display" => 'sbtPlugin', },
86 | { "display" => 'clean', },
87 | { "display" => 'console', },
88 | { "display" => 'consoleQuick', },
89 | { "display" => 'consoleProject', },
90 | { "display" => 'compile', },
91 | { "display" => 'compilers', },
92 | { "display" => 'doc', },
93 | { "display" => 'copyResources', },
94 | { "display" => 'aggregate', },
95 | { "display" => 'packageBin', },
96 | { "display" => 'packageDoc', },
97 | { "display" => 'packageSrc', },
98 | { "display" => 'packageOptions', },
99 | { "display" => 'packageConfiguration', },
100 | { "display" => 'artifactPath', },
101 | { "display" => 'artifact', },
102 | { "display" => 'artifactClassifier', },
103 | { "display" => 'artifactName', },
104 | { "display" => 'mappings', },
105 | { "display" => 'selectMainClass', },
106 | { "display" => 'mainClass', },
107 | { "display" => 'run', },
108 | { "display" => 'runMain', },
109 | { "display" => 'discoveredMainClasses', },
110 | { "display" => 'runner', },
111 | { "display" => 'trapExit', },
112 | { "display" => 'fork', },
113 | { "display" => 'outputStrategy', },
114 | { "display" => 'javaHome', },
115 | { "display" => 'javaOptions', },
116 | { "display" => 'testLoader', },
117 | { "display" => 'loadedTestFrameworks', },
118 | { "display" => 'definedTests', },
119 | { "display" => 'executeTests', },
120 | { "display" => 'test', },
121 | { "display" => 'testOnly', },
122 | { "display" => 'testOptions', },
123 | { "display" => 'testFrameworks', },
124 | { "display" => 'testListeners', },
125 | { "display" => 'isModule', },
126 | { "display" => 'Classpath', },
127 | { "display" => 'name', },
128 | { "display" => 'normalizedName', },
129 | { "display" => 'organization', },
130 | { "display" => 'defaultConfiguration', },
131 | { "display" => 'defaultConfigurationMapping', },
132 | { "display" => 'products', },
133 | { "display" => 'productDirectories', },
134 | { "display" => 'exportJars', },
135 | { "display" => 'exportedProducts', },
136 | { "display" => 'unmanagedClasspath', },
137 | { "display" => 'unmanagedJars', },
138 | { "display" => 'managedClasspath', },
139 | { "display" => 'internalDependencyClasspath', },
140 | { "display" => 'externalDependencyClasspath', },
141 | { "display" => 'dependencyClasspath', },
142 | { "display" => 'fullClasspath', },
143 | { "display" => 'internalConfigurationMap', },
144 | { "display" => 'classpathConfiguration', },
145 | { "display" => 'ivyConfiguration', },
146 | { "display" => 'ivyConfigurations', },
147 | { "display" => 'moduleSettings', },
148 | { "display" => 'unmanagedBase', },
149 | { "display" => 'updateConfiguration', },
150 | { "display" => 'ivySbt', },
151 | { "display" => 'ivyModule', },
152 | { "display" => 'classpathFilter', },
153 | { "display" => 'update', },
154 | { "display" => 'updateClassifiers', },
155 | { "display" => 'transitiveClassifiers', },
156 | { "display" => 'updateSbtClassifiers', },
157 | { "display" => 'publishConfiguration', },
158 | { "display" => 'publishLocalConfiguration', },
159 | { "display" => 'deliverConfiguration', },
160 | { "display" => 'deliverLocalConfiguration', },
161 | { "display" => 'makePomConfiguration', },
162 | { "display" => 'packagedArtifacts', },
163 | { "display" => 'publishMavenStyle', },
164 | { "display" => 'credentials', },
165 | { "display" => 'makePom', },
166 | { "display" => 'deliver', },
167 | { "display" => 'deliverLocal', },
168 | { "display" => 'publish', },
169 | { "display" => 'publishLocal', },
170 | { "display" => 'pomExtra', },
171 | { "display" => 'pomPostProcess', },
172 | { "display" => 'pomIncludeRepository', },
173 | { "display" => 'moduleID', },
174 | { "display" => 'version', },
175 | { "display" => 'projectID', },
176 | { "display" => 'externalResolvers', },
177 | { "display" => 'resolvers', },
178 | { "display" => 'projectResolver', },
179 | { "display" => 'fullResolvers', },
180 | { "display" => 'otherResolvers', },
181 | { "display" => 'moduleConfigurations', },
182 | { "display" => 'retrievePattern', },
183 | { "display" => 'retrieveConfiguration', },
184 | { "display" => 'offline', },
185 | { "display" => 'ivyPaths', },
186 | { "display" => 'libraryDependencies', },
187 | { "display" => 'allDependencies', },
188 | { "display" => 'projectDependencies', },
189 | { "display" => 'ivyXML', },
190 | { "display" => 'ivyScala', },
191 | { "display" => 'ivyValidate', },
192 | { "display" => 'ivyLoggingLevel', },
193 | { "display" => 'publishTo', },
194 | { "display" => 'artifacts', },
195 | { "display" => 'projectDescriptors', },
196 | { "display" => 'autoUpdate', },
197 | { "display" => 'retrieveManaged', },
198 | { "display" => 'managedDirectory', },
199 | { "display" => 'classpathTypes', },
200 | { "display" => 'publishArtifact', },
201 | { "display" => 'packagedArtifact', },
202 | { "display" => 'checksums', },
203 | { "display" => 'autoScalaLibrary', },
204 | { "display" => 'sbtResolver', },
205 | { "display" => 'sbtDependency', },
206 | { "display" => 'sbtVersion', },
207 | { "display" => 'parallelExecution', },
208 | { "display" => 'settings', },
209 | { "display" => 'streams', },
210 | { "display" => 'isDummyTask', },
211 | { "display" => 'taskDefinitionKey', },
212 | { "display" => 'resolvedScoped' }]
213 |
214 | TextMate::UI.complete(choices)
215 | fallbackInput
216 | word
217 | input
218 | selection
219 | keyEquivalent
220 | ~
221 | name
222 | SBT Code Completion
223 | output
224 | showAsTooltip
225 | scope
226 | source.sbt
227 | uuid
228 | F5E08907-DD4F-4FD2-8777-23C96D4BF738
229 |
230 |
231 |
--------------------------------------------------------------------------------
/Commands/Scala Library Documentation.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | if [[ "${SCALA_DOC}" ]]
9 | then echo "<meta http-equiv='Refresh' content='0;URL=file://$SCALA_DOC/api/index.html'>"
10 | else echo "<meta http-equiv='Refresh' content='0;URL=http://www.scala-lang.org/api/current/index.html'>"
11 | fi
12 | fallbackInput
13 | none
14 | input
15 | selection
16 | keyEquivalent
17 | ^h
18 | name
19 | Scala Library Documentation
20 | output
21 | showAsHTML
22 | scope
23 | source.scala
24 | uuid
25 | FE33460A-1416-47B5-A76B-75BBFA2398F8
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Commands/Scala REPL.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env bash
9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
10 |
11 | export SHELL_NAME=${SHELL_NAME:="Textmate Scala REPL"}
12 | export CMD=${CMD:="scala"}
13 | "$TM_BUNDLE_SUPPORT/scala_repl.sh"
14 | input
15 | none
16 | inputFormat
17 | text
18 | keyEquivalent
19 | @R
20 | name
21 | Scala REPL
22 | outputCaret
23 | afterOutput
24 | outputFormat
25 | text
26 | outputLocation
27 | discard
28 | scope
29 | source.scala
30 | uuid
31 | BCAA9E11-45C8-43C7-8B43-E680AD7F6165
32 | version
33 | 2
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Commands/Scala REPL: Paste selection.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env bash
9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
10 |
11 | SHELL_NAME=${SHELL_NAME:="Textmate Scala REPL"}
12 | PASTE=$(echo "$TM_SELECTED_TEXT" | sed s/\"/\\\\\"/g)
13 | osascript << END
14 | tell application "Terminal"
15 | activate
16 | do script "$PASTE" in window 1
17 | end tell
18 | END
19 | input
20 | none
21 | inputFormat
22 | text
23 | keyEquivalent
24 | @R
25 | name
26 | Scala REPL: Paste selection
27 | outputCaret
28 | afterOutput
29 | outputFormat
30 | text
31 | outputLocation
32 | discard
33 | scope
34 | source.scala
35 | uuid
36 | 7F176B4F-5D0E-459A-8042-A459B41051A8
37 | version
38 | 2
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Commands/Scala REPL: Preload file.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env bash
9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
10 |
11 | export SHELL_NAME=${SHELL_NAME:="Textmate Scala REPL"}
12 | export CMD=${CMD:="scala -i $TM_FILEPATH"}
13 | "$TM_BUNDLE_SUPPORT/scala_repl.sh"
14 |
15 |
16 | input
17 | none
18 | inputFormat
19 | text
20 | keyEquivalent
21 | @R
22 | name
23 | Scala REPL: Preload file
24 | outputCaret
25 | afterOutput
26 | outputFormat
27 | text
28 | outputLocation
29 | discard
30 | scope
31 | source.scala
32 | uuid
33 | 45A658D8-D64D-4810-B7DD-762AC3EFD8CF
34 | version
35 | 2
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Commands/new javadoc line.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | bundleUUID
8 | 452017E8-0065-49EF-AB9D-7849B27D9367
9 | command
10 | #!/usr/bin/env ruby18 -wKU
11 |
12 | cline = ENV['TM_CURRENT_LINE']
13 | space = cline.scan(/^\s*/).to_s
14 |
15 | chars = cline.chars.to_a
16 | startColumn = ENV['TM_COLUMN_NUMBER'].to_i-1
17 | endColumn = cline.chars.count
18 |
19 | start = chars.slice(0,startColumn)
20 | rest = chars.slice(startColumn, endColumn)
21 |
22 | print start
23 | print "\n" + space + "*\t"+rest.to_s+ "$0"
24 | fallbackInput
25 | line
26 | input
27 | selection
28 | keyEquivalent
29 | $
30 | name
31 | new javadoc line
32 | output
33 | insertAsSnippet
34 | scope
35 | comment.block.documentation.scala
36 | uuid
37 | 701CC71E-0CB8-4C5C-922B-F363193B4AAF
38 |
39 |
40 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 Mads Hartmann Jensen
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 | of the Software, and to permit persons to whom the Software is furnished to do
8 | so, subject to the following conditions:
9 |
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Preferences/Comments.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Comments
7 | scope
8 | source.scala
9 | settings
10 |
11 | shellVariables
12 |
13 |
14 | name
15 | TM_COMMENT_START
16 | value
17 | //
18 |
19 |
20 | name
21 | TM_COMMENT_START_2
22 | value
23 | /*
24 |
25 |
26 | name
27 | TM_COMMENT_END_2
28 | value
29 | */
30 |
31 |
32 |
33 | uuid
34 | 99FB23BA-DD49-447F-9F1A-FF07630CB940
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Preferences/Disable Spellchecking.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Disable Spellchecking
7 | scope
8 | source.scala string.quoted
9 | settings
10 |
11 | spellChecking
12 | 0
13 |
14 | uuid
15 | 80930738-1643-4DEC-A143-B6E96F0E63AD
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Preferences/Enable spellchecking.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Enable spellchecking
7 | scope
8 | comment.block.documentation.scala
9 | settings
10 |
11 | spellChecking
12 | 1
13 |
14 | uuid
15 | 256E7AF5-FEF1-4078-A423-08C59FA950A9
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Preferences/Highlight pairs (comments).tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Highlight pairs (comments)
7 | scope
8 | comment.block.documentation.scala, comment.line.double-slash.scala
9 | settings
10 |
11 | highlightPairs
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 | DEC9652D-94E8-4A94-8086-707F375A98A6
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Preferences/Highlight pairs.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bundleUUID
6 | 452017E8-0065-49EF-AB9D-7849B27D9367
7 | name
8 | Highlight pairs
9 | scope
10 | source.scala
11 | settings
12 |
13 | highlightPairs
14 |
15 |
16 | [
17 | ]
18 |
19 |
20 | (
21 | )
22 |
23 |
24 | {
25 | }
26 |
27 |
28 |
29 | uuid
30 | A43C5E83-6D71-4D6F-B19C-445588806EAF
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Preferences/Indention rules.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bundleUUID
6 | 452017E8-0065-49EF-AB9D-7849B27D9367
7 | name
8 | Indention rules
9 | scope
10 | source.scala
11 | settings
12 |
13 | decreaseIndentPattern
14 | ^\s*(\}|\))
15 | increaseIndentPattern
16 | (^.*(\{[^}]*|\([^)]*)$)
17 |
18 | uuid
19 | EEEDB0BB-E825-4BFF-8D9B-CAE34FFCD8FC
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Preferences/Simple Build Tool Symbol List.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Simple Build Tool Symbol List
7 | scope
8 | source.sbt constant.other.setting.sbt
9 | settings
10 |
11 | showInSymbolList
12 | 1
13 |
14 | uuid
15 | 9EC5A69F-CC68-4636-8E2E-766F5D71BF43
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Preferences/Standard completions.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Standard completions
7 | scope
8 | source.scala
9 | settings
10 |
11 | completions
12 |
13 | @annotation.switch
14 | @annotation.tailrec
15 | @transient
16 | @volatile
17 | Annotation
18 | AnnotationDefault
19 | AnnotationInfo
20 | Any
21 | AnyRef
22 | AnyVal
23 | Apply
24 | Array
25 | ArrayAnnotArg
26 | BeanProperty
27 | Boolean
28 | BooleanBeanProperty
29 | Byte
30 | Char
31 | ClassManifest
32 | ClassTag
33 | ClassfileAnnotation
34 | Double
35 | Exception
36 | Float
37 | Ident
38 | Int
39 | List
40 | Literal
41 | LiteralAnnotArg
42 | Long
43 | MODULE$
44 | NestedAnnotArg
45 | Nil
46 | NoPrefix
47 | NoSymbol
48 | NoType
49 | None
50 | Nothing
51 | Null
52 | Object
53 | PartialFunction
54 | Predef
55 | Product
56 | ScalaRunTime
57 | ScalaSig
58 | Select
59 | Seq
60 | Serializable
61 | Short
62 | Some
63 | String
64 | Symbol
65 | Throwable
66 | Tree
67 | TypeApply
68 | TypeRef
69 | TypeTag
70 | TypeTree
71 | Unit
72 | abstract
73 | applyDynamic
74 | applyDynamicNamed
75 | asInstanceOf
76 | assert
77 | case class
78 | case object
79 | catch
80 | class
81 | classManifest
82 | classOf
83 | contains
84 | definitions
85 | extends
86 | false
87 | filter
88 | final
89 | finally
90 | flatMap
91 | forSome
92 | foreach
93 | getClass
94 | getMethod
95 | getOrElse
96 | hasNext
97 | implicit
98 | import
99 | isDefinedAt
100 | isEmpty
101 | isInstanceOf
102 | java.io.File
103 | java.io.Serializable
104 | java.lang.reflect.
105 | macro
106 | manifest
107 | map
108 | newTermName
109 | newTypeName
110 | override
111 | package
112 | private
113 | productArity
114 | productElement
115 | productIterator
116 | productPrefix
117 | protected
118 | return
119 | sameElements
120 | scala
121 | sealed
122 | selectDynamic
123 | setAccessible
124 | super
125 | synchronized
126 | this
127 | throw
128 | toArray
129 | toDouble
130 | toInt
131 | toList
132 | toLong
133 | toSeq
134 | trait
135 | unapply
136 | unapplySeq
137 | unary_!
138 | unary_+
139 | unary_-
140 | unary_~
141 | update
142 | updateDynamic
143 | while
144 | with
145 | withFilter
146 | yield
147 | zip
148 |
149 |
150 | uuid
151 | 5273A275-C431-4DDA-809B-74551F450BB4
152 |
153 |
154 |
--------------------------------------------------------------------------------
/Preferences/Symbol List.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Symbol List
7 | scope
8 | entity.name.function.declaration.scala, entity.name.type.class.declaration.scala, entity.name.type.val.declaration.scala, entity.name.type.type.declaration.scala
9 | settings
10 |
11 | showInSymbolList
12 | 1
13 |
14 | uuid
15 | 31262BFB-520A-4253-A81C-60023C0CFC8B
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Preferences/Typing pairs (comments).tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Typing pairs (comments)
7 | scope
8 | comment.block.documentation.scala, comment.line.double-slash.scala
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 | 9C932C48-440C-4EFF-B9DF-088587CAD485
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Preferences/Typing pairs.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Typing pairs
7 | scope
8 | source.scala
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 | `
36 |
37 |
38 |
39 | uuid
40 | D7F71256-E8BB-4AC1-A61E-BE36832E3E5E
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Preferences/Valid Scaladoc annotations.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Valid Scaladoc annotations
7 | scope
8 | keyword.other.documentation.scaladoc.scala
9 | settings
10 |
11 | completions
12 |
13 | author
14 | version
15 | param
16 | return
17 | exception
18 | see
19 | since
20 | serial
21 | deprecated
22 | link
23 |
24 | disableDefaultCompletion
25 | 1
26 |
27 | uuid
28 | 37AD8061-D284-4D24-A6C2-A641197D5CC2
29 |
30 |
31 |
--------------------------------------------------------------------------------
/README.markdown:
--------------------------------------------------------------------------------
1 | Scala TextMate Bundle
2 | =====================
3 |
4 | Textmate bundle for the Scala Programming Language.
5 |
6 | Using it
7 | --------
8 |
9 | **Snippets**
10 |
11 | As any good textmate bundle this one comes with a bunch of snippets that will make you more productive. To make it easier for you to remember all of the tab-completions the bundle strives to use the keywords as tab-triggers. As an example: If you wanted to create a new class you would simply write "class" and hit tab. If you wanted to create a case class you would type "case class" and hit tab and so on.
12 |
13 | This of course means that the tab-triggers aren't as short as they could have been. If you're programming Scala every day you would probably prefer that you would only have to type "cc" and hit tab and it would expand into a case class. Now, Textmate doesn't allow a snippet to have multiple tab trigger (i.e. both "case class" and "cc") and having duplicated snippets would be a mess to maintain. So to fix this most of the snippets have a shorter version with expand to the "larger" version which in turn can expand to the full source. Here's and example
14 |
15 | cc <tab> => case class <tab> => proper source for a case class
16 |
17 | This means you have to hit tab twice but I think that's a fair tradeoff.
18 |
19 | **Playing with the code**
20 |
21 | The bundle offers several ways to play around with Scala code in your document - Hit ⌘R and see the options possible
22 |
23 | - **Scala REPL**: This will start the Scala REPL in a new tab in the a frontmost terminal window or create a new window if one doesn't exist.
24 | - **Scala REPL: Preload file** This will start the Scala REPL like above but it will preload the current file
25 | - **Scala REPL: Paste selection** This will paste the current selection in TextMate to active Terminal tab.
26 |
27 | **Other cool stuff**
28 | - **Align Assignments**: This will align anything according to =>,=,->,<-.
29 | - **Comments**
30 | - Javadoc for line (⌘⇧D): Will analyze the the current line and add the appropriate documentation for the line (i.e. correct @param etc.)
31 | - New javadoc line (⇧⏎ in comment scope): Will create a new correctly indented comment line.
32 |
33 | Shell variables
34 | ---------------
35 |
36 | - **SCALA_DOC**: If you want to browse the documentation offline, set this shell variable. Here's how mine is set: /Users/Mads/dev/programming\_languages/scala-2.8.1.final-devel-docs
37 | - **SCALA_HOME**:If you want to be able to run and/or compile single files from within textmate /Users/Mads/dev/programming\_languages/scala-2.8.0.final/
38 | - **SCALA_COMPILER**:Defaults to scalac.
39 |
40 | Installation
41 | ------------
42 |
43 |
git clone git://github.com/mads379/scala.tmbundle.git
44 | open scala.tmbundle
45 |
46 |
47 | Contributors
48 | ------------
49 |
50 | - Mads Hartmann Jensen
51 | - Paul Phillips (paulp)
52 | - (murr4y)
53 | - (mikemckibben)
54 | - (fizx)
55 |
--------------------------------------------------------------------------------
/Snippets/case class scaffolding.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | class ${1:Class}(${2/(\S+\s*:)/val $1/g}) {
7 | override def hashCode = 0 ${2/(\S+)\s*:[^,]+(,?)/+ $1.##/g}
8 | override def equals(other: Any) = $1.unapply(this) == $1.unapply(other)
9 | override def canEqual(other: Any) = other.isInstanceOf[$1]
10 | }
11 |
12 | object $1 {
13 | def apply(${2:arguments}): $1 = new $1(${2/(\S+)\s*:[^,]+/$1/g})
14 | def unapply(other: Any) = other match {
15 | case x: $1 => import x._ ; Some(${2/(\S+)\s*:[^,]+/$1/g})
16 | case _ => None
17 | }
18 | }
19 |
20 | name
21 | case class scaffolding
22 | scope
23 | source.scala
24 | tabTrigger
25 | ccc
26 | uuid
27 | CC643A92-5A38-4998-AB95-041EAF15ECF9
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Snippets/case class.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | case class ${1:${TM_FILENAME/(.*)\.scala/$1/}}${2:($3)} ${4:extends ${5:Any} }${6:{
7 | $7
8 | \}}$0
9 | name
10 | case class
11 | scope
12 | source.scala
13 | tabTrigger
14 | case class
15 | uuid
16 | 493A836C-428D-4CA5-9E29-E2C927C8B642
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/case.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | case ${1:_} => ${0}
7 | name
8 | case
9 | scope
10 | source.scala
11 | tabTrigger
12 | case
13 | uuid
14 | C32C1AFB-F874-454E-8C82-86832CA296FD
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/class.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | class ${1:${TM_FILENAME/(.*)\.scala/$1/}}${2:($3)} ${4:extends ${5:Any} }{
7 | $0
8 | }
9 | name
10 | class
11 | scope
12 | source.scala
13 | tabTrigger
14 | class
15 | uuid
16 | E79DCC79-E834-4B6C-8280-EBE0B9A0A41F
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/enumeration.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | object ${1:MyEnumeration} extends Enumeration {
7 | type $1 = Value
8 | val ${2:${3:MyEnumeration1}, ${4:MyEnumeration2}} = Value
9 | }
10 |
11 | ${5:import $1._}
12 | ${0}
13 | name
14 | enumeration
15 | scope
16 | source.scala
17 | tabTrigger
18 | enumeration
19 | uuid
20 | 0097F60C-0AAC-4CC0-8815-C6BA0E77606F
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Snippets/for - Block.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | for ($1 <- ${2:${3:0} to ${4:10}}) {
7 | $0
8 | }
9 | name
10 | for - Block
11 | scope
12 | source.scala
13 | tabTrigger
14 | for
15 | uuid
16 | ADF7CCBE-80DD-488E-A2A9-B3B8B582F69F
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/for - Yield.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | for {
7 | $1 <- ${2:${3:0} to ${4:10}}
8 | } yield $0
9 | name
10 | for - Yield
11 | scope
12 | source.scala
13 | tabTrigger
14 | for
15 | uuid
16 | E0E52BED-94DD-4D9F-8ED5-BEE344AB3FDC
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/if.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | if ($1) {
7 | $2
8 | }
9 |
10 | name
11 | if
12 | scope
13 | source.scala
14 | tabTrigger
15 | if
16 | uuid
17 | 9D749173-9874-4BEC-80A1-BAE8AF266AD9
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Snippets/import mutable:immutable.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | import scala.collection.{ mutable, immutable, generic }
7 | name
8 | import mutable/immutable
9 | scope
10 | source.scala
11 | tabTrigger
12 | impc
13 | uuid
14 | F38BFF4F-BE1D-4CE2-8BE8-8BEDF5EB7277
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/lambda.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bundleUUID
6 | 452017E8-0065-49EF-AB9D-7849B27D9367
7 | content
8 | ($1) => ${2:{${3:}\}}
9 | name
10 | lambda
11 | scope
12 | source.scala
13 | tabTrigger
14 | lam
15 | uuid
16 | 92B4042E-2409-466F-A0B6-80A46B36679F
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/left arrow.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:"${2}"} <- ${3:"${4}"}
7 | name
8 | left arrow
9 | scope
10 | source.scala
11 | tabTrigger
12 | <-
13 | uuid
14 | 20512DA9-649C-420F-A0E1-F7DD04A349EE
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/main.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | def main(args: Array[String]): Unit = {
7 | $1
8 | }
9 |
10 | name
11 | main
12 | scope
13 | source.scala
14 | tabTrigger
15 | main
16 | uuid
17 | 6CCA6D38-8C03-4D29-97BD-45CED52713FB
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Snippets/match.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | match {
7 | case ${1:_} => $0
8 | }
9 |
10 | name
11 | match
12 | scope
13 | source.scala
14 | tabTrigger
15 | match
16 | uuid
17 | 6851152B-CD07-4E27-9932-631A86102B5C
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Snippets/method.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | def ${1:method}${2:(${4:arg}: ${5:Type})} = {
7 | ${0}
8 | }
9 | name
10 | method
11 | scope
12 | source.scala
13 | tabTrigger
14 | def
15 | uuid
16 | D03DC03A-8622-4F4F-BDAC-3AD1E8D51705
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/object with main method.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bundleUUID
6 | 452017E8-0065-49EF-AB9D-7849B27D9367
7 | content
8 | object ${1:${TM_FILENAME/(.*)\.scala/$1/}} {
9 | def main(args: Array[String]): Unit = {
10 | $2
11 | }
12 | }
13 |
14 | name
15 | object with main method
16 | scope
17 | source.scala
18 | tabTrigger
19 | omain
20 | uuid
21 | 853C1915-7B23-4C79-AAAA-AEDFB21CA08C
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Snippets/object.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | object ${1:${TM_FILENAME/(.*)\.scala/$1/}} ${2:extends ${3:Any} }{
7 | $0
8 | }
9 | name
10 | object
11 | scope
12 | source.scala
13 | tabTrigger
14 | object
15 | uuid
16 | 97CB4393-6DCC-45B4-8830-61D6B5D036B2
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/println.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | println($0)
7 | name
8 | println
9 | scope
10 | source.scala
11 | tabTrigger
12 | pl
13 | uuid
14 | 2F43ADBA-E02A-4712-8870-0774BAE5CC9F
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/right arrow.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:"${2}"} -> ${3:"${4}"}
7 | name
8 | right arrow
9 | scope
10 | source.scala
11 | tabTrigger
12 | ->
13 | uuid
14 | 53B78E1D-F3C2-49C6-89D3-6BE30961C14D
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/script header.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | #!/bin/sh
7 | exec scala "\$0" "\$@"
8 | !#
9 |
10 | $1
11 | name
12 | script header
13 | tabTrigger
14 | script
15 | uuid
16 | 11D5086B-FD25-4B33-92E3-4DEADCF4119D
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/shortcut - case class.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | case class
7 | name
8 | shortcut - case class
9 | scope
10 | source.scala
11 | tabTrigger
12 | cc
13 | uuid
14 | 909A1E64-9672-4FC1-87B3-608A57257E5D
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/shortcut - class.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | class
7 | name
8 | shortcut - class
9 | scope
10 | source.scala
11 | tabTrigger
12 | c
13 | uuid
14 | EEB7E161-EF45-410A-91CD-7C74F94449A4
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/shortcut - enumeration.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | enumeration
7 | name
8 | shortcut - enumeration
9 | scope
10 | source.scala
11 | tabTrigger
12 | enum
13 | uuid
14 | FFD2A2D6-000C-4AD6-BA36-A1ACD05A392B
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/shortcut - match.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | match
7 | name
8 | shortcut - match
9 | scope
10 | source.scala
11 | tabTrigger
12 | m
13 | uuid
14 | 7BE0DE43-86F5-48C6-A8DF-A7AC891A68EE
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/shortcut - object.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | object
7 | name
8 | shortcut - object
9 | scope
10 | source.scala
11 | tabTrigger
12 | obj
13 | uuid
14 | CEAD5E83-C0D9-4D3D-9E73-C37634DD410D
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/shortcut - trait.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | trait
7 | name
8 | shortcut - trait
9 | scope
10 | source.scala
11 | tabTrigger
12 | t
13 | uuid
14 | 1D85F938-738B-42DD-9206-A4D250B744DD
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/toString.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | override def toString(): String = $0
7 |
8 | name
9 | toString
10 | scope
11 | source.scala
12 | tabTrigger
13 | tostr
14 | uuid
15 | E3CAD7C5-59B2-4CD2-9D9F-5D225998E2ED
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Snippets/trait.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | trait ${1:${TM_FILENAME/(.*)\.scala/$1/}} {
7 | $0
8 | }
9 | name
10 | trait
11 | scope
12 | source.scala
13 | tabTrigger
14 | trait
15 | uuid
16 | BAD79DCF-1B14-42CE-BE6E-7EE5A56190B3
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/try:catch.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | try {
7 | ${1:// ...}
8 | } catch {
9 | case e: Exception => $0
10 | }
11 | name
12 | try/catch
13 | scope
14 | source.scala
15 | tabTrigger
16 | try
17 | uuid
18 | 833B549D-AA46-4BC9-AC05-CBF4CD1DA723
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Snippets/with.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | with ${1:Any}
7 | name
8 | with
9 | scope
10 | source.scala
11 | tabTrigger
12 | with
13 | uuid
14 | 56D7D5D4-355C-4BAA-8F38-DA5A5FCA33C8
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Support/scala_repl.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | osascript << END
4 | tell application "Terminal"
5 | activate
6 | if (count of windows) is 0 then
7 | do script "$CMD"
8 | else
9 | tell application "System Events"
10 | keystroke "t" using {command down}
11 | end
12 | delay 1
13 | do script "$CMD" in window 1
14 | end if
15 | end tell
16 | END
--------------------------------------------------------------------------------
/Support/tests/README:
--------------------------------------------------------------------------------
1 | TODO: Write README
--------------------------------------------------------------------------------
/Support/tests/gtm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mads-hartmann/scala.tmbundle/4ca419a095d82255eab766bba56bfcf679fc79d4/Support/tests/gtm
--------------------------------------------------------------------------------
/Support/tests/input/class.scala:
--------------------------------------------------------------------------------
1 | class MyClass extends Any {
2 |
3 | }
--------------------------------------------------------------------------------
/Support/tests/input/identifiers.scala:
--------------------------------------------------------------------------------
1 | var $test = "lol"
2 | var _test = "lol"
3 | var go_fst_cand = "lol"
4 | var go$fst$cand = "lol"
5 | def $test = "lol"
6 | def _test = "lol"
7 | def go_fst_cand = "lol"
8 | def go$fst$cand = "lol"
9 | def go_fst_cand($name: String) = "lol"
--------------------------------------------------------------------------------
/Support/tests/input/import.scala:
--------------------------------------------------------------------------------
1 | import scala.xml.{NodeSeq}
--------------------------------------------------------------------------------
/Support/tests/input/import2.scala:
--------------------------------------------------------------------------------
1 | import scala.xml.NodeSeq
--------------------------------------------------------------------------------
/Support/tests/input/import3.scala:
--------------------------------------------------------------------------------
1 | import scala.xml.NodeSeq //comment
2 | import scala.xml.{NodeSeq, XML} //comment
--------------------------------------------------------------------------------
/Support/tests/input/method.scala:
--------------------------------------------------------------------------------
1 | def method(arg :String): String = {
2 |
3 | }
--------------------------------------------------------------------------------
/Support/tests/output/class.output:
--------------------------------------------------------------------------------
1 | class MyClass extends Any {
2 |
3 | }
--------------------------------------------------------------------------------
/Support/tests/output/identifiers.output:
--------------------------------------------------------------------------------
1 | var $test = "lol"
2 | var _test = "lol"
3 | var go_fst_cand = "lol"
4 | var go$fst$cand = "lol"
5 | def $test = "lol"
6 | def _test = "lol"
7 | def go_fst_cand = "lol"
8 | def go$fst$cand = "lol"
9 | def go_fst_cand($name: String) = "lol"
--------------------------------------------------------------------------------
/Support/tests/output/import.output:
--------------------------------------------------------------------------------
1 | import scala.xml.{NodeSeq}
--------------------------------------------------------------------------------
/Support/tests/output/import2.output:
--------------------------------------------------------------------------------
1 | import scala.xml.NodeSeq
--------------------------------------------------------------------------------
/Support/tests/output/import3.output:
--------------------------------------------------------------------------------
1 | import scala.xml.NodeSeq //comment
2 | import scala.xml.{NodeSeq, XML} //comment
--------------------------------------------------------------------------------
/Support/tests/output/method.output:
--------------------------------------------------------------------------------
1 | def method(arg :String): String = {
2 |
3 | }
--------------------------------------------------------------------------------
/Support/tests/run_tests.rb:
--------------------------------------------------------------------------------
1 | module RunTests
2 |
3 | module_function
4 |
5 | def compare(name)
6 | result = `./gtm < input/#{name}.scala ../../Syntaxes/Scala.tmLanguage`.split("\n")
7 | expected = `cat output/#{name}.output`.split("\n")
8 |
9 | booleans = Array.new(result.count) { |index|
10 | result[index] == expected[index]
11 | }
12 | booleans.uniq.count == 1 && booleans.uniq[0] == true
13 | end
14 |
15 | end
16 |
17 | ## This tests a simple class definition
18 | puts "Simple class: " + RunTests.compare("class").to_s
19 |
20 | ## This tests a simple method definition
21 | puts "Simple method: " + RunTests.compare("method").to_s
22 |
23 | ## Import with brackets, ie. scala.xml.NodeSeq
24 | puts "Simple import: " + RunTests.compare("import").to_s
25 |
26 | ## Import without brackets, ie. scala.xml.NodeSeq
27 | puts "Simple import2: " + RunTests.compare("import2").to_s
28 |
29 | ## Comments on same line as import statements
30 | puts "Simple import3: " + RunTests.compare("import3").to_s
31 |
32 | ## In identifiers $ and _ should be treated as uppercase letters
33 | ## are be allowed.
34 | puts "Identifiers: " + RunTests.compare("identifiers").to_s
--------------------------------------------------------------------------------
/Syntaxes/Scala.tmLanguage:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | fileTypes
6 |
7 | scala
8 |
9 | firstLineMatch
10 | ^#!/.*\b\w*scala\b
11 | foldingStartMarker
12 | /\*\*|\{\s*$
13 | foldingStopMarker
14 | \*\*/|^\s*\}
15 | keyEquivalent
16 | ^~S
17 | name
18 | Scala
19 | patterns
20 |
21 |
22 | include
23 | #code
24 |
25 |
26 | repository
27 |
28 | block-comments
29 |
30 | begin
31 | /\*
32 | beginCaptures
33 |
34 | 1
35 |
36 | name
37 | punctuation.definition.comment.begin.scala
38 |
39 |
40 | end
41 | \*/
42 | endCaptures
43 |
44 | 1
45 |
46 | name
47 | punctuation.definition.comment.end.scala
48 |
49 |
50 | name
51 | comment.block.scala
52 | patterns
53 |
54 |
55 | include
56 | #block-comments
57 |
58 |
59 |
60 | char-literal
61 |
62 | begin
63 | '
64 | beginCaptures
65 |
66 | 0
67 |
68 | name
69 | punctuation.definition.character.begin.scala
70 |
71 |
72 | end
73 | '
74 | endCaptures
75 |
76 | 0
77 |
78 | name
79 | punctuation.definition.character.end.scala
80 |
81 |
82 | name
83 | constant.character.literal.scala
84 | patterns
85 |
86 |
87 | match
88 | \\(?:[btnfr\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})
89 | name
90 | constant.character.escape.scala
91 |
92 |
93 | match
94 | \\.
95 | name
96 | invalid.illegal.unrecognized-character-escape.scala
97 |
98 |
99 | match
100 | [^']{2,}
101 | name
102 | invalid.illegal.character-literal-too-long
103 |
104 |
105 | match
106 | (?<!')[^']
107 | name
108 | invalid.illegal.character-literal-too-long
109 |
110 |
111 |
112 | code
113 |
114 | patterns
115 |
116 |
117 | include
118 | #storage-modifiers
119 |
120 |
121 | include
122 | #declarations
123 |
124 |
125 | include
126 | #inheritance
127 |
128 |
129 | include
130 | #imports
131 |
132 |
133 | include
134 | #comments
135 |
136 |
137 | include
138 | #strings
139 |
140 |
141 | include
142 | #initialization
143 |
144 |
145 | include
146 | #xml-literal
147 |
148 |
149 | include
150 | #keywords
151 |
152 |
153 | include
154 | #constants
155 |
156 |
157 | include
158 | #scala-symbol
159 |
160 |
161 | include
162 | #char-literal
163 |
164 |
165 | include
166 | #empty-blocks
167 |
168 |
169 | include
170 | #parameter-list
171 |
172 |
173 | include
174 | #qualifiedClassName
175 |
176 |
177 | include
178 | #meta-brackets
179 |
180 |
181 | include
182 | #meta-bounds
183 |
184 |
185 | include
186 | #meta-colons
187 |
188 |
189 |
190 | comments
191 |
192 | patterns
193 |
194 |
195 | captures
196 |
197 | 0
198 |
199 | name
200 | punctuation.definition.comment.scala
201 |
202 |
203 | match
204 | /\*\*/
205 | name
206 | comment.block.empty.scala
207 |
208 |
209 | begin
210 | ^\s*(/\*\*)
211 | beginCaptures
212 |
213 | 1
214 |
215 | name
216 | punctuation.definition.comment.scala
217 |
218 |
219 | end
220 | \*/
221 | endCaptures
222 |
223 | 0
224 |
225 | name
226 | punctuation.definition.comment.scala
227 |
228 |
229 | name
230 | comment.block.documentation.scala
231 | patterns
232 |
233 |
234 | captures
235 |
236 | 1
237 |
238 | name
239 | keyword.other.documentation.scaladoc.scala
240 |
241 | 2
242 |
243 | name
244 | variable.parameter.scala
245 |
246 |
247 | match
248 | (@param)\s+(\S+)
249 |
250 |
251 | captures
252 |
253 | 1
254 |
255 | name
256 | keyword.other.documentation.scaladoc.scala
257 |
258 | 2
259 |
260 | name
261 | entity.name.type.class.scala
262 |
263 |
264 | match
265 | (@(?:tparam|throws))\s+(\S+)
266 |
267 |
268 | match
269 | @(return|see|note|example|usecase|author|version|since|todo|deprecated|migration|define|inheritdoc)\b
270 | name
271 | keyword.other.documentation.scaladoc.scala
272 |
273 |
274 | captures
275 |
276 | 1
277 |
278 | name
279 | punctuation.definition.documentation.link.scala
280 |
281 | 2
282 |
283 | name
284 | entity.name.type.class.documentation.link.scala
285 |
286 | 3
287 |
288 | name
289 | punctuation.definition.documentation.link.scala
290 |
291 |
292 | match
293 | (\[\[)([^\]]+)(\]\])
294 |
295 |
296 |
297 |
298 | include
299 | #block-comments
300 |
301 |
302 | captures
303 |
304 | 1
305 |
306 | name
307 | comment.line.double-slash.scala
308 |
309 | 2
310 |
311 | name
312 | punctuation.definition.comment.scala
313 |
314 |
315 | match
316 | \s*((//).*$\n?)
317 |
318 |
319 |
320 | constants
321 |
322 | patterns
323 |
324 |
325 | match
326 | \b(false|null|true|Nil|None)\b
327 | name
328 | constant.language.scala
329 |
330 |
331 | match
332 | \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b
333 | name
334 | constant.numeric.scala
335 |
336 |
337 | match
338 | \b(this|super|self)\b
339 | name
340 | variable.language.scala
341 |
342 |
343 | match
344 | \b(Unit|Boolean|Byte|Char|Short|Int|Float|Long|Double)\b
345 | name
346 | storage.type.primitive.scala
347 |
348 |
349 | match
350 | \b(String|Symbol)\b
351 | name
352 | storage.type.scala
353 |
354 |
355 |
356 | declarations
357 |
358 | patterns
359 |
360 |
361 | captures
362 |
363 | 1
364 |
365 | name
366 | keyword.control.def.scala
367 |
368 | 2
369 |
370 | name
371 | entity.name.function.declaration.scala
372 |
373 |
374 | match
375 | (?x)
376 | \b(def)\s+
377 | (`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\s])(?=[(\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~><^+*%:!#|/@\\]+)
378 |
379 |
380 | captures
381 |
382 | 1
383 |
384 | name
385 | storage.modifier.case.scala
386 |
387 | 2
388 |
389 | name
390 | storage.type.$1.scala
391 |
392 | 3
393 |
394 | name
395 | entity.name.type.class.declaration.scala
396 |
397 |
398 | match
399 | (?:(case) +)?\b(class|trait|object)\s+([^\s\{\(\[]+)
400 |
401 |
402 | captures
403 |
404 | 1
405 |
406 | name
407 | keyword.control.type.scala
408 |
409 | 2
410 |
411 | name
412 | entity.name.type.type.declaration.scala
413 |
414 |
415 | match
416 | \b(type)\s+(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\s])(?=[\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~><^+*%:!#|/@\\]+)
417 |
418 |
419 | captures
420 |
421 | 1
422 |
423 | name
424 | storage.type.stable.scala
425 |
426 | 2
427 |
428 | name
429 | storage.type.volatile.scala
430 |
431 | 3
432 |
433 | name
434 | entity.name.type.val.declaration.scala
435 |
436 |
437 | match
438 | \b(?:(val)|(var))\s+(?:(`[^`]+`|[_$a-zA-Z][_$a-zA-Z0-9]*(?:_[^\s])(?=[\t ])|[_$a-zA-Z][_$a-zA-Z0-9]*|[-?~><^+*%:!#|/@\\]+)|(?=\())
439 |
440 |
441 | captures
442 |
443 | 1
444 |
445 | name
446 | storage.type.package.scala
447 |
448 | 2
449 |
450 | name
451 | storage.type.package.object.scala
452 |
453 | 3
454 |
455 | name
456 | entity.name.type.class.declaration.scala
457 |
458 |
459 | match
460 | \b(package) (object)\s+([^\s\{\(\[]+)
461 |
462 |
463 | captures
464 |
465 | 1
466 |
467 | name
468 | storage.type.package.scala
469 |
470 | 2
471 |
472 | name
473 | entity.name.type.package.scala
474 |
475 |
476 | match
477 | \b(package)\s+([\w\.]+)
478 | name
479 | meta.package.scala
480 |
481 |
482 |
483 | empty-blocks
484 |
485 | patterns
486 |
487 |
488 | captures
489 |
490 | 1
491 |
492 | name
493 | punctuation.definition.parentheses.begin.scala
494 |
495 | 2
496 |
497 | name
498 | punctuation.definition.parentheses.end.scala
499 |
500 |
501 | match
502 | (\()(\))
503 | name
504 | meta.parentheses.scala
505 |
506 |
507 | captures
508 |
509 | 1
510 |
511 | name
512 | punctuation.definition.parentheses.begin.scala
513 |
514 | 2
515 |
516 | name
517 | punctuation.definition.parentheses.end.scala
518 |
519 |
520 | match
521 | (\{)(\})
522 | name
523 | meta.braces.scala
524 |
525 |
526 |
527 | imports
528 |
529 | begin
530 | \b(import)\s+
531 | beginCaptures
532 |
533 | 1
534 |
535 | name
536 | keyword.control.import.scala
537 |
538 |
539 | end
540 | (?<=[\n;])
541 | name
542 | meta.import.scala
543 | patterns
544 |
545 |
546 | include
547 | #comments
548 |
549 |
550 | match
551 | ([^\s{;.]+)\s*\.\s*
552 | name
553 | variable.other.package.scala
554 |
555 |
556 | match
557 | ([^\s{;.]+)\s*
558 | name
559 | variable.other.import.scala
560 |
561 |
562 | begin
563 | {
564 | beginCaptures
565 |
566 | 0
567 |
568 | name
569 | meta.bracket.scala
570 |
571 |
572 | end
573 | }
574 | endCaptures
575 |
576 | 0
577 |
578 | name
579 | meta.bracket.scala
580 |
581 |
582 | name
583 | meta.import.selector.scala
584 | patterns
585 |
586 |
587 | captures
588 |
589 | 1
590 |
591 | name
592 | variable.other.import.renamed-from.scala
593 |
594 | 2
595 |
596 | name
597 | keyword.operator.scala
598 |
599 | 3
600 |
601 | name
602 | variable.other.import.renamed-to.scala
603 |
604 |
605 | match
606 | (?x) \s*
607 | ([^\s.,}]+) \s*
608 | (=>) \s*
609 | ([^\s.,}]+) \s*
610 |
611 |
612 |
613 | match
614 | ([^\s.,}]+)
615 | name
616 | variable.other.import.scala
617 |
618 |
619 |
620 |
621 |
622 | inheritance
623 |
624 | patterns
625 |
626 |
627 | captures
628 |
629 | 1
630 |
631 | name
632 | storage.modifier.extends.scala
633 |
634 | 2
635 |
636 | name
637 | entity.other.inherited-class.scala
638 |
639 |
640 | match
641 | (extends|with)\s+([^\s\{\(\[\]]+)
642 |
643 |
644 |
645 | initialization
646 |
647 | captures
648 |
649 | 1
650 |
651 | name
652 | keyword.control.directive.scala
653 |
654 | 2
655 |
656 | name
657 | entity.name.type.class.scala
658 |
659 |
660 | match
661 | \b(new)\s+([^\s\{\(\[]+)
662 |
663 | keywords
664 |
665 | patterns
666 |
667 |
668 | match
669 | \b(return|throw)\b
670 | name
671 | keyword.control.flow.jump.scala
672 |
673 |
674 | match
675 | \b(classOf|isInstanceOf|asInstanceOf)\b
676 | name
677 | support.function.type-of.scala
678 |
679 |
680 | match
681 | \b(else|if|do|while|for|yield|match|case)\b
682 | name
683 | keyword.control.flow.scala
684 |
685 |
686 | match
687 | \b(catch|finally|try)\b
688 | name
689 | keyword.control.exception.scala
690 |
691 |
692 | match
693 | (==?|!=|<=|>=|<>|<|>)
694 | name
695 | keyword.operator.comparison.scala
696 |
697 |
698 | match
699 | (\-|\+|\*|/(?![/*])|%|~)
700 | name
701 | keyword.operator.arithmetic.scala
702 |
703 |
704 | match
705 | (!|&&|\|\|)
706 | name
707 | keyword.operator.logical.scala
708 |
709 |
710 | match
711 | (<-|←|->|→|=>|⇒|\?|\:+|@|\|)+
712 | name
713 | keyword.operator.scala
714 |
715 |
716 |
717 | meta-bounds
718 |
719 | comment
720 | For themes: Matching view bounds
721 | match
722 | <%|=:=|<:<|<%<|>:|<:
723 | name
724 | meta.bounds.scala
725 |
726 | meta-brackets
727 |
728 | comment
729 | For themes: Brackets look nice when colored.
730 | patterns
731 |
732 |
733 | match
734 | {|}|\(|\)|\[|\]
735 | name
736 | meta.bracket.scala
737 |
738 |
739 |
740 | meta-colons
741 |
742 | comment
743 | For themes: Matching type colons
744 | patterns
745 |
746 |
747 | match
748 | (?<!:):(?!:)
749 | name
750 | meta.colon.scala
751 |
752 |
753 |
754 | parameter-list
755 |
756 | patterns
757 |
758 |
759 | captures
760 |
761 | 1
762 |
763 | name
764 | variable.parameter.scala
765 |
766 | 2
767 |
768 | name
769 | meta.colon.scala
770 |
771 |
772 | comment
773 | We do not match param names that start with a Capitol letter
774 | match
775 | (?<=[^\._$a-zA-Z0-9])(`[^`]+`|[_$a-z][_$a-zA-Z0-9]*(?:_[^\s])(?=[\t ])|[_$a-z][_$a-zA-Z0-9]*|[-?~><^+*%:!#|/@\\]+)\s*(:)\s+
776 |
777 |
778 |
779 | qualifiedClassName
780 |
781 | captures
782 |
783 | 1
784 |
785 | name
786 | entity.name.type.class.scala
787 |
788 |
789 | match
790 | (\b([A-Z][\w]*))
791 |
792 | scala-symbol
793 |
794 | match
795 | ('\w+(?=[^'\w])|'[-?~><^+*%:!#|/@\\]+(?=[-?~><^+*%:!#|/@\\]))
796 | name
797 | entity.name.type.symbol.scala
798 |
799 | storage-modifiers
800 |
801 | patterns
802 |
803 |
804 | match
805 | \b(private\[\S+\]|protected\[\S+\]|private|protected)\b
806 | name
807 | storage.modifier.access.scala
808 |
809 |
810 | match
811 | \b(synchronized|@volatile|abstract|final|lazy|sealed|implicit|override|@transient|@native)\b
812 | name
813 | storage.modifier.other.scala
814 |
815 |
816 |
817 | strings
818 |
819 | patterns
820 |
821 |
822 | begin
823 | """
824 | beginCaptures
825 |
826 | 0
827 |
828 | name
829 | punctuation.definition.string.begin.scala
830 |
831 |
832 | end
833 | """(?!")
834 | endCaptures
835 |
836 | 0
837 |
838 | name
839 | punctuation.definition.string.end.scala
840 |
841 |
842 | name
843 | string.quoted.triple.scala
844 | patterns
845 |
846 |
847 | match
848 | \\\\|\\u[0-9A-Fa-f]{4}
849 | name
850 | constant.character.escape.scala
851 |
852 |
853 |
854 |
855 | begin
856 | "
857 | beginCaptures
858 |
859 | 0
860 |
861 | name
862 | punctuation.definition.string.begin.scala
863 |
864 |
865 | end
866 | "
867 | endCaptures
868 |
869 | 0
870 |
871 | name
872 | punctuation.definition.string.end.scala
873 |
874 |
875 | name
876 | string.quoted.double.scala
877 | patterns
878 |
879 |
880 | match
881 | \\(?:[btnfr\\"']|[0-7]{1,3}|u[0-9A-Fa-f]{4})
882 | name
883 | constant.character.escape.scala
884 |
885 |
886 | match
887 | \\.
888 | name
889 | invalid.illegal.unrecognized-string-escape.scala
890 |
891 |
892 |
893 |
894 |
895 | xml-doublequotedString
896 |
897 | begin
898 | "
899 | beginCaptures
900 |
901 | 0
902 |
903 | name
904 | punctuation.definition.string.begin.xml
905 |
906 |
907 | end
908 | "
909 | endCaptures
910 |
911 | 0
912 |
913 | name
914 | punctuation.definition.string.end.xml
915 |
916 |
917 | name
918 | string.quoted.double.xml
919 | patterns
920 |
921 |
922 | include
923 | #xml-entity
924 |
925 |
926 |
927 | xml-embedded-content
928 |
929 | patterns
930 |
931 |
932 | begin
933 | {
934 | captures
935 |
936 | 0
937 |
938 | name
939 | meta.bracket.scala
940 |
941 |
942 | end
943 | }
944 | name
945 | meta.source.embedded.scala
946 | patterns
947 |
948 |
949 | include
950 | #code
951 |
952 |
953 |
954 |
955 | captures
956 |
957 | 1
958 |
959 | name
960 | entity.other.attribute-name.namespace.xml
961 |
962 | 2
963 |
964 | name
965 | entity.other.attribute-name.xml
966 |
967 | 3
968 |
969 | name
970 | punctuation.separator.namespace.xml
971 |
972 | 4
973 |
974 | name
975 | entity.other.attribute-name.localname.xml
976 |
977 |
978 | match
979 | (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)=
980 |
981 |
982 | include
983 | #xml-doublequotedString
984 |
985 |
986 | include
987 | #xml-singlequotedString
988 |
989 |
990 |
991 | xml-entity
992 |
993 | captures
994 |
995 | 1
996 |
997 | name
998 | punctuation.definition.constant.xml
999 |
1000 | 3
1001 |
1002 | name
1003 | punctuation.definition.constant.xml
1004 |
1005 |
1006 | match
1007 | (&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)
1008 | name
1009 | constant.character.entity.xml
1010 |
1011 | xml-literal
1012 |
1013 | patterns
1014 |
1015 |
1016 | begin
1017 | (<)((?:([_a-zA-Z0-9][_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*))(?=(\s[^>]*)?></\2>)
1018 | beginCaptures
1019 |
1020 | 1
1021 |
1022 | name
1023 | punctuation.definition.tag.xml
1024 |
1025 | 3
1026 |
1027 | name
1028 | entity.name.tag.namespace.xml
1029 |
1030 | 4
1031 |
1032 | name
1033 | entity.name.tag.xml
1034 |
1035 | 5
1036 |
1037 | name
1038 | punctuation.separator.namespace.xml
1039 |
1040 | 6
1041 |
1042 | name
1043 | entity.name.tag.localname.xml
1044 |
1045 |
1046 | comment
1047 | We do not allow a tag name to start with a - since this would
1048 | likely conflict with the <- operator. This is not very common
1049 | for tag names anyway. Also code such as -- if (val <val2 || val> val3)
1050 | will falsly be recognized as an xml tag. The solution is to put a
1051 | space on either side of the comparison operator
1052 | end
1053 | (>(<))/(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]*[_a-zA-Z0-9])(>)
1054 | endCaptures
1055 |
1056 | 1
1057 |
1058 | name
1059 | punctuation.definition.tag.xml
1060 |
1061 | 2
1062 |
1063 | name
1064 | meta.scope.between-tag-pair.xml
1065 |
1066 | 3
1067 |
1068 | name
1069 | entity.name.tag.namespace.xml
1070 |
1071 | 4
1072 |
1073 | name
1074 | entity.name.tag.xml
1075 |
1076 | 5
1077 |
1078 | name
1079 | punctuation.separator.namespace.xml
1080 |
1081 | 6
1082 |
1083 | name
1084 | entity.name.tag.localname.xml
1085 |
1086 | 7
1087 |
1088 | name
1089 | punctuation.definition.tag.xml
1090 |
1091 |
1092 | name
1093 | meta.tag.no-content.xml
1094 | patterns
1095 |
1096 |
1097 | include
1098 | #xml-embedded-content
1099 |
1100 |
1101 |
1102 |
1103 | begin
1104 | (</?)(?:([_a-zA-Z0-9][-_a-zA-Z0-9]*)((:)))?([_a-zA-Z0-9][-_a-zA-Z0-9:]*)(?=[^>]*?>)
1105 | captures
1106 |
1107 | 1
1108 |
1109 | name
1110 | punctuation.definition.tag.xml
1111 |
1112 | 2
1113 |
1114 | name
1115 | entity.name.tag.namespace.xml
1116 |
1117 | 3
1118 |
1119 | name
1120 | entity.name.tag.xml
1121 |
1122 | 4
1123 |
1124 | name
1125 | punctuation.separator.namespace.xml
1126 |
1127 | 5
1128 |
1129 | name
1130 | entity.name.tag.localname.xml
1131 |
1132 |
1133 | end
1134 | (/?>)
1135 | name
1136 | meta.tag.xml
1137 | patterns
1138 |
1139 |
1140 | include
1141 | #xml-embedded-content
1142 |
1143 |
1144 |
1145 |
1146 | include
1147 | #xml-entity
1148 |
1149 |
1150 |
1151 | xml-singlequotedString
1152 |
1153 | begin
1154 | '
1155 | beginCaptures
1156 |
1157 | 0
1158 |
1159 | name
1160 | punctuation.definition.string.begin.xml
1161 |
1162 |
1163 | end
1164 | '
1165 | endCaptures
1166 |
1167 | 0
1168 |
1169 | name
1170 | punctuation.definition.string.end.xml
1171 |
1172 |
1173 | name
1174 | string.quoted.single.xml
1175 | patterns
1176 |
1177 |
1178 | include
1179 | #xml-entity
1180 |
1181 |
1182 |
1183 |
1184 | scopeName
1185 | source.scala
1186 | uuid
1187 | 158C0929-299A-40C8-8D89-316BE0C446E8
1188 |
1189 |
1190 |
--------------------------------------------------------------------------------
/Syntaxes/Simple Build Tool.tmLanguage:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | fileTypes
6 |
7 | sbt
8 |
9 | foldingStartMarker
10 | /\*\*|\{\s*$
11 | foldingStopMarker
12 | \*\*/|^\s*\}
13 | keyEquivalent
14 | ^~S
15 | name
16 | Simple Build Tool
17 | patterns
18 |
19 |
20 | captures
21 |
22 | 1
23 |
24 | name
25 | constant.other.setting.sbt
26 |
27 |
28 | match
29 | (\w*)\s+(?=.*=)
30 |
31 |
32 | match
33 | \b(at)\b
34 | name
35 | keyword.control.directive.sbt
36 |
37 |
38 | begin
39 | "
40 | beginCaptures
41 |
42 | 1
43 |
44 | name
45 | punctuation.definition.string.begin.sbt
46 |
47 |
48 | end
49 | "
50 | endCaptures
51 |
52 | 1
53 |
54 | name
55 | punctuation.definition.string.end.sbt
56 |
57 |
58 | name
59 | string.quoted.double.sbt
60 | patterns
61 |
62 |
63 | match
64 | \\.
65 | name
66 | constant.character.escape.sbt
67 |
68 |
69 |
70 |
71 | scopeName
72 | source.sbt
73 | uuid
74 | 4A4E6D54-9232-4F33-9E4F-777A56075844
75 |
76 |
77 |
--------------------------------------------------------------------------------
/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | contactEmailRot13
6 | mads379@gmail.com
7 | contactName
8 | Mads Hartmann
9 | mainMenu
10 |
11 | items
12 |
13 | DDFBBCF9-D333-4077-8D4F-EF6F2CA62220
14 | 8C82E10C-A830-4647-B98F-957018D47C9C
15 | ------------------------------------
16 | BCAA9E11-45C8-43C7-8B43-E680AD7F6165
17 | 45A658D8-D64D-4810-B7DD-762AC3EFD8CF
18 | 7F176B4F-5D0E-459A-8042-A459B41051A8
19 | ------------------------------------
20 | 111C9EA6-0DB7-4628-B36B-43EE492435FC
21 | CA13E220-F557-4681-971E-C3D3D4A36CF8
22 | D603466C-6006-4708-9E15-1475E194CCD3
23 | C894B1A9-A166-492E-909A-E35BC839FBEF
24 | 2788959A-AD07-4AF3-9D6F-E4B034FCCDEB
25 |
26 | submenus
27 |
28 | 111C9EA6-0DB7-4628-B36B-43EE492435FC
29 |
30 | items
31 |
32 | EEB7E161-EF45-410A-91CD-7C74F94449A4
33 | 909A1E64-9672-4FC1-87B3-608A57257E5D
34 | CEAD5E83-C0D9-4D3D-9E73-C37634DD410D
35 | 7BE0DE43-86F5-48C6-A8DF-A7AC891A68EE
36 | FFD2A2D6-000C-4AD6-BA36-A1ACD05A392B
37 | 1D85F938-738B-42DD-9206-A4D250B744DD
38 |
39 | name
40 | Shortcuts
41 |
42 | 2788959A-AD07-4AF3-9D6F-E4B034FCCDEB
43 |
44 | items
45 |
46 | DE4A0166-0F2A-4A2E-B86C-A42520C94722
47 | F5E08907-DD4F-4FD2-8777-23C96D4BF738
48 | FE33460A-1416-47B5-A76B-75BBFA2398F8
49 | 04D3E42F-4497-4D65-AE50-E7F261D25158
50 | 8DD4BB8E-C09D-4BC2-90F6-B4248892F325
51 | E3CAD7C5-59B2-4CD2-9D9F-5D225998E2ED
52 | 92B4042E-2409-466F-A0B6-80A46B36679F
53 | 53B78E1D-F3C2-49C6-89D3-6BE30961C14D
54 | 20512DA9-649C-420F-A0E1-F7DD04A349EE
55 | C32C1AFB-F874-454E-8C82-86832CA296FD
56 | 701CC71E-0CB8-4C5C-922B-F363193B4AAF
57 | F56949E3-B311-4BD8-898C-7316E4134785
58 | 2F43ADBA-E02A-4712-8870-0774BAE5CC9F
59 |
60 | name
61 | Other
62 |
63 | C894B1A9-A166-492E-909A-E35BC839FBEF
64 |
65 | items
66 |
67 | F38BFF4F-BE1D-4CE2-8BE8-8BEDF5EB7277
68 | CF8424AF-D081-49BF-A535-FAF593584F86
69 |
70 | name
71 | Directives
72 |
73 | CA13E220-F557-4681-971E-C3D3D4A36CF8
74 |
75 | items
76 |
77 | 9D749173-9874-4BEC-80A1-BAE8AF266AD9
78 | ADF7CCBE-80DD-488E-A2A9-B3B8B582F69F
79 | E0E52BED-94DD-4D9F-8ED5-BEE344AB3FDC
80 | 6851152B-CD07-4E27-9932-631A86102B5C
81 |
82 | name
83 | Control
84 |
85 | D603466C-6006-4708-9E15-1475E194CCD3
86 |
87 | items
88 |
89 | 493A836C-428D-4CA5-9E29-E2C927C8B642
90 | CC643A92-5A38-4998-AB95-041EAF15ECF9
91 | E79DCC79-E834-4B6C-8280-EBE0B9A0A41F
92 | 0097F60C-0AAC-4CC0-8815-C6BA0E77606F
93 | 6CCA6D38-8C03-4D29-97BD-45CED52713FB
94 | D03DC03A-8622-4F4F-BDAC-3AD1E8D51705
95 | 97CB4393-6DCC-45B4-8830-61D6B5D036B2
96 | 853C1915-7B23-4C79-AAAA-AEDFB21CA08C
97 | 11D5086B-FD25-4B33-92E3-4DEADCF4119D
98 | BAD79DCF-1B14-42CE-BE6E-7EE5A56190B3
99 | 833B549D-AA46-4BC9-AC05-CBF4CD1DA723
100 | 56D7D5D4-355C-4BAA-8F38-DA5A5FCA33C8
101 |
102 | name
103 | Constructs
104 |
105 |
106 |
107 | name
108 | Scala
109 | uuid
110 | 452017E8-0065-49EF-AB9D-7849B27D9367
111 |
112 |
113 |
--------------------------------------------------------------------------------