syntax_suggest 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +10 -10
- data/lib/syntax_suggest/capture_code_context.rb +2 -2
- data/lib/syntax_suggest/cli.rb +2 -2
- data/lib/syntax_suggest/display_code_with_line_numbers.rb +3 -3
- data/lib/syntax_suggest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f8b41fd2cbb19ed9ce0553b53e88f29de1a0ae46e7ffbd0de1d9bf1b881a9a5
|
4
|
+
data.tar.gz: c0787c1da43c9e19ca97e8fd616360c188946e996c283aa8c0b4c187dd2a66ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ed334240baa6233e259756bd4e532638fb7796e5fc3f671a3c31bb8c01a508d1418fe62380f3c5db9bb1568395b2686ab9fb56c4badcace009b91d92c2cbded
|
7
|
+
data.tar.gz: 5fa487311079e5000a2bbfb8216e855983c816668657e7f4fbca4fe2e79370e6c00e1665d4230879ca59c2ec4c9476a387c2295aa1b13d259d41446ae84c8629
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## HEAD (unreleased)
|
2
2
|
|
3
|
+
## 1.0.1
|
4
|
+
|
5
|
+
- Replace `❯` with `>` in error output for compatability with more fonts (https://github.com/ruby/syntax_suggest/pull/161)
|
6
|
+
|
3
7
|
## 1.0.0 (Library renamed to syntax_suggest )
|
4
8
|
|
5
9
|
- [Breaking] Output "Syntax OK" will no longer be output when `syntax_suggest` is fired due to a syntax error. (https://github.com/ruby/syntax_suggest/pull/158)
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,8 +6,8 @@ An error in your code forces you to stop. SyntaxSuggest helps you find those err
|
|
6
6
|
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
|
7
7
|
|
8
8
|
1 class Dog
|
9
|
-
|
10
|
-
|
9
|
+
> 2 defbark
|
10
|
+
> 4 end
|
11
11
|
5 end
|
12
12
|
```
|
13
13
|
|
@@ -72,9 +72,9 @@ end
|
|
72
72
|
```
|
73
73
|
Unmatched keyword, missing `end' ?
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
> 1 class Dog
|
76
|
+
> 2 def bark
|
77
|
+
> 4 end
|
78
78
|
```
|
79
79
|
|
80
80
|
- Missing keyword
|
@@ -95,8 +95,8 @@ Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
|
|
95
95
|
|
96
96
|
1 class Dog
|
97
97
|
2 def speak
|
98
|
-
|
99
|
-
|
98
|
+
> 3 @sounds.each |sound|
|
99
|
+
> 5 end
|
100
100
|
6 end
|
101
101
|
7 end
|
102
102
|
```
|
@@ -117,8 +117,8 @@ end
|
|
117
117
|
Unmatched `(', missing `)' ?
|
118
118
|
|
119
119
|
1 class Dog
|
120
|
-
|
121
|
-
|
120
|
+
> 2 def speak(sound
|
121
|
+
> 4 end
|
122
122
|
5 end
|
123
123
|
```
|
124
124
|
|
@@ -137,7 +137,7 @@ syntax error, unexpected end-of-input
|
|
137
137
|
|
138
138
|
1 class Dog
|
139
139
|
2 def meals_last_month
|
140
|
-
|
140
|
+
> 3 puts 3 *
|
141
141
|
4 end
|
142
142
|
5 end
|
143
143
|
```
|
@@ -140,7 +140,7 @@ module SyntaxSuggest
|
|
140
140
|
# However due to https://github.com/ruby/syntax_suggest/issues/32
|
141
141
|
# the problem line will be identified as:
|
142
142
|
#
|
143
|
-
#
|
143
|
+
# > class Dog # 1
|
144
144
|
#
|
145
145
|
# Because lines 2, 3, and 4 are technically valid code and are expanded
|
146
146
|
# first, deemed valid, and hidden. We need to un-hide the matching end
|
@@ -200,7 +200,7 @@ module SyntaxSuggest
|
|
200
200
|
#
|
201
201
|
# the problem line will be identified as:
|
202
202
|
#
|
203
|
-
#
|
203
|
+
# > end # 4
|
204
204
|
#
|
205
205
|
# This happens because lines 1, 2, and 3 are technically valid code and are expanded
|
206
206
|
# first, deemed valid, and hidden. We need to un-hide the matching keyword on
|
data/lib/syntax_suggest/cli.rb
CHANGED
@@ -14,8 +14,8 @@ module SyntaxSuggest
|
|
14
14
|
# # =>
|
15
15
|
# 1
|
16
16
|
# 2 def cat
|
17
|
-
#
|
18
|
-
#
|
17
|
+
# > 3 Dir.chdir
|
18
|
+
# > 4 end
|
19
19
|
# 5 end
|
20
20
|
# 6
|
21
21
|
class DisplayCodeWithLineNumbers
|
@@ -50,7 +50,7 @@ module SyntaxSuggest
|
|
50
50
|
private def format(contents:, number:, empty:, highlight: false)
|
51
51
|
string = +""
|
52
52
|
string << if highlight
|
53
|
-
"
|
53
|
+
"> "
|
54
54
|
else
|
55
55
|
" "
|
56
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntax_suggest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schneems
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: When you get an "unexpected end" in your syntax this gem helps you find
|
14
14
|
it
|