redcar-dev 0.12.12dev-java → 0.12.13dev-java
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/redcar.rb +1 -1
- data/lib/tasks/app-bundle.rake +63 -0
- data/plugins/application/lib/application.rb +3 -0
- data/plugins/project_search/lib/project_search/commands.rb +5 -4
- data/plugins/project_search/lib/project_search/images/spinner.gif +0 -0
- data/plugins/project_search/lib/project_search/lucene_index.rb +1 -1
- data/plugins/project_search/lib/project_search/stylesheets/style.css +105 -37
- data/plugins/project_search/lib/project_search/views/_file.html.erb +4 -3
- data/plugins/project_search/lib/project_search/views/index.html.erb +42 -16
- data/plugins/project_search/lib/project_search/word_search.rb +23 -14
- data/plugins/project_search/lib/project_search/word_search_controller.rb +40 -29
- metadata +3 -22
- data/plugins/javascript/features/fixtures/test.js +0 -0
- data/plugins/javascript/features/fixtures/test2.js +0 -5
- data/plugins/javascript/features/step_definitions/javascript_steps.rb +0 -16
- data/plugins/javascript/features/support/env.rb +0 -18
- data/plugins/javascript/features/syntax_check_javascript.feature +0 -70
- data/plugins/javascript/lib/syntax_check/javascript.rb +0 -58
- data/plugins/javascript/plugin.rb +0 -7
- data/plugins/javascript/vendor/jslint.js +0 -539
- data/plugins/mirah/README +0 -7
- data/plugins/mirah/features/fixtures/test.mirah +0 -2
- data/plugins/mirah/features/syntax_check_mirah.feature +0 -46
- data/plugins/mirah/lib/mirah.rb +0 -43
- data/plugins/mirah/lib/mirah/my_error_handler.rb +0 -22
- data/plugins/mirah/lib/mirah/repl_mirror.rb +0 -50
- data/plugins/mirah/lib/mirah/syntax_checker.rb +0 -38
- data/plugins/mirah/plugin.rb +0 -8
- data/plugins/mirah/spec/mirah/repl_mirror_spec.rb +0 -188
- data/plugins/mirah/spec/spec_helper.rb +0 -5
- data/plugins/mirah/vendor/mirah-parser.jar +0 -0
- data/plugins/project_search/TODO.md +0 -11
data/plugins/mirah/README
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
Feature: Syntax Checking for Mirah
|
2
|
-
As a user
|
3
|
-
I want to get annotations on syntax errors and warnings in Mirah files
|
4
|
-
|
5
|
-
Background:
|
6
|
-
When I have opened "plugins/mirah/features/fixtures/test.mirah"
|
7
|
-
|
8
|
-
Scenario: A syntax-clean Mirah file has no syntax error annotations
|
9
|
-
When I replace the contents with "def foo\n bar\nend"
|
10
|
-
And I save the tab
|
11
|
-
And I wait 2 seconds
|
12
|
-
Then the tab should not have annotations
|
13
|
-
|
14
|
-
Scenario: A syntax-error in a Mirah file should cause syntax error annotations
|
15
|
-
When I replace the contents with "def foo\n => bar\nend"
|
16
|
-
And I save the tab
|
17
|
-
And I wait 2 seconds
|
18
|
-
Then the tab should have annotations
|
19
|
-
And the tab should have an annotation on line 2
|
20
|
-
|
21
|
-
Scenario: A syntax-warning in a Mirah file should cause syntax warning annotations
|
22
|
-
When I replace the contents with "def foo\n end"
|
23
|
-
And I save the tab
|
24
|
-
And I wait 2 seconds
|
25
|
-
Then the tab should have annotations
|
26
|
-
And the tab should have an annotation on line 2
|
27
|
-
|
28
|
-
Scenario: Fixing a syntax-error in a Mirah file should cause syntax error annotations to vanish
|
29
|
-
When I replace the contents with "def foo\n => bar\nend"
|
30
|
-
And I save the tab
|
31
|
-
And I wait 2 seconds
|
32
|
-
Then the tab should have annotations
|
33
|
-
When I replace the contents with "def foo\n bar\nend"
|
34
|
-
And I save the tab
|
35
|
-
And I wait 2 seconds
|
36
|
-
Then the tab should not have annotations
|
37
|
-
|
38
|
-
Scenario: Fixing a syntax-warning in a Mirah file should cause syntax error annotations to vanish
|
39
|
-
When I replace the contents with "def foo\n end"
|
40
|
-
And I save the tab
|
41
|
-
And I wait 2 seconds
|
42
|
-
Then the tab should have annotations
|
43
|
-
When I replace the contents with "def foo\nend"
|
44
|
-
And I save the tab
|
45
|
-
And I wait 2 seconds
|
46
|
-
Then the tab should not have annotations
|
data/plugins/mirah/lib/mirah.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'java'
|
3
|
-
require 'mirah/syntax_checker'
|
4
|
-
require 'mirah/repl_mirror'
|
5
|
-
|
6
|
-
module Redcar
|
7
|
-
class Mirah
|
8
|
-
|
9
|
-
def self.menus
|
10
|
-
Menu::Builder.build do
|
11
|
-
sub_menu "Plugins" do
|
12
|
-
sub_menu "REPL" do
|
13
|
-
item "Open Mirah REPL", OpenMirahREPL
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.load_dependencies
|
20
|
-
unless @loaded
|
21
|
-
require File.join(File.dirname(__FILE__),'..','vendor','mirah-parser')
|
22
|
-
import 'mirah.impl.MirahParser'
|
23
|
-
import 'jmeta.ErrorHandler'
|
24
|
-
require 'mirah/my_error_handler'
|
25
|
-
@loaded = true
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.storage
|
30
|
-
@storage ||= begin
|
31
|
-
storage = Plugin::Storage.new('mirah')
|
32
|
-
storage.set_default('check_for_warnings', true)
|
33
|
-
storage
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
class OpenMirahREPL < Redcar::REPL::OpenREPL
|
38
|
-
def execute
|
39
|
-
open_repl(ReplMirror.new)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
|
2
|
-
module Redcar
|
3
|
-
class Mirah
|
4
|
-
class MyErrorHandler
|
5
|
-
include ErrorHandler
|
6
|
-
|
7
|
-
def problem(m)
|
8
|
-
(@problems||=[]) << m
|
9
|
-
end
|
10
|
-
|
11
|
-
def problems
|
12
|
-
@problems || []
|
13
|
-
end
|
14
|
-
|
15
|
-
def warning(messages, positions)
|
16
|
-
messages.length.times { |i|
|
17
|
-
problem "Warning: #{messages[i]} #{positions[i]}"
|
18
|
-
}
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
|
2
|
-
module Redcar
|
3
|
-
class Mirah
|
4
|
-
class ReplMirror < Redcar::REPL::ReplMirror
|
5
|
-
|
6
|
-
def title
|
7
|
-
"Mirah REPL"
|
8
|
-
end
|
9
|
-
|
10
|
-
def grammar_name
|
11
|
-
"Ruby REPL"
|
12
|
-
end
|
13
|
-
|
14
|
-
def prompt
|
15
|
-
">>"
|
16
|
-
end
|
17
|
-
|
18
|
-
def format_error(e)
|
19
|
-
backtrace = e.backtrace.reject{|l|
|
20
|
-
l =~ /(repl_mirror|redcar)/
|
21
|
-
}
|
22
|
-
backtrace.unshift("(repl):1")
|
23
|
-
"#{e.class}: #{e.message}\n #{backtrace.join("\n ")}"
|
24
|
-
end
|
25
|
-
|
26
|
-
def evaluator
|
27
|
-
@evaluator ||= ReplMirror::Evaluator.new
|
28
|
-
end
|
29
|
-
|
30
|
-
class Evaluator
|
31
|
-
attr_reader :output
|
32
|
-
|
33
|
-
def initialize
|
34
|
-
Mirah.load_dependencies
|
35
|
-
@binding = binding
|
36
|
-
@impl = Java::MirahImpl::Mirah.new
|
37
|
-
@output = nil
|
38
|
-
end
|
39
|
-
|
40
|
-
def inspect
|
41
|
-
"main"
|
42
|
-
end
|
43
|
-
|
44
|
-
def execute(command)
|
45
|
-
@impl.instance_eval(command).inspect
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
|
2
|
-
module Redcar
|
3
|
-
class Mirah
|
4
|
-
class SyntaxChecker < Redcar::SyntaxCheck::Checker
|
5
|
-
supported_grammars "Mirah"
|
6
|
-
|
7
|
-
def check(*args)
|
8
|
-
Mirah.load_dependencies
|
9
|
-
check_warnings = Mirah.storage['check_for_warnings']
|
10
|
-
path = manifest_path(doc)
|
11
|
-
|
12
|
-
parser = MirahParser.new
|
13
|
-
parser.filename = path
|
14
|
-
|
15
|
-
handler = MyErrorHandler.new
|
16
|
-
parser.errorHandler = handler
|
17
|
-
|
18
|
-
begin
|
19
|
-
parser.parse(IO.read(path))
|
20
|
-
rescue
|
21
|
-
m = $!.message
|
22
|
-
error = m.split(" (").first
|
23
|
-
if info = m.match(/line: ([0-9]+), char: ([0-9]+)\)/)
|
24
|
-
SyntaxCheck::Error.new(doc, info[1].to_i-1, error).annotate
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
if check_warnings
|
29
|
-
handler.problems.each do |problem|
|
30
|
-
if info = problem.match(/line: ([0-9]+), char: ([0-9]+)\)/)
|
31
|
-
SyntaxCheck::Warning.new(doc, info[1].to_i-1, problem.split(" (").first).annotate
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
data/plugins/mirah/plugin.rb
DELETED
@@ -1,188 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
2
|
-
|
3
|
-
class Redcar::Mirah
|
4
|
-
describe ReplMirror do
|
5
|
-
before do
|
6
|
-
@mirror = ReplMirror.new
|
7
|
-
@changed_event = false
|
8
|
-
@mirror.add_listener(:change) { @changed_event = true }
|
9
|
-
end
|
10
|
-
|
11
|
-
def commit_test_text1
|
12
|
-
text = <<-MIRAH
|
13
|
-
# Mirah REPL
|
14
|
-
# type 'help' for help
|
15
|
-
|
16
|
-
>> $internal_repl_test = 707
|
17
|
-
MIRAH
|
18
|
-
@mirror.commit(text.chomp)
|
19
|
-
end
|
20
|
-
|
21
|
-
def result_test_text1
|
22
|
-
(<<-MIRAH).chomp
|
23
|
-
# Mirah REPL
|
24
|
-
# type 'help' for help
|
25
|
-
|
26
|
-
>> $internal_repl_test = 707
|
27
|
-
=> 707
|
28
|
-
>>
|
29
|
-
MIRAH
|
30
|
-
end
|
31
|
-
|
32
|
-
def commit_test_text2
|
33
|
-
text = <<-MIRAH
|
34
|
-
# Mirah REPL
|
35
|
-
# type 'help' for help
|
36
|
-
|
37
|
-
>> $internal_repl_test = 707
|
38
|
-
=> 707
|
39
|
-
>> $internal_repl_test = 909
|
40
|
-
MIRAH
|
41
|
-
@mirror.commit(text.chomp)
|
42
|
-
text.chomp
|
43
|
-
end
|
44
|
-
|
45
|
-
def result_test_text2
|
46
|
-
(<<-MIRAH).chomp
|
47
|
-
# Mirah REPL
|
48
|
-
# type 'help' for help
|
49
|
-
|
50
|
-
>> $internal_repl_test = 707
|
51
|
-
=> 707
|
52
|
-
>> $internal_repl_test = 909
|
53
|
-
=> 909
|
54
|
-
>>
|
55
|
-
MIRAH
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
def commit_no_input
|
60
|
-
text = <<-MIRAH
|
61
|
-
# Mirah REPL
|
62
|
-
# type 'help' for help
|
63
|
-
|
64
|
-
>>
|
65
|
-
MIRAH
|
66
|
-
@mirror.commit(text)
|
67
|
-
end
|
68
|
-
|
69
|
-
def prompt
|
70
|
-
"# Mirah REPL\n\n"
|
71
|
-
end
|
72
|
-
|
73
|
-
describe "with no history" do
|
74
|
-
it "should exist" do
|
75
|
-
@mirror.should be_exist
|
76
|
-
end
|
77
|
-
|
78
|
-
it "should have a message and a prompt" do
|
79
|
-
@mirror.read.should == (<<-MIRAH).chomp
|
80
|
-
# Mirah REPL
|
81
|
-
# type 'help' for help
|
82
|
-
|
83
|
-
>>
|
84
|
-
MIRAH
|
85
|
-
end
|
86
|
-
|
87
|
-
it "should have a title" do
|
88
|
-
@mirror.title.should == "Mirah REPL"
|
89
|
-
end
|
90
|
-
|
91
|
-
it "should not be changed" do
|
92
|
-
@mirror.should_not be_changed
|
93
|
-
end
|
94
|
-
|
95
|
-
describe "when executing" do
|
96
|
-
it "should execute committed text" do
|
97
|
-
commit_test_text1
|
98
|
-
$internal_repl_test.should == 707
|
99
|
-
end
|
100
|
-
|
101
|
-
it "should allow committing nothing as the first command" do
|
102
|
-
commit_no_input
|
103
|
-
@mirror.read.should == "# Mirah REPL\n# type 'help' for help\n\n>> \n=> nil\n>> "
|
104
|
-
end
|
105
|
-
|
106
|
-
it "should allow committing nothing as an xth command" do
|
107
|
-
committed = commit_test_text2
|
108
|
-
@mirror.commit committed + "\n>> "
|
109
|
-
@mirror.read.should == "# Mirah REPL\n# type 'help' for help\n\n>> $internal_repl_test = 909\n=> 909\n>> \n=> nil\n>> "
|
110
|
-
end
|
111
|
-
|
112
|
-
it "should emit changed event when text is executed" do
|
113
|
-
commit_test_text1
|
114
|
-
@changed_event.should be_true
|
115
|
-
end
|
116
|
-
|
117
|
-
it "should now have the command and the result at the end" do
|
118
|
-
commit_test_text1
|
119
|
-
@mirror.read.should == result_test_text1
|
120
|
-
end
|
121
|
-
|
122
|
-
it "should display errors" do
|
123
|
-
@mirror.commit(prompt + ">> nil.foo")
|
124
|
-
text = <<-MIRAH
|
125
|
-
# Mirah REPL
|
126
|
-
# type 'help' for help
|
127
|
-
|
128
|
-
>> nil.foo
|
129
|
-
x> NoMethodError: undefined method `foo' for nil:NilClass
|
130
|
-
(repl):1
|
131
|
-
MIRAH
|
132
|
-
@mirror.read.include?(text).should be_true
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
|
-
describe "with a history" do
|
138
|
-
before do
|
139
|
-
commit_test_text1
|
140
|
-
end
|
141
|
-
|
142
|
-
it "should not have changed" do
|
143
|
-
@mirror.changed?.should be_false
|
144
|
-
end
|
145
|
-
|
146
|
-
it "should display the history and prompt correctly" do
|
147
|
-
@mirror.read.should == result_test_text1
|
148
|
-
end
|
149
|
-
|
150
|
-
describe "when executing" do
|
151
|
-
it "should execute committed text" do
|
152
|
-
commit_test_text2
|
153
|
-
$internal_repl_test.should == 909
|
154
|
-
end
|
155
|
-
|
156
|
-
it "should show the correct history" do
|
157
|
-
commit_test_text2
|
158
|
-
@mirror.read.should == result_test_text2
|
159
|
-
end
|
160
|
-
|
161
|
-
it "should allow the history to be cleared" do
|
162
|
-
@mirror.clear_history
|
163
|
-
@mirror.read.should == ">> "
|
164
|
-
end
|
165
|
-
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
# somehow ...
|
170
|
-
# describe "when executing" do
|
171
|
-
# it "should persist local variables" do
|
172
|
-
# sent = prompt + ">> a = 13"
|
173
|
-
# @mirror.commit(sent)
|
174
|
-
# @mirror.commit(sent + "\n>> a")
|
175
|
-
# @mirror.read.should == (<<-MIRAH).chomp
|
176
|
-
# # Mirah REPL
|
177
|
-
# # type 'help' for help
|
178
|
-
#
|
179
|
-
# >> a = 13
|
180
|
-
# => 13
|
181
|
-
# >> a
|
182
|
-
# => 13
|
183
|
-
# >>
|
184
|
-
# MIRAH
|
185
|
-
# end
|
186
|
-
# end
|
187
|
-
end
|
188
|
-
end
|
Binary file
|
@@ -1,11 +0,0 @@
|
|
1
|
-
* Speed up regex search (in particular, with context). Stats below.
|
2
|
-
|
3
|
-
Searching for "redcar" in the Redcar source code:
|
4
|
-
- Without Context:
|
5
|
-
- Textmate AckMate: ~2 seconds
|
6
|
-
- Redcar regex search: ~50 seconds
|
7
|
-
- With Context:
|
8
|
-
- Textmate AckMate: ~4 seconds
|
9
|
-
- Redcar regex search: ~5 minutes
|
10
|
-
|
11
|
-
* Per-project settings
|