syntax_suggest 2.0.1 → 2.0.2
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/.github/dependabot.yml +2 -0
- data/.github/workflows/check_changelog.yml +1 -1
- data/.github/workflows/ci.yml +3 -3
- data/CHANGELOG.md +4 -0
- data/lib/syntax_suggest/api.rb +1 -0
- data/lib/syntax_suggest/capture_code_context.rb +1 -1
- data/lib/syntax_suggest/clean_document.rb +1 -1
- data/lib/syntax_suggest/code_frontier.rb +1 -1
- data/lib/syntax_suggest/core_ext.rb +0 -18
- data/lib/syntax_suggest/mini_stringio.rb +30 -0
- data/lib/syntax_suggest/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31364a29219b203328a466f55c6053c42aab83e79df39eeffc40755d6a33de9c
|
4
|
+
data.tar.gz: 1e169f8b9ab90c79b4c12cec51218fc41b6d1629e43749f212a40743690a1a8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e88d0cdc9c56b1df7316434ef2b14e2c761eba7cbf8608f1cd4e98c074f7505622d18ef9ba39e6b9737da8d8d6a98fe79d0031f0b6b99feedb984fc83aeddad
|
7
|
+
data.tar.gz: 79cf1b4f31fb231c3a56c06157604bb29d0f38ea18c635ef3d02b9ada8e80ec4387489608ef921d97bfa7cb16dbefecb6ece1c50d0895096cda3427ebc352f64
|
data/.github/dependabot.yml
CHANGED
@@ -13,7 +13,7 @@ jobs:
|
|
13
13
|
!contains(github.event.pull_request.body, '[skip ci]') &&
|
14
14
|
!contains(github.event.pull_request.labels.*.name, 'skip changelog')
|
15
15
|
steps:
|
16
|
-
- uses: actions/checkout@v4.2.
|
16
|
+
- uses: actions/checkout@v4.2.2
|
17
17
|
- name: Check that CHANGELOG is touched
|
18
18
|
run: |
|
19
19
|
git fetch origin ${{ github.base_ref }} --depth 1 && \
|
data/.github/workflows/ci.yml
CHANGED
@@ -9,7 +9,7 @@ jobs:
|
|
9
9
|
runs-on: ubuntu-latest
|
10
10
|
steps:
|
11
11
|
- name: Checkout code
|
12
|
-
uses: actions/checkout@v4.2.
|
12
|
+
uses: actions/checkout@v4.2.2
|
13
13
|
- name: Set up Ruby
|
14
14
|
uses: ruby/setup-ruby@v1
|
15
15
|
with:
|
@@ -34,7 +34,7 @@ jobs:
|
|
34
34
|
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
|
35
35
|
steps:
|
36
36
|
- name: Checkout code
|
37
|
-
uses: actions/checkout@v4.2.
|
37
|
+
uses: actions/checkout@v4.2.2
|
38
38
|
- name: Set up Ruby
|
39
39
|
uses: ruby/setup-ruby@v1
|
40
40
|
with:
|
@@ -53,7 +53,7 @@ jobs:
|
|
53
53
|
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
|
54
54
|
steps:
|
55
55
|
- name: Checkout code
|
56
|
-
uses: actions/checkout@v4.2.
|
56
|
+
uses: actions/checkout@v4.2.2
|
57
57
|
- name: Set up Ruby
|
58
58
|
uses: ruby/setup-ruby@v1
|
59
59
|
with:
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## HEAD (unreleased)
|
2
2
|
|
3
|
+
## 2.0.2
|
4
|
+
|
5
|
+
- Fix: Separate multiple parser errors by newline. (https://github.com/ruby/syntax_suggest/pull/232)
|
6
|
+
|
3
7
|
## 2.0.1
|
4
8
|
|
5
9
|
- Fix CLI failure when shipped with default gems. (https://github.com/ruby/syntax_suggest/pull/226 and https://github.com/ruby/syntax_suggest/pull/227)
|
data/lib/syntax_suggest/api.rb
CHANGED
@@ -227,6 +227,7 @@ require_relative "lex_all"
|
|
227
227
|
require_relative "code_line"
|
228
228
|
require_relative "code_block"
|
229
229
|
require_relative "block_expand"
|
230
|
+
require_relative "mini_stringio"
|
230
231
|
require_relative "priority_queue"
|
231
232
|
require_relative "unvisited_lines"
|
232
233
|
require_relative "around_block_scan"
|
@@ -8,7 +8,7 @@ module SyntaxSuggest
|
|
8
8
|
#
|
9
9
|
# 1. Sanitize/format input source
|
10
10
|
# 2. Search for invalid blocks
|
11
|
-
# 3. Format invalid blocks into something
|
11
|
+
# 3. Format invalid blocks into something meaningful
|
12
12
|
#
|
13
13
|
# The Code frontier is a critical part of the second step
|
14
14
|
#
|
@@ -3,24 +3,6 @@
|
|
3
3
|
# Ruby 3.2+ has a cleaner way to hook into Ruby that doesn't use `require`
|
4
4
|
if SyntaxError.method_defined?(:detailed_message)
|
5
5
|
module SyntaxSuggest
|
6
|
-
# Mini String IO [Private]
|
7
|
-
#
|
8
|
-
# Acts like a StringIO with reduced API, but without having to require that
|
9
|
-
# class.
|
10
|
-
class MiniStringIO
|
11
|
-
def initialize(isatty: $stderr.isatty)
|
12
|
-
@string = +""
|
13
|
-
@isatty = isatty
|
14
|
-
end
|
15
|
-
|
16
|
-
attr_reader :isatty
|
17
|
-
def puts(value = $/, **)
|
18
|
-
@string << value
|
19
|
-
end
|
20
|
-
|
21
|
-
attr_reader :string
|
22
|
-
end
|
23
|
-
|
24
6
|
# SyntaxSuggest.module_for_detailed_message [Private]
|
25
7
|
#
|
26
8
|
# Used to monkeypatch SyntaxError via Module.prepend
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SyntaxSuggest
|
4
|
+
# Mini String IO [Private]
|
5
|
+
#
|
6
|
+
# Acts like a StringIO with reduced API, but without having to require that
|
7
|
+
# class.
|
8
|
+
#
|
9
|
+
# The original codebase emitted directly to $stderr, but now SyntaxError#detailed_message
|
10
|
+
# needs a string output. To accomplish that we kept the original print infrastructure in place and
|
11
|
+
# added this class to accumulate the print output into a string.
|
12
|
+
class MiniStringIO
|
13
|
+
EMPTY_ARG = Object.new
|
14
|
+
|
15
|
+
def initialize(isatty: $stderr.isatty)
|
16
|
+
@string = +""
|
17
|
+
@isatty = isatty
|
18
|
+
end
|
19
|
+
|
20
|
+
attr_reader :isatty
|
21
|
+
def puts(value = EMPTY_ARG, **)
|
22
|
+
if !value.equal?(EMPTY_ARG)
|
23
|
+
@string << value
|
24
|
+
end
|
25
|
+
@string << $/
|
26
|
+
end
|
27
|
+
|
28
|
+
attr_reader :string
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntax_suggest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schneems
|
8
|
+
autorequire:
|
8
9
|
bindir: exe
|
9
10
|
cert_chain: []
|
10
|
-
date: 2024-
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
11
12
|
dependencies: []
|
12
13
|
description: When you get an "unexpected end" in your syntax this gem helps you find
|
13
14
|
it
|
@@ -56,6 +57,7 @@ files:
|
|
56
57
|
- lib/syntax_suggest/left_right_lex_count.rb
|
57
58
|
- lib/syntax_suggest/lex_all.rb
|
58
59
|
- lib/syntax_suggest/lex_value.rb
|
60
|
+
- lib/syntax_suggest/mini_stringio.rb
|
59
61
|
- lib/syntax_suggest/parse_blocks_from_indent_line.rb
|
60
62
|
- lib/syntax_suggest/pathname_from_message.rb
|
61
63
|
- lib/syntax_suggest/priority_engulf_queue.rb
|
@@ -71,6 +73,7 @@ licenses:
|
|
71
73
|
metadata:
|
72
74
|
homepage_uri: https://github.com/ruby/syntax_suggest.git
|
73
75
|
source_code_uri: https://github.com/ruby/syntax_suggest.git
|
76
|
+
post_install_message:
|
74
77
|
rdoc_options: []
|
75
78
|
require_paths:
|
76
79
|
- lib
|
@@ -85,7 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
88
|
- !ruby/object:Gem::Version
|
86
89
|
version: '0'
|
87
90
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
91
|
+
rubygems_version: 3.5.23
|
92
|
+
signing_key:
|
89
93
|
specification_version: 4
|
90
94
|
summary: Find syntax errors in your source in a snap
|
91
95
|
test_files: []
|