summaryrefslogtreecommitdiff
path: root/lib/syntax_suggest/api.rb
AgeCommit message (Collapse)Author
2024-11-15[ruby/syntax_suggest] Fix missing line break due to puts logicSchneems
In #225 it was reported that the output looks incorrect: ``` $ cat /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb def x.y.z end $ ruby /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb: --> /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb expected a delimiter to close the parametersunexpected '.', ignoring it > 1 def x.y.z > 2 end ``` Specifically: ``` expected a delimiter to close the parametersunexpected '.', ignoring it ``` However this does not show up when executing the debug executable: ``` $ bin/bundle exec exe/syntax_suggest /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb --> /tmp/4a71c7e417cc9eac0971e3a2519b295c/scratch.rb expected a delimiter to close the parameters unexpected '.', ignoring it > 1 def x.y.z > 2 end ``` This is because `exe/syntax_suggest` uses STDOUT.puts while calling `ruby` with the filename uses a fake IO object represented by MiniStringIO. This class was incorrectly not adding a newline to the end of the print. The fix was to move the class to it's own file where it can be tested and then fix the behavior. close https://github.com/ruby/syntax_suggest/pull/225 https://github.com/ruby/syntax_suggest/commit/d2ecd94a3b Co-authored-by: Andy Yong <[email protected]>
2023-12-05[ruby/syntax_suggest] Update docs, clean up PRSchneems
Removes or updates mentions of Ripper https://github.com/ruby/syntax_suggest/commit/08aaa3f50a
2023-12-05[ruby/syntax_suggest] Support lexing with PrismSchneems
https://github.com/ruby/syntax_suggest/commit/7f4176a914
2023-12-05[ruby/syntax_suggest] Initial support for the prism parserSchneems
Prism will be the parser in Ruby 3.3. We need to support 3.0+ so we will have to "dual boot" both parsers. Todo: - LexAll to support Prism lex output - Add tests that exercise both Ripper and prism codepaths on CI - Handle https://github.com/ruby/prism/issues/1972 in `ripper_errors.rb` - Update docs to not mention Ripper explicitly - Consider different/cleaner APIs for separating out Ripper and Prism https://github.com/ruby/syntax_suggest/commit/a7d6991cc4
2023-05-23[ruby/syntax_suggest] Fix warning messageschneems
The env var DEBUG does not work to produce detailed output. It is SYNTAX_SUGGEST_DEBUG. It was changed as part of the dead_end to syntax_suggest migration for Ruby 3.2 https://github.com/ruby/syntax_suggest/commit/c41da7aab7
2023-04-06[ruby/syntax_suggest] Handle alias already exists when debuggingschneems
When `tmp/alias` already exists, I'm now getting phantom folders in the directory pointing at older aliases which is distracting/confusing. By checking and removing that alias before symlinking we can prevent this strange behavior (possibly caused by newer Mac OS?).
2022-08-19Sync SyntaxSuggestschneems
``` $ tool/sync_default_gems.rb syntax_suggest ``` Notes: Merged: https://github.com/ruby/ruby/pull/5859