From d482d890a19dd5209d878dcb7233d8118a8a6c78 Mon Sep 17 00:00:00 2001 From: Luke Daley Date: Fri, 18 Nov 2011 11:22:23 +0000 Subject: [PATCH 01/42] Improved import scoping --- Syntaxes/Java.plist | 82 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 76 insertions(+), 6 deletions(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index e89dfa4..a836ce1 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -42,13 +42,23 @@ meta.package.java - captures + begin + (import static)\b\s* + beginCaptures 1 name keyword.other.import.static.java + + captures + + 1 + + name + keyword.other.import.java + 2 name @@ -60,12 +70,47 @@ punctuation.terminator.java - match - ^\s*(import static)\b(?:\s*([^ ;$]+)\s*(;)?)? + contentName + storage.modifier.import.java + end + \s*(?:$|(;)) + endCaptures + + 1 + + name + punctuation.terminator.java + + name - meta.import.static.java + meta.import.java + patterns + + + match + \. + name + punctuation.separator.java + + + match + \s + name + invalid.illegal.character_not_allowed_here.java + + + begin + (import)\b\s* + beginCaptures + + 1 + + name + keyword.other.import.java + + captures 1 @@ -84,10 +129,35 @@ punctuation.terminator.java - match - ^\s*(import)\b(?:\s*([^ ;$]+)\s*(;)?)? + contentName + storage.modifier.import.java + end + \s*(?:$|(;)) + endCaptures + + 1 + + name + punctuation.terminator.java + + name meta.import.java + patterns + + + match + \. + name + punctuation.separator.java + + + match + \s + name + invalid.illegal.character_not_allowed_here.java + + include From e8399071d06424264c3d316ecc9445e6090abec7 Mon Sep 17 00:00:00 2001 From: Luke Daley Date: Fri, 18 Nov 2011 11:23:34 +0000 Subject: [PATCH 02/42] Improved package command --- Commands/Create Package Declaration.tmCommand | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Commands/Create Package Declaration.tmCommand b/Commands/Create Package Declaration.tmCommand index dc9a7b6..90f58f0 100644 --- a/Commands/Create Package Declaration.tmCommand +++ b/Commands/Create Package Declaration.tmCommand @@ -12,13 +12,15 @@ # a value of the regex to use to match folder names. # +require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' + package = [] package_regex = /$(src|tst)$/ # common source folder names package_regex = /^(#{ENV['TM_JAVA_SOURCE_FOLDER_REGEX']})$/ if ENV['TM_JAVA_SOURCE_FOLDER_REGEX'] - -Dir.getwd.split(File::SEPARATOR).reverse.each do |folder| +dir = ENV['TM_DIRECTORY'] || Dir.getwd +dir.split(File::SEPARATOR).reverse.each do |folder| if folder !~ package_regex - package << folder + package &lt;&lt; folder else break end @@ -29,15 +31,23 @@ if !package.empty? end input none + inputFormat + text name Create Package Declaration - output - afterSelectedText + outputCaret + afterOutput + outputFormat + text + outputLocation + atCaret scope source.java tabTrigger pa uuid CBFE854E-917E-4ED5-BDBC-950C6B25B816 + version + 2 From a645180144352db23645086232a5874bfa34d3f6 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Tue, 22 Nov 2011 02:43:40 -0600 Subject: [PATCH 03/42] Add readme. --- README.mdown | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 README.mdown diff --git a/README.mdown b/README.mdown new file mode 100644 index 0000000..32d8f85 --- /dev/null +++ b/README.mdown @@ -0,0 +1,20 @@ +# Installation + +You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. + +# General + +* [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_ +* [Commit Styleguide](http://kb.textmate.org/commit_styleguide) — _before you send a pull request_ +* [Writing Bug Reports](http://kb.textmate.org/writing_bug_reports) — _before you report an issue_ + +# License + +If not otherwise specified (see below), files in this repository fall under the following license: + + Permission to copy, use, modify, sell and distribute this + software is granted. This software is provided "as is" without + express or implied warranty, and with no claim as to its + suitability for any purpose. + +An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”. \ No newline at end of file From 98dd4ae5418908c591ebde88db6b5579cd421969 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Tue, 22 Nov 2011 02:44:46 -0600 Subject: [PATCH 04/42] Move folding settings. --- Preferences/Folding - JSP.tmPreferences | 19 +++++++++++++++++++ Preferences/Folding - JUnit.tmPreferences | 19 +++++++++++++++++++ Preferences/Folding - Java.tmPreferences | 19 +++++++++++++++++++ Syntaxes/JUnit Test Report.tmLanguage | 4 ---- Syntaxes/Java Server Pages (JSP).tmLanguage | 4 ---- Syntaxes/Java.plist | 4 ---- 6 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 Preferences/Folding - JSP.tmPreferences create mode 100644 Preferences/Folding - JUnit.tmPreferences create mode 100644 Preferences/Folding - Java.tmPreferences diff --git a/Preferences/Folding - JSP.tmPreferences b/Preferences/Folding - JSP.tmPreferences new file mode 100644 index 0000000..9e73e3a --- /dev/null +++ b/Preferences/Folding - JSP.tmPreferences @@ -0,0 +1,19 @@ + + + + + name + Folding (JSP) + scope + text.html.jsp + settings + + foldingStartMarker + /\*\*|\{\s*$ + foldingStopMarker + \*\*/|^\s*\} + + uuid + 2C5379EE-F0E8-410F-8E5F-362D5A85FDEE + + diff --git a/Preferences/Folding - JUnit.tmPreferences b/Preferences/Folding - JUnit.tmPreferences new file mode 100644 index 0000000..3719582 --- /dev/null +++ b/Preferences/Folding - JUnit.tmPreferences @@ -0,0 +1,19 @@ + + + + + name + Folding (JUnit) + scope + text.junit-test-report + settings + + foldingStartMarker + (\{\s*(//.*)?$|^\s*// \{\{\{) + foldingStopMarker + ^\s*(\}|// \}\}\}$) + + uuid + D542DC17-5A9E-4DDF-B825-EC5C04F847B4 + + diff --git a/Preferences/Folding - Java.tmPreferences b/Preferences/Folding - Java.tmPreferences new file mode 100644 index 0000000..11542a5 --- /dev/null +++ b/Preferences/Folding - Java.tmPreferences @@ -0,0 +1,19 @@ + + + + + name + Folding (Java) + scope + source.java + settings + + foldingStartMarker + (\{\s*(//.*)?$|^\s*// \{\{\{) + foldingStopMarker + ^\s*(\}|// \}\}\}$) + + uuid + 6DF65B4B-D1A2-4B9C-9821-8B81EC3DA8FA + + diff --git a/Syntaxes/JUnit Test Report.tmLanguage b/Syntaxes/JUnit Test Report.tmLanguage index 913e556..132a52e 100644 --- a/Syntaxes/JUnit Test Report.tmLanguage +++ b/Syntaxes/JUnit Test Report.tmLanguage @@ -4,10 +4,6 @@ firstLineMatch ^Testsuite: - foldingStartMarker - Testcase: - foldingStopMarker - (?=Testcase:) keyEquivalent ^~J name diff --git a/Syntaxes/Java Server Pages (JSP).tmLanguage b/Syntaxes/Java Server Pages (JSP).tmLanguage index b829659..6085886 100644 --- a/Syntaxes/Java Server Pages (JSP).tmLanguage +++ b/Syntaxes/Java Server Pages (JSP).tmLanguage @@ -6,10 +6,6 @@ jsp - foldingStartMarker - /\*\*|\{\s*$ - foldingStopMarker - \*\*/|^\s*\} keyEquivalent ^~J name diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index a836ce1..f49512e 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -7,10 +7,6 @@ java bsh - foldingStartMarker - (\{\s*(//.*)?$|^\s*// \{\{\{) - foldingStopMarker - ^\s*(\}|// \}\}\}$) keyEquivalent ^~J name From d0b93824694d82399bfc8ea6a4ad843c28911823 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Wed, 23 Nov 2011 03:25:44 -0600 Subject: [PATCH 05/42] Revamp grammar. --- Syntaxes/Java Server Pages (JSP).tmLanguage | 1854 ++++++++++++++++++- 1 file changed, 1757 insertions(+), 97 deletions(-) diff --git a/Syntaxes/Java Server Pages (JSP).tmLanguage b/Syntaxes/Java Server Pages (JSP).tmLanguage index 6085886..62f818d 100644 --- a/Syntaxes/Java Server Pages (JSP).tmLanguage +++ b/Syntaxes/Java Server Pages (JSP).tmLanguage @@ -6,12 +6,86 @@ jsp + injections + + text.html.jsp - (meta.embedded.block.jsp | meta.embedded.line.jsp | meta.tag | comment), meta.tag string.quoted + + patterns + + + include + #comment + + + include + #declaration + + + include + #expression + + + include + #el_expression + + + include + #tags + + + begin + (^\s*)(?=<%(?=\s)) + beginCaptures + + 0 + + name + punctuation.whitespace.embedded.leading.erb + + + end + (?!\G)(\s*$\n)? + endCaptures + + 0 + + name + punctuation.whitespace.embedded.trailing.erb + + + patterns + + + include + #scriptlet + + + + + include + #scriptlet + + + + keyEquivalent ^~J name - Java Server Page (JSP) + JavaServer Pages patterns + + include + #xml_tags + + + include + text.html.basic + + + repository + + comment begin <%-- @@ -28,222 +102,1808 @@ name comment.block.jsp + declaration begin - <%@ - captures + <%! + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.jsp + + + contentName + source.java + end + (%)> + endCaptures + + 0 + + name + punctuation.section.embedded.end.jsp + + 1 + + name + source.java + + + name + meta.embedded.line.declaration.jsp + patterns + + + include + source.java + + + + el_expression + + begin + \$\{ + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.jsp + + + contentName + source.java + end + (\}) + endCaptures + + 0 + + name + punctuation.section.embedded.end.jsp + + 1 + + name + source.java + + + name + meta.embedded.line.el_expression.jsp + patterns + + + include + source.java + + + + expression + + begin + <%= + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.jsp + + + contentName + source.java + end + (%)> + endCaptures + + 0 + + name + punctuation.section.embedded.end.jsp + + 1 + + name + source.java + + + name + meta.embedded.line.expression.jsp + patterns + + + include + source.java + + + + scriptlet + + begin + <% + beginCaptures + + 0 + + name + punctuation.section.embedded.begin.jsp + + + contentName + source.java + end + (%)> + endCaptures 0 name - punctuation.section.directive.jsp + punctuation.section.embedded.end.jsp + + 1 + + name + source.java + + + name + meta.embedded.block.scriptlet.jsp + patterns + + + match + \{ + name + punctuation.section.scope.begin.java + + + match + \} + name + punctuation.section.scope.end.java + + + include + source.java + + + + tags + + begin + (<%@)\s*(?=(attribute|include|page|tag|taglib|variable)\s) + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp end %> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + name - meta.directive.jsp + meta.tag.template.include.jsp patterns begin - \w+ - beginCaptures + \G(attribute)(?=\s) + captures - 0 + 1 + + name + keyword.control.attribute.jsp + + + end + (?=%>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (name|required|fragment|rtexprvalue|type|description)(=)((")[^"]*(")) + + + + + begin + \G(include)(?=\s) + captures + + 1 + + name + keyword.control.include.jsp + + + end + (?=%>) + patterns + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (file)(=)((")[^"]*(")) + + + + + begin + \G(page)(?=\s) + captures + + 1 + + name + keyword.control.page.jsp + + + end + (?=%>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (language|extends|import|session|buffer|autoFlush|isThreadSafe|info|errorPage|isErrorPage|contentType|pageEncoding|isElIgnored)(=)((")[^"]*(")) + + + + + begin + \G(tag)(?=\s) + captures + + 1 + + name + keyword.control.tag.jsp + + + end + (?=%>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (display-name|body-content|dynamic-attributes|small-icon|large-icon|description|example|language|import|pageEncoding|isELIgnored)(=)((")[^"]*(")) + + + + + begin + \G(taglib)(?=\s) + captures + + 1 + + name + keyword.control.taglib.jsp + + + end + (?=%>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (uri|tagdir|prefix)(=)((")[^"]*(")) + + + + + begin + \G(variable)(?=\s) + captures + + 1 + + name + keyword.control.variable.jsp + + + end + (?=%>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (name-given|alias|variable-class|declare|scope|description)(=)((")[^"]*(")) + + + + + + xml_tags + + patterns + + + begin + (^\s*)(?=<jsp:(declaration|expression|scriptlet)>) + beginCaptures + + 0 + + name + punctuation.whitespace.embedded.leading.erb + + + end + (?!\G)(\s*$\n)? + endCaptures + + 0 + + name + punctuation.whitespace.embedded.trailing.erb + + + patterns + + + include + #embedded + + + + + include + #embedded + + + include + #directive + + + include + #actions + + + repository + + actions + + patterns + + + begin + (</?)(jsp:attribute)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + > + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.attribute.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (name|trim)(=)((")[^"]*(")) + + + + + captures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + 3 + + name + punctuation.definition.tag.end.jsp + + + match + (</?)(jsp:body)(>) + name + meta.tag.template.body.jsp + + + begin + (</?)(jsp:element)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + > + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.element.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (name)(=)((")[^"]*(")) + + + + + begin + (<)(jsp:doBody)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + /> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.dobody.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (var|varReader|scope)(=)((")[^"]*(")) + + + + + begin + (</?)(jsp:forward)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + /?> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.forward.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (page)(=)((")[^"]*(")) + + + + + begin + (<)(jsp:param)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + /> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.param.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (name|value)(=)((")[^"]*(")) + + + + + begin + (<)(jsp:getProperty)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + /> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.getproperty.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (name|property)(=)((")[^"]*(")) + + + + + begin + (</?)(jsp:include)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + /?> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.include.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (page|flush)(=)((")[^"]*(")) + + + + + begin + (<)(jsp:invoke)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + /> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.invoke.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (fragment|var|varReader|scope)(=)((")[^"]*(")) + + + + + begin + (<)(jsp:output)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + /> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + + name + meta.tag.template.output.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (omit-xml-declaration|doctype-root-element|doctype-system|doctype-public)(=)((")[^"]*(")) + + + + + begin + (</?)(jsp:plugin)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + > + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + name - keyword.other.directive.jsp + meta.tag.template.plugin.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (type|code|codebase|name|archive|align|height|hspace|jreversion|nspluginurl|iepluginurl)(=)((")[^"]*(")) + + - - end - (?=%>) - patterns - + captures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + 3 + + name + punctuation.definition.tag.end.jsp + + + end + > match - \w+ + (</?)(jsp:fallback)(>) name - constant.other.directive.attribute.jsp + meta.tag.template.fallback.jsp - match - = + begin + (</?)(jsp:root)\b + beginCaptures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + + end + > + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + name - keyword.operator.assignment.jsp + meta.tag.template.root.jsp + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (xmlns|version|xmlns:taglibPrefix)(=)((")[^"]*(")) + + begin - " + (<)(jsp:setProperty)\b beginCaptures - 0 + 1 name - punctuation.definition.string.begin.jsp + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp end - " + /> endCaptures 0 name - punctuation.definition.string.end.jsp + punctuation.definition.tag.end.jsp name - string.quoted.double.jsp + meta.tag.template.setproperty.jsp patterns + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + match - \\. - name - constant.character.escape.jsp + (name|property|value)(=)((")[^"]*(")) + + captures + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + 3 + + name + punctuation.definition.tag.end.jsp + + + end + > + match + (</?)(jsp:text)(>) + name + meta.tag.template.text.jsp + begin - ' + (</?)(jsp:useBean)\b beginCaptures - 0 + 1 name - punctuation.definition.string.begin.jsp + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp end - ' + /?> endCaptures 0 name - punctuation.definition.string.end.jsp + punctuation.definition.tag.end.jsp name - string.quoted.single.jsp + meta.tag.template.usebean.jsp patterns + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + match - \\. - name - constant.character.escape.jsp + (id|scope|class|type|beanName)(=)((")[^"]*(")) - - - - begin - (<%[!=]?)|(<jsp:scriptlet>|<jsp:expression>|<jsp:declaration>) - beginCaptures - - 1 - - name - punctuation.section.embedded.jsp - - 2 - - name - meta.tag.block.jsp - - - end - (?<=</jsp:scriptlet>|</jsp:expression>|</jsp:declaration>|%>) - patterns - + directive - captures + begin + (<)(jsp:directive\.(?=(attribute|include|page|tag|variable)\s)) + beginCaptures 1 name - meta.tag.block.jsp + punctuation.definition.tag.begin.jsp 2 name - punctuation.section.embedded.jsp + entity.name.tag.jsp - match - (</jsp:scriptlet>|</jsp:expression>|</jsp:declaration>)|(%>) - - - begin - (?<!\n)(?!</jsp:scriptlet>|</jsp:expression>|</jsp:declaration>|%>|\{|\}) end - (?=</jsp:scriptlet>|</jsp:expression>|</jsp:declaration>|%>|\{|\})|\n + /> + endCaptures + + 0 + + name + punctuation.definition.tag.end.jsp + + name - source.java.embedded.html + meta.tag.template.$3.jsp patterns - include - source.java + begin + \G(attribute)(?=\s) + captures + + 1 + + name + entity.name.tag.jsp + + + end + (?=/>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (name|required|fragment|rtexprvalue|type|description)(=)((")[^"]*(")) + + - - - - begin - { - end - } - patterns - begin - (</jsp:scriptlet>|</jsp:expression>|</jsp:declaration>)|(%>) + \G(include)(?=\s) captures 1 name - meta.tag.block.jsp + entity.name.tag.jsp - 2 + + end + (?=/>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (file)(=)((")[^"]*(")) + + + + + begin + \G(page)(?=\s) + captures + + 1 name - punctuation.section.embedded.jsp + entity.name.tag.jsp end - (<jsp:scriptlet>|<jsp:expression>|<jsp:declaration>)|(<%[!=]?) + (?=/>) patterns - include - text.html.jsp + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (language|extends|import|session|buffer|autoFlush|isThreadSafe|info|errorPage|isErrorPage|contentType|pageEncoding|isElIgnored)(=)((")[^"]*(")) - include - source.java + begin + \G(tag)(?=\s) + captures + + 1 + + name + entity.name.tag.jsp + + + end + (?=/>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (display-name|body-content|dynamic-attributes|small-icon|large-icon|description|example|language|import|pageEncoding|isELIgnored)(=)((")[^"]*(")) + + + + + begin + \G(variable)(?=\s) + captures + + 1 + + name + entity.name.tag.jsp + + + end + (?=/>) + patterns + + + captures + + 1 + + name + entity.other.attribute-name.jsp + + 2 + + name + punctuation.separator.key-value.jsp + + 3 + + name + string.quoted.double.jsp + + 4 + + name + punctuation.definition.string.begin.jsp + + 5 + + name + punctuation.definition.string.end.jsp + + + match + (name-given|alias|variable-class|declare|scope|description)(=)((")[^"]*(")) + + + embedded - include + begin + (<)(jsp:(declaration|expression|scriptlet))(>) + beginCaptures + + 0 + + name + meta.tag.template.$3.jsp + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + entity.name.tag.jsp + + 4 + + name + punctuation.definition.tag.end.jsp + + + contentName source.java + end + ((<)/)(jsp:\3)(>) + endCaptures + + 0 + + name + meta.tag.template.$4.jsp + + 1 + + name + punctuation.definition.tag.begin.jsp + + 2 + + name + source.java + + 3 + + name + entity.name.tag.jsp + + 4 + + name + punctuation.definition.tag.end.jsp + + + name + meta.embedded.block.jsp + patterns + + + include + source.java + + - - - - include - text.html.basic + - + scopeName text.html.jsp uuid From 8a338bfc8cf277d6d9d1217bfbae6d92c071bb4b Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Wed, 15 Aug 2012 23:55:55 -0500 Subject: [PATCH 06/42] Improve comment.line match. --- Syntaxes/Java.plist | 30 +++++++--- Syntaxes/JavaProperties.plist | 107 +++++++++++++++++++++++++--------- 2 files changed, 102 insertions(+), 35 deletions(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index f49512e..3ae199c 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -662,21 +662,37 @@ comment.block.java - captures + begin + (^[ \t]+)?(?=//) + beginCaptures 1 name - comment.line.double-slash.java + punctuation.whitespace.comment.leading.java - 2 + + end + (?!\G) + patterns + + begin + // + beginCaptures + + 0 + + name + punctuation.definition.comment.java + + + end + \n name - punctuation.definition.comment.java + comment.line.double-slash.java - - match - \s*((//).*$\n?) + diff --git a/Syntaxes/JavaProperties.plist b/Syntaxes/JavaProperties.plist index cb333fc..88a5c61 100644 --- a/Syntaxes/JavaProperties.plist +++ b/Syntaxes/JavaProperties.plist @@ -2,10 +2,6 @@ - scopeName - source.java.properties - keyEquivalent - ^~J fileTypes properties @@ -16,31 +12,79 @@ foldingStopMarker ^(.*(?<!\) ) + keyEquivalent + ^~J name Java Properties patterns - name - comment.line.properties - match - ^(#.*)( -|$) - captures + begin + (^[ \t]+)?(?=#) + beginCaptures 1 name - comment.definition.comment.java-props + punctuation.whitespace.comment.leading.java-props + end + (?!\G) + patterns + + + begin + # + beginCaptures + + 0 + + name + punctuation.definition.comment.java-props + + + end + \n + name + comment.line.number-sign.java-props + + + + + begin + (^[ \t]+)?(?=!) + beginCaptures + + 1 + + name + punctuation.whitespace.comment.leading.java-props + + + end + (?!\G) + patterns + + + begin + ! + beginCaptures + + 0 + + name + punctuation.definition.comment.java-props + + + end + \n + name + comment.line.exclamation.java-props + + - name - kvp.singleline.properties - match - ^(?#KEY)(?:[ ])*([a-zA-Z][^<>/][a-zA-Z0-9-_.]*)(=)(?#VALUE)(.* -) captures 1 @@ -59,13 +103,13 @@ string.kvp.value.java.properties - - - name - kvp.dangling.space.between.key.and.equalsign.properties match - ^(?#KEY)(?:[ ])*([a-zA-Z][^<>/][a-zA-Z0-9-_.]*)([ ]+=)(?#VALUE)(.* + ^(?#KEY)(?:[ ])*([a-zA-Z][^<>/][a-zA-Z0-9-_.]*)(=)(?#VALUE)(.* ) + name + kvp.singleline.properties + + captures 1 @@ -84,15 +128,13 @@ invalid.deprecated.dangling.value.properties - - - name - kvp.multiline.properties match - ^((?:[ ])*[^#].*\ -|(?:[ ])*\ -|(?:[ ])*[^#](?<!=).* + ^(?#KEY)(?:[ ])*([a-zA-Z][^<>/][a-zA-Z0-9-_.]*)([ ]+=)(?#VALUE)(.* ) + name + kvp.dangling.space.between.key.and.equalsign.properties + + captures 1 @@ -101,8 +143,17 @@ string.kvp.multiline.properties + match + ^((?:[ ])*[^#].*\ +|(?:[ ])*\ +|(?:[ ])*[^#](?<!=).* +) + name + kvp.multiline.properties + scopeName + source.java.properties uuid D364E829-7643-4AFF-948D-3C0D6B4EA8A4 From 09aea0e0347a5b6d873038f9ae3810e05afbebe2 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Sat, 8 Sep 2012 01:52:30 -0500 Subject: [PATCH 07/42] Add initial semantic classes. --- Commands/Compile & Run (with args).tmCommand | 19 +++++++++++++++--- Commands/Compile & Run.tmCommand | 19 +++++++++++++++--- Commands/Documentation For Word.plist | 21 ++++++++++++++++---- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/Commands/Compile & Run (with args).tmCommand b/Commands/Compile & Run (with args).tmCommand index d56017d..1be61cb 100644 --- a/Commands/Compile & Run (with args).tmCommand +++ b/Commands/Compile & Run (with args).tmCommand @@ -5,18 +5,31 @@ beforeRunningCommand saveActiveFile command - TM_JAVAMATE_GET_ARGS=1 javamate_bootstrap.sh + #!/usr/bin/env bash +[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" + +TM_JAVAMATE_GET_ARGS=1 javamate_bootstrap.sh input document + inputFormat + text keyEquivalent ~@r name Compile & Run (with args) - output - showAsHTML + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow scope source.java + semanticClass + process.build-and-run.java uuid 4BC99514-9BF7-4F4F-BD84-7AD07EB81AC3 + version + 2 diff --git a/Commands/Compile & Run.tmCommand b/Commands/Compile & Run.tmCommand index d65e0a5..703c96f 100644 --- a/Commands/Compile & Run.tmCommand +++ b/Commands/Compile & Run.tmCommand @@ -5,18 +5,31 @@ beforeRunningCommand saveActiveFile command - javamate_bootstrap.sh + #!/usr/bin/env bash +[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" + +javamate_bootstrap.sh input document + inputFormat + text keyEquivalent @r name Compile & Run - output - showAsHTML + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow scope source.java + semanticClass + process.build-and-run.java uuid 752A2A98-EB02-4A4D-A3D4-522485DBF491 + version + 2 diff --git a/Commands/Documentation For Word.plist b/Commands/Documentation For Word.plist index 3058e1e..22eb65d 100644 --- a/Commands/Documentation For Word.plist +++ b/Commands/Documentation For Word.plist @@ -1,11 +1,14 @@ - + beforeRunningCommand nop command - echo "<!-- gotAPI.com search widget v2 begin --> + #!/usr/bin/env bash +[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" + +echo "<!-- gotAPI.com search widget v2 begin --> <body onload=\"init();\"> <DIV> <STYLE> @@ -37,15 +40,25 @@ then fi input none + inputFormat + text keyEquivalent ^h name Documentation For Word - output - showAsHTML + outputCaret + afterOutput + outputFormat + html + outputLocation + newWindow scope source.java + semanticClass + lookup.define.java uuid CE007C8C-9A0B-43B8-AEAF-45613BCD3DF7 + version + 2 From b6894ab2a66b3d781195a01b059e809fa7f06556 Mon Sep 17 00:00:00 2001 From: Jacob Swartwood Date: Thu, 3 May 2012 09:49:02 -0400 Subject: [PATCH 08/42] Adding support for .jspf and .tag files as JSP language files. --- Syntaxes/Java Server Pages (JSP).tmLanguage | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Syntaxes/Java Server Pages (JSP).tmLanguage b/Syntaxes/Java Server Pages (JSP).tmLanguage index 62f818d..19c41b1 100644 --- a/Syntaxes/Java Server Pages (JSP).tmLanguage +++ b/Syntaxes/Java Server Pages (JSP).tmLanguage @@ -5,6 +5,8 @@ fileTypes jsp + jspf + tag injections From bf14d2e9d480e9d596fee594e7e2d1ec3dd067ed Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Thu, 14 Feb 2013 21:06:25 +0100 Subject: [PATCH 09/42] Remove custom error formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is unnecessary as TextMate.executor already does this, and as the custom code was using Ruby’s Pathname class, anything that was matched as a file, but didn’t exist on disk, would cause an error. --- Support/bin/javamate.rb | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Support/bin/javamate.rb b/Support/bin/javamate.rb index dff0fe2..f385d2f 100755 --- a/Support/bin/javamate.rb +++ b/Support/bin/javamate.rb @@ -44,19 +44,4 @@ def self.set(key,value) #cmd << package if package ENV["TM_JAVA_PACKAGE"] = package -TextMate::Executor.run(cmd, :version_args => ["--version"], :script_args => script_args) do |line, type| - case type - when :err - line.chomp! - if line =~ /(.+\.java):(\d+):(.*)$/ - path = Pathname.new($1) - line_no = $2 - error = $3 - abs_path = Pathname.new(path.realpath) - line = "#{htmlize((path.to_s =~ /^\.\//) ? path : abs_path.relative_path_from(cwd))}:#{line_no}:#{htmlize(error)}"; - else - line = htmlize(line) - end - line = "#{line}
" - end -end \ No newline at end of file +TextMate::Executor.run(cmd, :version_args => ["--version"], :script_args => script_args) From 2632b233bc93258d91e9aec049be94fdf7fdc7a9 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Thu, 14 Feb 2013 21:33:17 +0100 Subject: [PATCH 10/42] =?UTF-8?q?Refactor=20runner=20code=20(=E2=8C=98R)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove intermediate shell script that checked if we had ‘java’ and ‘javac’. Dependencies on these are now declared in the bundle item’s property list. --- Commands/Compile & Run (with args).tmCommand | 30 +++++++++++++++++--- Commands/Compile & Run.tmCommand | 30 +++++++++++++++++--- Support/bin/java_compile_and_run.sh | 3 ++ Support/bin/javamate.rb | 3 +- Support/bin/javamate_bootstrap.sh | 12 -------- 5 files changed, 56 insertions(+), 22 deletions(-) delete mode 100755 Support/bin/javamate_bootstrap.sh diff --git a/Commands/Compile & Run (with args).tmCommand b/Commands/Compile & Run (with args).tmCommand index 1be61cb..a1457d1 100644 --- a/Commands/Compile & Run (with args).tmCommand +++ b/Commands/Compile & Run (with args).tmCommand @@ -5,10 +5,9 @@ beforeRunningCommand saveActiveFile command - #!/usr/bin/env bash -[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" - -TM_JAVAMATE_GET_ARGS=1 javamate_bootstrap.sh + #!/bin/sh +TM_JAVAMATE_GET_ARGS=1 "$TM_BUNDLE_SUPPORT/bin/javamate.rb" + input document inputFormat @@ -23,6 +22,29 @@ TM_JAVAMATE_GET_ARGS=1 javamate_bootstrap.sh html outputLocation newWindow + requiredCommands + + + command + java + locations + + /usr/bin/java + + variable + TM_JAVA + + + command + javac + locations + + /usr/bin/javac + + variable + TM_JAVAC + + scope source.java semanticClass diff --git a/Commands/Compile & Run.tmCommand b/Commands/Compile & Run.tmCommand index 703c96f..1c73468 100644 --- a/Commands/Compile & Run.tmCommand +++ b/Commands/Compile & Run.tmCommand @@ -5,10 +5,9 @@ beforeRunningCommand saveActiveFile command - #!/usr/bin/env bash -[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" - -javamate_bootstrap.sh + #!/bin/sh +"$TM_BUNDLE_SUPPORT/bin/javamate.rb" + input document inputFormat @@ -23,6 +22,29 @@ javamate_bootstrap.sh html outputLocation newWindow + requiredCommands + + + command + java + locations + + /usr/bin/java + + variable + TM_JAVA + + + command + javac + locations + + /usr/bin/javac + + variable + TM_JAVAC + + scope source.java semanticClass diff --git a/Support/bin/java_compile_and_run.sh b/Support/bin/java_compile_and_run.sh index 88dbf47..cf45caa 100755 --- a/Support/bin/java_compile_and_run.sh +++ b/Support/bin/java_compile_and_run.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +: ${TM_JAVA:=java} +: ${TM_JAVAC:=javac} + if [ "$1" = "--version" ] then "$TM_JAVA" -version 2>&1 | head -1 diff --git a/Support/bin/javamate.rb b/Support/bin/javamate.rb index f385d2f..454b0c6 100755 --- a/Support/bin/javamate.rb +++ b/Support/bin/javamate.rb @@ -17,10 +17,9 @@ def self.set(key,value) end end -TextMate.save_current_document TextMate::Executor.make_project_master_current_document -cmd = ["java_compile_and_run.sh"] +cmd = ["#{ENV['TM_BUNDLE_SUPPORT']}/bin/java_compile_and_run.sh"] cmd << ENV['TM_FILEPATH'] script_args = [] if ENV.include? 'TM_JAVAMATE_GET_ARGS' diff --git a/Support/bin/javamate_bootstrap.sh b/Support/bin/javamate_bootstrap.sh deleted file mode 100755 index ef1a41e..0000000 --- a/Support/bin/javamate_bootstrap.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -source "$TM_SUPPORT_PATH/lib/bash_init.sh" - -export TM_JAVA=${TM_JAVA:-java} -export TM_JAVAC=${TM_JAVAC:-javac} - -require_cmd "$TM_JAVA" "If you have installed java, then you need to either update your PATH or set the TM_JAVA shell variable (e.g. in Preferences / Advanced)" - -require_cmd "$TM_JAVAC" "If you have installed javac, then you need to either update your PATH or set the TM_JAVAC shell variable (e.g. in Preferences / Advanced)" - -javamate.rb \ No newline at end of file From d41b2517ee37356089fe9c16cfe8cf5776a7fab7 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Sat, 16 Feb 2013 11:29:28 +0100 Subject: [PATCH 11/42] Match empty braces as increasing indent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is required for TextMate’s auto-indent to behave correct, as when we press return after ‘if’ the indent is increased by one, i.e.: if(condition) ‸ If the user type a single ‘{’ with auto-pairing of braces we end up with: if(condition) {‸} Here we should match that construct as “increasing indent” so that it gets de-indented (cancels the indent from the ‘if’ above). Fixes #16. --- Preferences/Indentation Rules.tmPreferences | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Preferences/Indentation Rules.tmPreferences b/Preferences/Indentation Rules.tmPreferences index 05eb196..3bd52f2 100644 --- a/Preferences/Indentation Rules.tmPreferences +++ b/Preferences/Indentation Rules.tmPreferences @@ -1,5 +1,5 @@ - + name @@ -11,7 +11,7 @@ decreaseIndentPattern ^(.*\*/)?\s*\}([^}{"']*\{)?[;\s]*(//.*|/\*.*\*/\s*)?$|^\s*(public|private|protected):\s*$ increaseIndentPattern - ^.*\{[^}"']*$|^\s*(public|private|protected):\s*$ + ^.*\{(\}|[^}"']*)$|^\s*(public|private|protected):\s*$ indentNextLinePattern ^(?!(.*[};:])?\s*(//|/\*.*\*/\s*$)).*[^\s;:{}]\s*$ From 1f570d2d9f184a4592c44518ef2894d690b0ace1 Mon Sep 17 00:00:00 2001 From: Curt Sellmer Date: Fri, 15 Feb 2013 12:27:13 -0600 Subject: [PATCH 12/42] =?UTF-8?q?Change=20shortcut=20for=20'Organize=20Imp?= =?UTF-8?q?orts'=20to=20=E2=8C=83#?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original shortcut `⇧⌘O` conflicts with the shortcut for the 'Open Favorites' dialog. --- Commands/Organize Imports.tmCommand | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Commands/Organize Imports.tmCommand b/Commands/Organize Imports.tmCommand index 83a238b..6beec76 100644 --- a/Commands/Organize Imports.tmCommand +++ b/Commands/Organize Imports.tmCommand @@ -148,7 +148,7 @@ end input selection keyEquivalent - @O + ^# name Organize Imports output From 20ceff5be97e08c987fdb7541e7677322584480e Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Mon, 18 Feb 2013 04:51:52 -0600 Subject: [PATCH 13/42] Match comments in method definitions. Match comments that happen between the declaration and the opening of the braces. --- Syntaxes/Java.plist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 3ae199c..83e8610 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -1015,6 +1015,10 @@
+ + include + #comments + object-types From 39c2280e49ac768b809841d3bee8de2929f34fae Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Mon, 18 Feb 2013 04:52:00 -0600 Subject: [PATCH 14/42] Do not let () in a comment trigger a method declaration --- Syntaxes/Java.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 83e8610..72076e9 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -922,7 +922,7 @@ methods begin - (?!new)(?=[\w<].*\s+)(?=[^=]+\() + (?!new)(?=[\w<].*\s+)(?=([^=/]|/(?!/))+\() end }|(?=;) name From ea9f0e45722775d34b4346f9bb75f1475d14c902 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Wed, 20 Feb 2013 04:52:21 -0600 Subject: [PATCH 15/42] =?UTF-8?q?Add=20scoping=20to=20allow=20special=20tr?= =?UTF-8?q?eatment=20of=20=E2=86=A9=20to=20between=20{}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Syntaxes/Java.plist | 92 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 2 deletions(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 72076e9..c9d66c0 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -279,7 +279,15 @@ end - }|(?=\s*(?:,|;|\))) + (})|(?=\s*(?:,|;|\))) + endCaptures + + 1 + + name + punctuation.section.block.end.java + + patterns @@ -298,6 +306,14 @@ begin { + beginCaptures + + 0 + + name + punctuation.section.block.begin.java + + end (?=}) patterns @@ -347,8 +363,24 @@ begin { + beginCaptures + + 0 + + name + punctuation.section.inner-class.begin.java + + end } + endCaptures + + 0 + + name + punctuation.section.inner-class.end.java + + name meta.inner-class.java patterns @@ -498,6 +530,14 @@ begin { + beginCaptures + + 0 + + name + punctuation.section.class.begin.java + + end (?=}) name @@ -565,8 +605,24 @@ begin { + beginCaptures + + 0 + + name + punctuation.section.block.begin.java + + end } + endCaptures + + 0 + + name + punctuation.section.block.end.java + + patterns @@ -766,8 +822,24 @@ begin { + beginCaptures + + 0 + + name + punctuation.section.enum.begin.java + + end } + endCaptures + + 0 + + name + punctuation.section.enum.end.java + + patterns @@ -924,7 +996,15 @@ begin (?!new)(?=[\w<].*\s+)(?=([^=/]|/(?!/))+\() end - }|(?=;) + (})|(?=;) + endCaptures + + 1 + + name + punctuation.section.method.end.java + + name meta.method.java patterns @@ -1003,6 +1083,14 @@ begin { + beginCaptures + + 0 + + name + punctuation.section.method.begin.java + + end (?=}) name From 1c315ed46188e02d749939ec64160040d9c03f0b Mon Sep 17 00:00:00 2001 From: Brad Reynolds Date: Sat, 23 Feb 2013 18:20:53 -0800 Subject: [PATCH 16/42] Fixes to "Create Package Declaration". 1. Corrected escaping issue. 2. Fixed regex that determines the default directory to stop at (e.g. src, tst). --- Commands/Create Package Declaration.tmCommand | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Commands/Create Package Declaration.tmCommand b/Commands/Create Package Declaration.tmCommand index 90f58f0..ca7f2d8 100644 --- a/Commands/Create Package Declaration.tmCommand +++ b/Commands/Create Package Declaration.tmCommand @@ -15,12 +15,12 @@ require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' package = [] -package_regex = /$(src|tst)$/ # common source folder names +package_regex = /^(src|tst)$/ # common source folder names package_regex = /^(#{ENV['TM_JAVA_SOURCE_FOLDER_REGEX']})$/ if ENV['TM_JAVA_SOURCE_FOLDER_REGEX'] dir = ENV['TM_DIRECTORY'] || Dir.getwd dir.split(File::SEPARATOR).reverse.each do |folder| if folder !~ package_regex - package &lt;&lt; folder + package << folder else break end From 13dfe1344ca699ba2cca0baded8dae964d3866be Mon Sep 17 00:00:00 2001 From: Brad Reynolds Date: Sat, 16 Mar 2013 08:56:41 -0700 Subject: [PATCH 17/42] Organize Imports: Recognize Annotations as type definitions --- Commands/Organize Imports.tmCommand | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Commands/Organize Imports.tmCommand b/Commands/Organize Imports.tmCommand index 6beec76..0ff8b98 100644 --- a/Commands/Organize Imports.tmCommand +++ b/Commands/Organize Imports.tmCommand @@ -21,8 +21,6 @@ # # TODO add proper support for /* */ comments. Since these can be part of the line we can't ignore these lines -require 'pp' - before, imports, after, all = [], [], [], [] class_defined = false @@ -30,7 +28,7 @@ class_defined = false STDIN.each do |line| all << line - if line =~ / (class|interface) / && !(line =~ %r{^\s*(//|\*)}) + if line =~ / (class|(@)?interface) / && !(line =~ %r{^\s*(//|\*)}) class_defined = true after << line From 426204f45967c94732f7be418f80c7a957fe2286 Mon Sep 17 00:00:00 2001 From: Brad Reynolds Date: Sat, 16 Mar 2013 08:58:45 -0700 Subject: [PATCH 18/42] Organize Imports: Prevent error when importing java.util.* --- Commands/Organize Imports.tmCommand | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Commands/Organize Imports.tmCommand b/Commands/Organize Imports.tmCommand index 0ff8b98..c56cd54 100644 --- a/Commands/Organize Imports.tmCommand +++ b/Commands/Organize Imports.tmCommand @@ -70,10 +70,10 @@ after.each do |line| end # Based upon the classes found in the file determine the used imports -other_imports, static_imports, array = [], [], nil +non_static_imports, static_imports = [], [] classes.each_pair do |name, class_info| if class_info[:used] - other_imports << "import #{class_info[:package]}.#{name};" + non_static_imports << "import #{class_info[:package]}.#{name};" end end @@ -82,8 +82,7 @@ imports.each do |import| if import =~ /^import static/ static_imports << import elsif import =~ /\.\*\s*;/ - array = (import =~ / java[x]?\./) ? java_imports : other_imports - array << import + non_static_imports << import end end @@ -105,7 +104,7 @@ sort_order = [ [/^import java\./, 0], ] -sorted = other_imports.sort do |a, b| +sorted = non_static_imports.sort do |a, b| a_group, b_group = sort_order[0][1], sort_order[0][1] sort_order.each do |x| From 18a4bcd99b65956c879b64ab274ec606a2da266e Mon Sep 17 00:00:00 2001 From: Brad Reynolds Date: Sat, 16 Mar 2013 09:00:19 -0700 Subject: [PATCH 19/42] Organize Imports: Remove duplicates from static/nonstatic imports --- Commands/Organize Imports.tmCommand | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Commands/Organize Imports.tmCommand b/Commands/Organize Imports.tmCommand index c56cd54..bd04173 100644 --- a/Commands/Organize Imports.tmCommand +++ b/Commands/Organize Imports.tmCommand @@ -91,7 +91,7 @@ last_line_was_empty, import_lines = before.last.strip.empty?, [] unless static_imports.empty? import_lines << '' unless last_line_was_empty - import_lines.push(*static_imports) + import_lines.push(*static_imports.uniq) last_line_was_empty = false end @@ -104,7 +104,7 @@ sort_order = [ [/^import java\./, 0], ] -sorted = non_static_imports.sort do |a, b| +sorted = non_static_imports.uniq.sort do |a, b| a_group, b_group = sort_order[0][1], sort_order[0][1] sort_order.each do |x| From c4b3bc9eee205904c11c28d9e62aacc479bac456 Mon Sep 17 00:00:00 2001 From: Brad Reynolds Date: Sat, 16 Mar 2013 18:59:39 -0700 Subject: [PATCH 20/42] Copy Fully Qualified Class Name: Add enum support --- Commands/Copy Fully Qualified Class Name.tmCommand | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Commands/Copy Fully Qualified Class Name.tmCommand b/Commands/Copy Fully Qualified Class Name.tmCommand index 7d70418..90d18c6 100644 --- a/Commands/Copy Fully Qualified Class Name.tmCommand +++ b/Commands/Copy Fully Qualified Class Name.tmCommand @@ -14,7 +14,7 @@ package, class_name = nil, nil STDIN.each do |line| if line =~ /\s*package ([^;]+);/ package = $1 - elsif !(line =~ /^\s*\/\*/) && line =~ /\b(?:class|interface)\b ([A-Z][^ ]+) / + elsif !(line =~ /^\s*\/\*/) && line =~ /\b(?:class|interface|enum)\b ([A-Z][^ ]+) / class_name = $1 end From 2fda1cbf0be33c4bfcb7c9759d6e8430e3b3155b Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Mon, 18 Mar 2013 00:45:49 -0500 Subject: [PATCH 21/42] Cleanup menu layout --- Commands/Go To Stackframe Source.tmCommand | 2 +- info.plist | 85 ++-------------------- 2 files changed, 9 insertions(+), 78 deletions(-) diff --git a/Commands/Go To Stackframe Source.tmCommand b/Commands/Go To Stackframe Source.tmCommand index 1279167..f9a21a7 100644 --- a/Commands/Go To Stackframe Source.tmCommand +++ b/Commands/Go To Stackframe Source.tmCommand @@ -47,7 +47,7 @@ end keyEquivalent ^~@ name - Go to stackframe source + Go to Stackframe Source output showAsTooltip uuid diff --git a/info.plist b/info.plist index 8a738c6..5a4c36b 100644 --- a/info.plist +++ b/info.plist @@ -6,16 +6,6 @@ yq@yqnyrl.pbz contactName Luke Daley - deleted - - 923B569C-8B6A-49B6-AB91-3D35609F01E4 - FC40FDBA-EEB6-43FD-9D58-A1D0F116CEC1 - 2D3EC03E-6DFB-11D9-91EB-000D93589AF6 - 2D3EF41B-6DFB-11D9-91EB-000D93589AF6 - 3DF1A808-53F2-4F48-BD56-1F2D20A0BFE5 - CE7A14F3-025B-4334-8F40-881CF820A9EE - F2C18E05-A7E7-4898-8CB5-CC7E6020AAFE - description A bundle for the <a href="http://java.sun.com/">Java</a> programming language. mainMenu @@ -24,8 +14,10 @@ 752A2A98-EB02-4A4D-A3D4-522485DBF491 4BC99514-9BF7-4F4F-BD84-7AD07EB81AC3 + ------------------------------------ BED53D9E-7A4D-42A7-8A3F-E633973A6D14 E330E2EF-0057-4920-9364-01604C67E664 + 0642B880-F94F-4892-A761-AEF833C3B869 ------------------------------------ CE007C8C-9A0B-43B8-AEAF-45613BCD3DF7 ------------------------------------ @@ -57,6 +49,8 @@ items + CBFE854E-917E-4ED5-BDBC-950C6B25B816 + ------------------------------------ E9ED01EA-E83B-4322-BD9D-39C88FB8C237 B8E49466-FCBE-4053-AEC3-4ABBE0FF2FEF 16D51B5E-56BC-4ED0-84FB-FCC68479BE8E @@ -124,14 +118,16 @@ BC9380F7-43F1-4304-91CD-4C490B0A6037 8B84EAD3-F93D-407A-8BB1-4FEF8B0C71D7 ------------------------------------ - F0C15D98-790E-4755-A04E-B8903D50F5C6 + 7FB7C9A7-08BB-410F-B012-40D99ED8A60E CE3059F1-EBFE-426B-A98A-7D935580F915 + 2556E4C9-353C-4D34-A48D-7718A3739F40 + F0C15D98-790E-4755-A04E-B8903D50F5C6 + E0D61777-04FC-416F-82A7-7B54C446A00B ------------------------------------ 2D2F53B7-E41C-4AEE-8A5E-2A5BB7B42E65 7396532C-3567-4BDA-9C10-51454A2F2F6D E4DACBFB-F029-4EC3-BB0D-BEF0D5369DA7 F050CAEB-56AB-40A7-846B-E5DB70FA0A90 - ------------------------------------ name Control @@ -140,71 +136,6 @@ name Java - ordering - - 2B449DF6-6B1D-11D9-94EC-000D93589AF6 - D364E829-7643-4AFF-948D-3C0D6B4EA8A4 - ACB58B55-9437-4AE6-AF42-854995CF51DF - 752A2A98-EB02-4A4D-A3D4-522485DBF491 - 4BC99514-9BF7-4F4F-BD84-7AD07EB81AC3 - BED53D9E-7A4D-42A7-8A3F-E633973A6D14 - CBFE854E-917E-4ED5-BDBC-950C6B25B816 - CE007C8C-9A0B-43B8-AEAF-45613BCD3DF7 - E330E2EF-0057-4920-9364-01604C67E664 - BD7A6DBE-0180-4E1A-A428-14D44BD88F88 - 56C938B4-22B8-45F4-8E09-5BB4DE4633B0 - 8E765795-CC9D-46D7-8602-7E2DBB7026B2 - C0525A43-EEF4-4F59-AC09-84D263888433 - F53E8BF9-4911-4131-B31F-8B4DEE47E421 - E54D7A3C-107A-426E-91E8-D066A978BC5E - E9ED01EA-E83B-4322-BD9D-39C88FB8C237 - B8E49466-FCBE-4053-AEC3-4ABBE0FF2FEF - 16D51B5E-56BC-4ED0-84FB-FCC68479BE8E - 3621828B-39DB-4B56-8300-DD5C76333868 - 8CD02FE6-B5EE-4335-AFDF-7CC02C969563 - 4876099F-502E-471F-9D0D-916C7EF2E353 - BF745BD9-E345-4CFB-82B1-2CC2195BEFA8 - A30E90E6-FFBF-4899-AB97-7CAA00D0B824 - 476E26EB-5A53-45B3-A497-B22B12815C7F - 5A7786EE-5F23-422E-A6EC-69778ED7C8FC - 4C07C9CB-4306-417B-B152-653E93C987B5 - 755B1EB0-934C-49C6-AD08-B461C2205C46 - BC9380F7-43F1-4304-91CD-4C490B0A6037 - 8B84EAD3-F93D-407A-8BB1-4FEF8B0C71D7 - 2D2F53B7-E41C-4AEE-8A5E-2A5BB7B42E65 - 7396532C-3567-4BDA-9C10-51454A2F2F6D - E4DACBFB-F029-4EC3-BB0D-BEF0D5369DA7 - F050CAEB-56AB-40A7-846B-E5DB70FA0A90 - CE3059F1-EBFE-426B-A98A-7D935580F915 - 7FB7C9A7-08BB-410F-B012-40D99ED8A60E - 2556E4C9-353C-4D34-A48D-7718A3739F40 - F0C15D98-790E-4755-A04E-B8903D50F5C6 - E0D61777-04FC-416F-82A7-7B54C446A00B - 96251D07-2F30-4610-9F0F-65DE730CC0B5 - 097F4236-D7A4-412F-A078-11ABFCAFC7BA - D3D659F5-5318-4D0A-85E2-9A03902A1668 - 8B285F69-5A6A-46B4-BB31-B5F10DCB5719 - D8E7B79D-ADEC-437D-BFDE-F20D5362D892 - 97DC6637-998E-493C-9765-C8CFB29AC18C - 2887D1D3-A714-41B6-9211-4DEC12417889 - 5EEDE297-9489-41C8-A7AF-BDB5EABEF41F - 94C09B88-AC93-4045-86D1-206639D582D0 - 592F2823-7A2B-4881-99A4-7A18D3623902 - FBA964F9-EA31-44D1-A5FD-AE8AB3FF8954 - CD9D5650-7188-498F-9305-1BA9D8D8D27F - 20E93106-18CF-4BA3-9DA3-8F0C955DB774 - FA4CD3FA-A79B-43E3-A432-DA53DA4A060D - 11D7DA6F-1AE7-4BC7-BB5E-8DF05984FEEE - FD0CE2DC-6D44-4E22-B4E5-C47C57F5B677 - 22E489AE-989E-4A76-9C18-89944CF5013D - 7A55A2BC-CD9D-4EBF-ABF4-3401AA64B7B3 - C80430E0-F37F-448F-ACAE-D590C96C4EAD - 90A0278A-56B2-465B-B629-A01DF6524FEA - DFD7AE0D-D5CC-4FFF-B37D-EA7ACC8E34DF - 5F390B93-6A28-4EED-B04A-D213640B9DAF - 0642B880-F94F-4892-A761-AEF833C3B869 - 6F20804D-4BF2-42A7-BC64-A8CD83B7DE0F - uuid 4677FEB2-6227-11D9-BFB1-000D93589AF6 From 0aefa6f8436568739bdd4692af8b8e104afc8cca Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Sat, 27 Jul 2013 03:11:52 -0500 Subject: [PATCH 22/42] Use version 1.8 of ruby for bundle items 10.7 and 10.8 only include ruby 1.8, so all bundle items have been written to work with that. Optionally supporting ruby 1.9 and 2.0 is problematic as these versions are not fully backwards compatible. #ignore --- Commands/Copy Fully Qualified Class Name.tmCommand | 2 +- Commands/Create Package Declaration.tmCommand | 2 +- Commands/Go To Stackframe Source.tmCommand | 2 +- Commands/Organize Imports.tmCommand | 2 +- Support/bin/javamate.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Commands/Copy Fully Qualified Class Name.tmCommand b/Commands/Copy Fully Qualified Class Name.tmCommand index 90d18c6..a40cd51 100644 --- a/Commands/Copy Fully Qualified Class Name.tmCommand +++ b/Commands/Copy Fully Qualified Class Name.tmCommand @@ -5,7 +5,7 @@ beforeRunningCommand nop command - #!/usr/bin/env ruby -w + #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w # Copies the fully qualified class name to the paste/clip board. # Used to add the class as an import. # diff --git a/Commands/Create Package Declaration.tmCommand b/Commands/Create Package Declaration.tmCommand index ca7f2d8..16e19e7 100644 --- a/Commands/Create Package Declaration.tmCommand +++ b/Commands/Create Package Declaration.tmCommand @@ -5,7 +5,7 @@ beforeRunningCommand nop command - #!/usr/bin/env ruby -w + #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w # Generates a package statement based on conventions for the name of the source directory. # If the root source folder name isn't matched either log a bug to get it added to the # default list or define an environment variable named TM_JAVA_SOURCE_FOLDER_REGEX with diff --git a/Commands/Go To Stackframe Source.tmCommand b/Commands/Go To Stackframe Source.tmCommand index f9a21a7..6d6e817 100644 --- a/Commands/Go To Stackframe Source.tmCommand +++ b/Commands/Go To Stackframe Source.tmCommand @@ -5,7 +5,7 @@ beforeRunningCommand nop command - #!/usr/bin/env ruby + #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby require 'find' require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' diff --git a/Commands/Organize Imports.tmCommand b/Commands/Organize Imports.tmCommand index bd04173..571b9bb 100644 --- a/Commands/Organize Imports.tmCommand +++ b/Commands/Organize Imports.tmCommand @@ -5,7 +5,7 @@ beforeRunningCommand saveActiveFile command - #!/usr/bin/env ruby -w + #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w # # WARNING: This script modifies the source of your file!!! No one but # yourself is responsible for it losing code. diff --git a/Support/bin/javamate.rb b/Support/bin/javamate.rb index 454b0c6..608ec43 100755 --- a/Support/bin/javamate.rb +++ b/Support/bin/javamate.rb @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby +#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor" require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document" From eba30722e2d5959ff77d460d3c7728af5d3c364d Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Sun, 29 Sep 2013 03:22:32 -0500 Subject: [PATCH 23/42] Simplify decreaseIndentPattern rule Simple require a closing brace at the start of a line to decrease the indent level rather than checking the rest of the line. This improves behavior in if/else cases where braces, etc are placed after the closing brace. Fixes #24. --- Preferences/Indentation Rules.tmPreferences | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Preferences/Indentation Rules.tmPreferences b/Preferences/Indentation Rules.tmPreferences index 3bd52f2..6828d79 100644 --- a/Preferences/Indentation Rules.tmPreferences +++ b/Preferences/Indentation Rules.tmPreferences @@ -9,7 +9,7 @@ settings decreaseIndentPattern - ^(.*\*/)?\s*\}([^}{"']*\{)?[;\s]*(//.*|/\*.*\*/\s*)?$|^\s*(public|private|protected):\s*$ + ^(.*\*/)?\s*\}|^\s*(public|private|protected):\s*$ increaseIndentPattern ^.*\{(\}|[^}"']*)$|^\s*(public|private|protected):\s*$ indentNextLinePattern From 8c5fddedea76bf9d424b5a18217465ccd82c1753 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Sun, 29 Sep 2013 16:07:58 -0500 Subject: [PATCH 24/42] Rewrite grammar to better match spec This solves several issues with the previous grammar. Also change root scope to longer treat source.java as a parent grammar. Fixes #8 and #23. --- .../Java Properties Comments.tmPreferences | 4 +- Syntaxes/JavaProperties.plist | 99 ++++++++----------- 2 files changed, 43 insertions(+), 60 deletions(-) diff --git a/Preferences/Java Properties Comments.tmPreferences b/Preferences/Java Properties Comments.tmPreferences index 5d69ce7..43ac7d1 100644 --- a/Preferences/Java Properties Comments.tmPreferences +++ b/Preferences/Java Properties Comments.tmPreferences @@ -3,9 +3,9 @@ name - Java Properties Comments + Comments: Properties File scope - source.java-props + source.java-properties settings shellVariables diff --git a/Syntaxes/JavaProperties.plist b/Syntaxes/JavaProperties.plist index 88a5c61..b774343 100644 --- a/Syntaxes/JavaProperties.plist +++ b/Syntaxes/JavaProperties.plist @@ -26,7 +26,7 @@ 1 name - punctuation.whitespace.comment.leading.java-props + punctuation.whitespace.comment.leading.java-properties end @@ -41,13 +41,13 @@ 0 name - punctuation.definition.comment.java-props + punctuation.definition.comment.java-properties end \n name - comment.line.number-sign.java-props + comment.line.number-sign.java-properties @@ -59,7 +59,7 @@ 1 name - punctuation.whitespace.comment.leading.java-props + punctuation.whitespace.comment.leading.java-properties end @@ -74,86 +74,69 @@ 0 name - punctuation.definition.comment.java-props + punctuation.definition.comment.java-properties end \n name - comment.line.exclamation.java-props + comment.line.exclamation.java-properties - captures - - 1 - - name - markup.heading.kvp.key.java.properties - - 2 - - name - markup.deleted.kvp.key.java.properties - - 3 - - name - string.kvp.value.java.properties - - - match - ^(?#KEY)(?:[ ])*([a-zA-Z][^<>/][a-zA-Z0-9-_.]*)(=)(?#VALUE)(.* -) - name - kvp.singleline.properties - - - captures + begin + ^\s*(([\S&&[^:=\\]]|\\.)+)\s*([:=])? + beginCaptures 1 name - meta.line.error.logfile.dangling.key.properties - - 2 - - name - invalid.illegal.dangling.equalsign.properties + support.constant.java-properties + patterns + + + match + \\([tnfr"'\\ ]|u\h{4}) + name + constant.character.escape.java-properties + + 3 name - invalid.deprecated.dangling.value.properties + punctuation.separator.key-value.java-properties - match - ^(?#KEY)(?:[ ])*([a-zA-Z][^<>/][a-zA-Z0-9-_.]*)([ ]+=)(?#VALUE)(.* -) + end + \n name - kvp.dangling.space.between.key.and.equalsign.properties - - - captures - - 1 + meta.key-pair.java-properties + patterns + + begin + (?=\S) + end + (?<!\\)(?=\n) name - string.kvp.multiline.properties + string.unquoted.java-properties + patterns + + + match + \\([tnfr"'\\]|u\h{4}|) + name + constant.character.escape.java-properties + + - - match - ^((?:[ ])*[^#].*\ -|(?:[ ])*\ -|(?:[ ])*[^#](?<!=).* -) - name - kvp.multiline.properties + scopeName - source.java.properties + source.java-properties uuid D364E829-7643-4AFF-948D-3C0D6B4EA8A4 From 62b012711783f39b4e34caf82d2cf7ec46f9fd7c Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Sun, 29 Sep 2013 17:49:13 -0500 Subject: [PATCH 25/42] Don't indent after annotations Excludes @Annotation lines from indentNextLinePattern when they are on a line by themselves or are followed by `(`. Fixes #19. --- Preferences/Indentation Rules.tmPreferences | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Preferences/Indentation Rules.tmPreferences b/Preferences/Indentation Rules.tmPreferences index 6828d79..6f590ed 100644 --- a/Preferences/Indentation Rules.tmPreferences +++ b/Preferences/Indentation Rules.tmPreferences @@ -13,7 +13,7 @@ increaseIndentPattern ^.*\{(\}|[^}"']*)$|^\s*(public|private|protected):\s*$ indentNextLinePattern - ^(?!(.*[};:])?\s*(//|/\*.*\*/\s*$)).*[^\s;:{}]\s*$ + ^(?!\s*@\w+(\(|\s*$)|(.*[};:])?\s*(//|/\*.*\*/\s*$)).*[^\s;:{}]\s*$ uuid 20E93106-18CF-4BA3-9DA3-8F0C955DB774 From 412bf29be0c865d154f773b6e98d1646ce2e6244 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Sun, 29 Sep 2013 19:16:37 -0500 Subject: [PATCH 26/42] Ensure variable name is not a reserved word Also do not allow variable name to be a carriage return, fixes #22. --- Syntaxes/Java.plist | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index c9d66c0..e90398a 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -1441,10 +1441,11 @@ (?:(?:[a-z]\w*\.)*[A-Z]+\w*) # object type ) \s+ - [\w\d_<>\[\],\s\?]+ + (?!private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final|def|void|boolean|byte|char|short|int|float|long|double) + [\w\d_<>\[\],\?][\w\d_<>\[\],\? \t]* (?:=|$) - )) + )) end (?=;) name From ba10e91f122c25ee0bebd60479de6ff4d70a565b Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Sat, 22 Feb 2014 19:12:45 -0600 Subject: [PATCH 27/42] Allow comments inside enum declarations --- Syntaxes/Java.plist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index e90398a..5b79344 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -850,6 +850,10 @@ + + include + #comments + keywords From 7c6ea22d7683bc85b25e9766beda2dccdbb99420 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Tue, 1 Apr 2014 05:42:08 -0500 Subject: [PATCH 28/42] Improve numeric literal matching Revised to be current as of Java SE 8, add test document. Fixes #26. --- Syntaxes/Java.plist | 70 +++++++++++++++++++++++++++++++++++-- Tests/Numeric Literals.java | 69 ++++++++++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 Tests/Numeric Literals.java diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 5b79344..5aee3f8 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -770,9 +770,75 @@ match - \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b + \b0[xX]\h([\h_]*\h)?[lL]?(?!\w|\.) name - constant.numeric.java + constant.numeric.hex.java + + + match + \b0[0-7_]*[0-7][lL]?\b + name + constant.numeric.octal.java + + + match + \b0[bB][01]([01_]*[01])?[lL]?\b + name + constant.numeric.binary.java + + + match + \b(0|[1-9]([0-9_]*[0-9])?)[lL]?(?!\w|\.) + name + constant.numeric.integer.java + + + match + (?x) + (?<!\w) # Ensure word boundry + (?> + 0[xX] # Start literal + (\h([\h_]*\h)?)? # Optional Number + ( + (?<=\h)\. # A number must exist on + | \.(?=\h) # one side of the decimal + | (?<=\h) # Decimal not required + ) + (\h([\h_]*\h)?)? # Optional Number + [pP] # Exponent Indicator + [+-]?(0|[1-9]([0-9_]*[0-9])?) # Signed Integer + [fFdD]? # Float Type Suffix + ) + (?!\w) # Ensure word boundry + + name + constant.numeric.hex-float.java + + + match + (?x) + (?<!\w) # Ensure word boundry + (?> + ( + (0|[1-9]([0-9_]*[0-9])?) # Leading digits + (?=[eEfFdD.]) # Allow for numbers without . + )? + ( + (?<=[0-9])(?=[eEfFdD]) # Allow for numbers without . + | \. + ) + ( + [0-9]([0-9_]*[0-9])? # Numbers after . + )? + ( + [eE][+-]?(0|[1-9]([0-9_]*[0-9])?) # Exponent + )? + [fFdD]? # Float Type Suffix + ) + (?!\w) # Ensure word boundry + + name + constant.numeric.float.java captures diff --git a/Tests/Numeric Literals.java b/Tests/Numeric Literals.java new file mode 100644 index 0000000..7c4e912 --- /dev/null +++ b/Tests/Numeric Literals.java @@ -0,0 +1,69 @@ +// Integer + +foo = 0; +foo = 123; +foo = 123_456_789; +foo = 123____456; +foo = 0L; +foo = 123L; + + +// Floating-Point + +foo = 42.00; +foo = 0.5; +foo = .5; +foo = 42f; +foo = 3.59e0; +foo = 3.59e-1701D; + + +// Hexadecimal + +foo = 0x48454c5021; +foo = 0x4927_4d; +foo = 0x54_524150504544; +foo = 0x494E; +foo = 0x48455245L; + + +// Octal + +foo = 3301_8; +foo = 3301_8L; + + +// Binary + +foo = 0b1; +foo = 0b1; +foo = 0b10; +foo = 0b11; +foo = 0b101; +foo = 0b0001; +foo = 0b1101; + + +// Hexadecimal Floating-Point + +foo = 0x2.P1; +foo = 0x1729p2; +foo = 0x87539319P-3; +foo = 0x6_963_472_309_248P+4; + + +// Invalid + +foo = 08; // Zero can't start an integer + +foo = 42_.00F; // Underscore can't start or end number section +foo = 42._00F; +foo = _42; +foo = 42_; +foo = 042_; +foo = 0x42_; + +foo = 123a; // Word boundary test +foo = 3.59e-1701Da; +foo = 0x1729p2a; +foo = 0b1101a; From ba659c17e85004ab3805faf02c14f56a33d30ab7 Mon Sep 17 00:00:00 2001 From: lastsecondsave Date: Mon, 2 Jun 2014 15:54:55 +0400 Subject: [PATCH 29/42] Allow comments inside method's signature --- Syntaxes/Java.plist | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 5aee3f8..78a4380 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -1104,6 +1104,10 @@ include #parameters + + include + #comments + @@ -1144,6 +1148,10 @@ include #all-types + + include + #comments + From a74cb835b821e9a3498d1810d546cb49881df73e Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Wed, 18 Jun 2014 03:57:24 -0500 Subject: [PATCH 30/42] Point to ruby 1.8 shim Using a shim allows us to catch when 1.8 of ruby is not present and provide other options. #ignore --- Commands/Copy Fully Qualified Class Name.tmCommand | 2 +- Commands/Create Package Declaration.tmCommand | 2 +- Commands/Go To Stackframe Source.tmCommand | 2 +- Commands/Organize Imports.tmCommand | 2 +- Support/bin/javamate.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Commands/Copy Fully Qualified Class Name.tmCommand b/Commands/Copy Fully Qualified Class Name.tmCommand index a40cd51..10ffc4e 100644 --- a/Commands/Copy Fully Qualified Class Name.tmCommand +++ b/Commands/Copy Fully Qualified Class Name.tmCommand @@ -5,7 +5,7 @@ beforeRunningCommand nop command - #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w + #!/usr/bin/env ruby18 -w # Copies the fully qualified class name to the paste/clip board. # Used to add the class as an import. # diff --git a/Commands/Create Package Declaration.tmCommand b/Commands/Create Package Declaration.tmCommand index 16e19e7..80b3167 100644 --- a/Commands/Create Package Declaration.tmCommand +++ b/Commands/Create Package Declaration.tmCommand @@ -5,7 +5,7 @@ beforeRunningCommand nop command - #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w + #!/usr/bin/env ruby18 -w # Generates a package statement based on conventions for the name of the source directory. # If the root source folder name isn't matched either log a bug to get it added to the # default list or define an environment variable named TM_JAVA_SOURCE_FOLDER_REGEX with diff --git a/Commands/Go To Stackframe Source.tmCommand b/Commands/Go To Stackframe Source.tmCommand index 6d6e817..f6e7ce2 100644 --- a/Commands/Go To Stackframe Source.tmCommand +++ b/Commands/Go To Stackframe Source.tmCommand @@ -5,7 +5,7 @@ beforeRunningCommand nop command - #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby + #!/usr/bin/env ruby18 require 'find' require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' diff --git a/Commands/Organize Imports.tmCommand b/Commands/Organize Imports.tmCommand index 571b9bb..e07447f 100644 --- a/Commands/Organize Imports.tmCommand +++ b/Commands/Organize Imports.tmCommand @@ -5,7 +5,7 @@ beforeRunningCommand saveActiveFile command - #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w + #!/usr/bin/env ruby18 -w # # WARNING: This script modifies the source of your file!!! No one but # yourself is responsible for it losing code. diff --git a/Support/bin/javamate.rb b/Support/bin/javamate.rb index 608ec43..740079c 100755 --- a/Support/bin/javamate.rb +++ b/Support/bin/javamate.rb @@ -1,4 +1,4 @@ -#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby +#!/usr/bin/env ruby18 require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor" require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document" From ccdebdf888400c492ea55884e03a8f9d1b61de8b Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Thu, 22 Jan 2015 23:01:49 +0100 Subject: [PATCH 31/42] Highlight volatile like synchronized --- Syntaxes/Java.plist | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 78a4380..b7bf3ce 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -1384,7 +1384,7 @@ match - \b(public|private|protected|static|final|native|synchronized|abstract|threadsafe|transient)\b + \b(public|private|protected|static|final|native|synchronized|volatile|abstract|threadsafe|transient)\b strings @@ -1510,7 +1510,7 @@ begin (?x:(?= (?: - (?:private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final) # visibility/modifier + (?:private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final) # visibility/modifier | (?:def) | @@ -1519,7 +1519,7 @@ (?:(?:[a-z]\w*\.)*[A-Z]+\w*) # object type ) \s+ - (?!private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final|def|void|boolean|byte|char|short|int|float|long|double) + (?!private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final|def|void|boolean|byte|char|short|int|float|long|double) [\w\d_<>\[\],\?][\w\d_<>\[\],\? \t]* (?:=|$) From 2024f8e9afa4fe109b8c0a30d55856fb92a93f7c Mon Sep 17 00:00:00 2001 From: Alexander Lent Date: Mon, 23 Mar 2015 17:51:17 -0400 Subject: [PATCH 32/42] Alter keyword order in constant snippet Most style guidelines recommend that the keywords are in alphabetic order, so rearrange them to be in this order. See Google's style guidelines: https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.8.7-modifiers See the Java Language Specification: http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.9 --- Snippets/constant.tmSnippet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Snippets/constant.tmSnippet b/Snippets/constant.tmSnippet index 4f963c3..4da2872 100644 --- a/Snippets/constant.tmSnippet +++ b/Snippets/constant.tmSnippet @@ -3,7 +3,7 @@ content - static public final ${1:String} ${2:var} = $3;$0 + public static final ${1:String} ${2:var} = $3;$0 name constant scope From bed5760ae0ca4784fc153e0323978a096ea656dc Mon Sep 17 00:00:00 2001 From: Alexander Lent Date: Mon, 23 Mar 2015 17:53:44 -0400 Subject: [PATCH 33/42] Alter constant string snippet to be more standard Most style guidelines recommend that the keywords are in alphabetic order, so rearrange them to be in this order. See Google's style guidelines: https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.8.7-modifiers See the Java Language Specification: http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.9 Companion to commit 2024f8e9afa4fe109b8c0a30d55856fb92a93f7c --- Snippets/constant string.tmSnippet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Snippets/constant string.tmSnippet b/Snippets/constant string.tmSnippet index 4cd730d..0df149c 100644 --- a/Snippets/constant string.tmSnippet +++ b/Snippets/constant string.tmSnippet @@ -3,7 +3,7 @@ content - static public final String ${1:var} = "$2";$0 + public static final String ${1:var} = "$2";$0 name constant string scope From e19a9449791472f41ca7ebe6a5163595c8099598 Mon Sep 17 00:00:00 2001 From: Curt Sellmer Date: Thu, 9 Jul 2015 14:14:17 -0500 Subject: [PATCH 34/42] Rewrite grammar for Java Properties files. Recognize line continuations as a separate type of punctuation. Better handling for escape sequences in both keys and values. Display invalid escape sequences. Handle keys without values correctly. Add disableIndentCorrections := true for properties files as indent corrections are more annoying than helpful for this type of file. --- ...tion Rules - Java Properties.tmPreferences | 17 ++ Syntaxes/JavaProperties.plist | 163 +++++++++++------- 2 files changed, 116 insertions(+), 64 deletions(-) create mode 100644 Preferences/Indentation Rules - Java Properties.tmPreferences diff --git a/Preferences/Indentation Rules - Java Properties.tmPreferences b/Preferences/Indentation Rules - Java Properties.tmPreferences new file mode 100644 index 0000000..b665680 --- /dev/null +++ b/Preferences/Indentation Rules - Java Properties.tmPreferences @@ -0,0 +1,17 @@ + + + + + name + Indentation Rules - Properties File + scope + source.java-properties + settings + + disableIndentCorrections + + + uuid + BB1257BA-0871-4B9F-B637-240F884E81E5 + + diff --git a/Syntaxes/JavaProperties.plist b/Syntaxes/JavaProperties.plist index b774343..040df72 100644 --- a/Syntaxes/JavaProperties.plist +++ b/Syntaxes/JavaProperties.plist @@ -19,77 +19,58 @@ patterns - begin - (^[ \t]+)?(?=#) - beginCaptures + comment + Ignore blank lines + match + ^\s*$ + + + include + #comment-line + + + include + #property-name + + + include + #property-definition + + + repository + + comment-line + + captures 1 name punctuation.whitespace.comment.leading.java-properties - - end - (?!\G) - patterns - + 2 - begin - # - beginCaptures - - 0 - - name - punctuation.definition.comment.java-properties - - - end - \n name - comment.line.number-sign.java-properties + punctuation.definition.comment.java-properties - + + match + ^(\s*)([#!])(.+)?$\n? + name + comment.line.java-properties + property-definition begin - (^[ \t]+)?(?=!) + ^(\s*)((?:\\[ \t]|\\:|\\=|[^:=\s])+)(?:\s*([:=]))?\s* beginCaptures 1 name - punctuation.whitespace.comment.leading.java-properties + punctuation.whitespace.leading.java-properties - - end - (?!\G) - patterns - - - begin - ! - beginCaptures - - 0 - - name - punctuation.definition.comment.java-properties - - - end - \n - name - comment.line.exclamation.java-properties - - - - - begin - ^\s*(([\S&&[^:=\\]]|\\.)+)\s*([:=])? - beginCaptures - - 1 + 2 name support.constant.java-properties @@ -97,10 +78,16 @@ match - \\([tnfr"'\\ ]|u\h{4}) + \\(?:[ \t:=\\ntfr\"']|u[0-9A-Fa-f]{4}) name constant.character.escape.java-properties + + match + \\. + name + invalid.illegal.character.escape.java-properties + 3 @@ -109,32 +96,80 @@ punctuation.separator.key-value.java-properties + contentName + string.unquoted.java-properties end - \n + (?<!\\{1})$\n name - meta.key-pair.java-properties + meta.key-value.java-properties patterns - begin - (?=\S) - end - (?<!\\)(?=\n) + comment + Leading space on a continued line is ignored + match + ^\s* + name + punctuation.whitespace.leading.java-properties + + + match + (\\{1})(?=$\n) + name + punctuation.separator.continuation.java-properties + + + match + \\(?:[\\ntfr\"']|u[0-9A-Fa-f]{4}) + name + constant.character.escape.java-properties + + + match + \\. + name + invalid.illegal.character.escape.java-properties + + + + property-name + + captures + + 1 + + name + punctuation.whitespace.comment.leading.java-properties + + 2 + name - string.unquoted.java-properties + support.constant.java-properties patterns match - \\([tnfr"'\\]|u\h{4}|) + \\(?:[ \t:=\\ntfr\"']|u[0-9A-Fa-f]{4}) name constant.character.escape.java-properties + + match + \\. + name + invalid.illegal.character.escape.java-properties + - + + comment + A property name with no value + match + ^(\s*)((?:\\[ \t]|\\:|\\=|[^:=\s])+)(?:\s*([:=]))?\s*$\n + name + meta.key-value.java-properties - + scopeName source.java-properties uuid From 5f4204576e13a73c9dfce525d8ced41a39d004c3 Mon Sep 17 00:00:00 2001 From: Curt Sellmer Date: Wed, 22 Jul 2015 12:16:17 -0500 Subject: [PATCH 35/42] Remove rules recognizing invalid escapes sequences According to the spec there are no invalid escape sequences, because the load() method will simply ignore a backslash before any character that does not denote a known escape sequence. --- Syntaxes/JavaProperties.plist | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/Syntaxes/JavaProperties.plist b/Syntaxes/JavaProperties.plist index 040df72..bf25ce8 100644 --- a/Syntaxes/JavaProperties.plist +++ b/Syntaxes/JavaProperties.plist @@ -82,12 +82,6 @@ name constant.character.escape.java-properties - - match - \\. - name - invalid.illegal.character.escape.java-properties - 3 @@ -124,12 +118,6 @@ name constant.character.escape.java-properties - - match - \\. - name - invalid.illegal.character.escape.java-properties - property-name @@ -153,12 +141,6 @@ name constant.character.escape.java-properties - - match - \\. - name - invalid.illegal.character.escape.java-properties - From 81d7236738ff2f29eb61847c75993254807de047 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sun, 23 Aug 2015 14:45:00 +0200 Subject: [PATCH 36/42] Allow annotations in enumerations Fixes #35 --- Syntaxes/Java.plist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index b7bf3ce..4a58435 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -920,6 +920,10 @@ include #comments + + include + #annotations + keywords From 64294ae0b62b64b1183c401e3803679eaddb4946 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Mon, 24 Aug 2015 17:46:25 -0500 Subject: [PATCH 37/42] Correct scope typos --- Syntaxes/Java.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 4a58435..767ea56 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -239,7 +239,7 @@ match , name - punctuation.seperator.property.java + punctuation.separator.property.java @@ -1544,7 +1544,7 @@ 1 name - constant.variable.java + constant.other.variable.java match From faffa518d0b22b68b4e5e6b4c939722522b97d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20K=C3=BChl?= Date: Tue, 9 Aug 2016 18:56:02 +0200 Subject: [PATCH 38/42] Support annotations on top-level classes In code like the following, the annotation on the top-level class is not highlighted like an annotation: ```java @Amazing class Thing {} ``` This change fixes that by including the `#annotation` rules at the top level. --- Syntaxes/Java.plist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 767ea56..97064a7 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -647,6 +647,10 @@ include #anonymous-classes-and-new + + include + #annotations + include #keywords From bd222183660baffd9fab21a0d8230be0e07322b8 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 27 May 2017 16:14:14 +0200 Subject: [PATCH 39/42] Avoid using the ambiguous \h shorthand character Depending on the regular expression engine used, \h does not always mean the same. With a PCRE engine, it matches white spaces, whereas, with a Oniguruma engine, it matches hexademical digit characters. Atom uses an Oniguruma engine, but github.com relies on a PCRE engine. --- Syntaxes/Java.plist | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 97064a7..6d17ad7 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -774,7 +774,7 @@ match - \b0[xX]\h([\h_]*\h)?[lL]?(?!\w|\.) + \b0[xX][0-9A-Fa-f]([0-9A-Fa-f_]*[0-9A-Fa-f])?[lL]?(?!\w|\.) name constant.numeric.hex.java @@ -802,13 +802,13 @@ (?<!\w) # Ensure word boundry (?> 0[xX] # Start literal - (\h([\h_]*\h)?)? # Optional Number + ([0-9A-Fa-f]([0-9A-Fa-f_]*[0-9A-Fa-f])?)? # Optional Number ( - (?<=\h)\. # A number must exist on - | \.(?=\h) # one side of the decimal - | (?<=\h) # Decimal not required + (?<=[0-9A-Fa-f])\. # A number must exist on + | \.(?=[0-9A-Fa-f]) # one side of the decimal + | (?<=[0-9A-Fa-f]) # Decimal not required ) - (\h([\h_]*\h)?)? # Optional Number + ([0-9A-Fa-f]([0-9A-Fa-f_]*[0-9A-Fa-f])?)? # Optional Number [pP] # Exponent Indicator [+-]?(0|[1-9]([0-9_]*[0-9])?) # Signed Integer [fFdD]? # Float Type Suffix From 043207b63e7a01c96c49a8b72478570eeaa3ac96 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Wed, 25 Jul 2018 06:23:56 -0500 Subject: [PATCH 40/42] Quote passed parameters This allows for spaces in the parameters to get parsed correctly. --- Support/bin/java_compile_and_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Support/bin/java_compile_and_run.sh b/Support/bin/java_compile_and_run.sh index cf45caa..5eac25c 100755 --- a/Support/bin/java_compile_and_run.sh +++ b/Support/bin/java_compile_and_run.sh @@ -36,5 +36,5 @@ then CLASS="$TM_JAVA_PACKAGE.$CLASS" fi -CLASSPATH="$output:$CLASSPATH" "$TM_JAVA" -Dfile.encoding=utf-8 "$CLASS" $@; +CLASSPATH="$output:$CLASSPATH" "$TM_JAVA" -Dfile.encoding=utf-8 "$CLASS" "$@"; exit $?; From d532ad397873683c1cecedf0320d41c91d4f4715 Mon Sep 17 00:00:00 2001 From: Marcus Fihlon Date: Sun, 28 Jan 2018 18:46:36 +0100 Subject: [PATCH 41/42] :memo: Adding information about how to configure java executables --- README.mdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.mdown b/README.mdown index 32d8f85..c0577f3 100644 --- a/README.mdown +++ b/README.mdown @@ -2,6 +2,15 @@ You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. +# Settings + +If you have Java installed and TextMate does not find your JDK and shows the error message `No Java runtime present, requesting install`, you have to tell TextMate where to find the `java` and `javac` executables. Go to the *Preferences*, open the *Variables* section and add two entries using the `+` button: `TM_JAVA`, which points to your `java` executable and `TM_JAVAC`, which points to your `javac` executable. Example: + +| | Variable Name | Value | +| - | -------------- | ----- | +| :white_check_mark: | TM_JAVA | /Users/*«yourname»*/jdk1.8.0/bin/java | +| :white_check_mark: | TM_JAVAC | /Users/*«yourname»*/jdk1.8.0/bin/javac | + # General * [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_ From 79b8b61865e40de0ff04bb16fe1076b154b9894c Mon Sep 17 00:00:00 2001 From: Slikey <1394841+Slikey@users.noreply.github.com> Date: Sat, 24 Aug 2019 15:48:18 +0200 Subject: [PATCH 42/42] Add var as primitive keyword to Java.plist --- Syntaxes/Java.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Syntaxes/Java.plist b/Syntaxes/Java.plist index 6d17ad7..76d02ef 100644 --- a/Syntaxes/Java.plist +++ b/Syntaxes/Java.plist @@ -1375,7 +1375,7 @@ match - \b(?:void|boolean|byte|char|short|int|float|long|double)\b + \b(?:void|var|boolean|byte|char|short|int|float|long|double)\b name storage.type.primitive.java