syntax_tree 3.6.0 → 3.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/Gemfile.lock +1 -1
- data/lib/syntax_tree/cli.rb +3 -10
- data/lib/syntax_tree/language_server.rb +20 -14
- data/lib/syntax_tree/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: bd7e771d65269c131d28cd381186bb1e437e677d823f1219bc99a04d96d318c9
|
4
|
+
data.tar.gz: 9be18db6c8108ce433ec1acc07d4bc5d47969cc8aeca04786b92911c6e9e11c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f195700c3fbb9cd65ddf5a041e1fff5454aa4dc589b712d74205c126dd807b21e108e4c3d072a5af222f0cb22d1f9f45cf0cb70189498e86fbe6c80013f25622
|
7
|
+
data.tar.gz: c85dcdff58830ec44d96cf66f7814df8549646c7e0d3a9ebcf2dee364f45e7a0a3c3b46198fb6f0791eed2fc87f0d0be973dcd4008d60ba17e2a50c6026d5de1
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [3.6.1] - 2022-09-28
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- [#161](https://github.com/ruby-syntax-tree/syntax_tree/pull/161) - Previously, we were checking if STDIN was a TTY to determine if there was content to be read. Instead, we now check if no filenames were passed, and in that case we attempt to read from STDIN. This should fix errors users were experiencing in non-TTY environments like CI.
|
14
|
+
- [#162](https://github.com/ruby-syntax-tree/syntax_tree/pull/162) - Parse errors shouldn't crash the language server anymore.
|
15
|
+
|
9
16
|
## [3.6.0] - 2022-09-19
|
10
17
|
|
11
18
|
### Added
|
@@ -350,7 +357,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
350
357
|
|
351
358
|
- 🎉 Initial release! 🎉
|
352
359
|
|
353
|
-
[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.6.
|
360
|
+
[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.6.1...HEAD
|
361
|
+
[3.6.1]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.6.0...v3.6.1
|
354
362
|
[3.6.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.5.0...v3.6.0
|
355
363
|
[3.5.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.4.0...v3.5.0
|
356
364
|
[3.4.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v3.3.0...v3.4.0
|
data/Gemfile.lock
CHANGED
data/lib/syntax_tree/cli.rb
CHANGED
@@ -423,19 +423,12 @@ module SyntaxTree
|
|
423
423
|
return 1
|
424
424
|
end
|
425
425
|
|
426
|
-
# If we're not reading from stdin and the user didn't supply any
|
427
|
-
# filepaths to be read, then we exit with the usage message.
|
428
|
-
if $stdin.tty? && arguments.empty? && options.scripts.empty?
|
429
|
-
warn(HELP)
|
430
|
-
return 1
|
431
|
-
end
|
432
|
-
|
433
426
|
# We're going to build up a queue of items to process.
|
434
427
|
queue = Queue.new
|
435
428
|
|
436
|
-
# If
|
437
|
-
#
|
438
|
-
if
|
429
|
+
# If there are any arguments or scripts, then we'll add those to the
|
430
|
+
# queue. Otherwise we'll read the content off STDIN.
|
431
|
+
if arguments.any? || options.scripts.any?
|
439
432
|
arguments.each do |pattern|
|
440
433
|
Dir
|
441
434
|
.glob(pattern)
|
@@ -56,10 +56,10 @@ module SyntaxTree
|
|
56
56
|
store.delete(uri)
|
57
57
|
in { method: "textDocument/formatting", id:, params: { textDocument: { uri: } } }
|
58
58
|
contents = store[uri]
|
59
|
-
write(id: id, result: contents ?
|
59
|
+
write(id: id, result: contents ? format(contents, uri.split(".").last) : nil)
|
60
60
|
in { method: "textDocument/inlayHint", id:, params: { textDocument: { uri: } } }
|
61
61
|
contents = store[uri]
|
62
|
-
write(id: id, result: contents ? inlay_hints(
|
62
|
+
write(id: id, result: contents ? inlay_hints(contents) : nil)
|
63
63
|
in { method: "syntaxTree/visualizing", id:, params: { textDocument: { uri: } } }
|
64
64
|
write(id: id, result: PP.pp(SyntaxTree.parse(store[uri]), +""))
|
65
65
|
in { method: %r{\$/.+} }
|
@@ -89,19 +89,25 @@ module SyntaxTree
|
|
89
89
|
def format(source, extension)
|
90
90
|
text = SyntaxTree::HANDLERS[".#{extension}"].format(source, print_width)
|
91
91
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
[
|
93
|
+
{
|
94
|
+
range: {
|
95
|
+
start: {
|
96
|
+
line: 0,
|
97
|
+
character: 0
|
98
|
+
},
|
99
|
+
end: {
|
100
|
+
line: source.lines.size + 1,
|
101
|
+
character: 0
|
102
|
+
}
|
97
103
|
},
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
104
|
+
newText: text
|
105
|
+
}
|
106
|
+
]
|
107
|
+
rescue Parser::ParseError
|
108
|
+
# If there is a parse error, then we're not going to return any formatting
|
109
|
+
# changes for this source.
|
110
|
+
nil
|
105
111
|
end
|
106
112
|
|
107
113
|
def inlay_hints(source)
|
data/lib/syntax_tree/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntax_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Newton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prettier_print
|