rtext 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +20 -0
- data/{README → README.rdoc} +5 -1
- data/RText_Protocol +444 -0
- data/Rakefile +10 -10
- data/lib/rtext/completer.rb +32 -26
- data/lib/rtext/context_builder.rb +113 -59
- data/lib/rtext/default_loader.rb +73 -8
- data/lib/rtext/default_service_provider.rb +30 -14
- data/lib/rtext/frontend/config.rb +58 -0
- data/lib/rtext/frontend/connector.rb +233 -0
- data/lib/rtext/frontend/connector_manager.rb +81 -0
- data/lib/rtext/frontend/context.rb +56 -0
- data/lib/rtext/generic.rb +13 -0
- data/lib/rtext/instantiator.rb +30 -7
- data/lib/rtext/language.rb +54 -27
- data/lib/rtext/link_detector.rb +57 -0
- data/lib/rtext/message_helper.rb +77 -0
- data/lib/rtext/parser.rb +19 -68
- data/lib/rtext/serializer.rb +18 -3
- data/lib/rtext/service.rb +182 -118
- data/lib/rtext/tokenizer.rb +102 -0
- data/test/completer_test.rb +327 -70
- data/test/context_builder_test.rb +671 -91
- data/test/instantiator_test.rb +153 -0
- data/test/integration/backend.out +10 -0
- data/test/integration/crash_on_request_editor.rb +12 -0
- data/test/integration/ecore_editor.rb +50 -0
- data/test/integration/frontend.log +25138 -0
- data/test/integration/model/invalid_encoding.invenc +2 -0
- data/test/integration/model/test.crash_on_request +18 -0
- data/test/integration/model/test.crashing_backend +18 -0
- data/test/integration/model/test.dont_open_socket +0 -0
- data/test/integration/model/test.invalid_cmd_line +0 -0
- data/test/integration/model/test.not_in_rtext +0 -0
- data/test/integration/model/test_large_with_errors.ect3 +43523 -0
- data/test/integration/model/test_metamodel.ect +18 -0
- data/test/integration/model/test_metamodel2.ect +5 -0
- data/test/integration/model/test_metamodel_error.ect2 +3 -0
- data/test/integration/model/test_metamodel_ok.ect2 +18 -0
- data/test/integration/test.rb +684 -0
- data/test/link_detector_test.rb +276 -0
- data/test/message_helper_test.rb +118 -0
- data/test/rtext_test.rb +4 -1
- data/test/serializer_test.rb +96 -1
- data/test/tokenizer_test.rb +125 -0
- metadata +36 -10
- data/RText_Plugin_Implementation_Guide +0 -268
- data/lib/rtext_plugin/connection_manager.rb +0 -59
@@ -1,59 +0,0 @@
|
|
1
|
-
module RTextPlugin
|
2
|
-
|
3
|
-
class ConnectorManager
|
4
|
-
def start
|
5
|
-
end
|
6
|
-
|
7
|
-
def stop
|
8
|
-
end
|
9
|
-
|
10
|
-
def trigger
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def find_rtext_config_file(file)
|
16
|
-
end
|
17
|
-
|
18
|
-
def extract_file_pattern(file)
|
19
|
-
ext = File.extname
|
20
|
-
if ext.size > 0
|
21
|
-
"*.#{ext}"
|
22
|
-
else
|
23
|
-
File.basename(file)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
ServiceSpec = Struct.new(:config_file, :pattern, :command)
|
28
|
-
|
29
|
-
def parse_rtext_config_file(file)
|
30
|
-
expect = :pattern
|
31
|
-
line = 1
|
32
|
-
pattern = nil
|
33
|
-
specs = []
|
34
|
-
File.open(file) do |f|
|
35
|
-
f.readlines.each do |l|
|
36
|
-
case expect
|
37
|
-
when :pattern
|
38
|
-
if l =~ /(.*):\s*$/
|
39
|
-
pattern = $1.split(",").collect{|s| s.strip}
|
40
|
-
expect = :command
|
41
|
-
else
|
42
|
-
raise "expected file pattern in line #{line}"
|
43
|
-
end
|
44
|
-
when :command
|
45
|
-
if l =~ /[^:]\s*$/
|
46
|
-
specs << ServiceSpec.new(file, pattern, l)
|
47
|
-
else
|
48
|
-
raise "expected command in line #{line}"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
line += 1
|
52
|
-
end
|
53
|
-
end
|
54
|
-
specs
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|