ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "hsbt (Hiroshi SHIBATA)" <noreply@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:110100] [Ruby master Bug#19016] syntax_suggest is not working with Ruby 3.2.0-preview2
Date: Tue, 27 Sep 2022 06:47:12 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-99358.20220927064710.572@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-19016.20220922094727.572@ruby-lang.org

Issue #19016 has been updated by hsbt (Hiroshi SHIBATA).


@mame try to fix this `ThreadError` at https://github.com/ruby/ruby/pull/6452

----------------------------------------
Bug #19016: syntax_suggest is not working with Ruby 3.2.0-preview2
https://bugs.ruby-lang.org/issues/19016#change-99358

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
`syntax_suggest` is merged as default gems in Ruby 3.2.0-preview2. But it's not working yet.

```
$ cat bar.rb
def foo
  def bar
end

$ ruby -v bar.rb
ruby 3.2.0dev (2022-09-22T05:37:56Z master f07e651a90) +YJIT [arm64-darwin22]
bar.rb:3: warning: mismatched indentations at 'end' with 'def' at 2
bar.rb:3: syntax error, unexpected end-of-input, expecting `end'
```

and gem version is also not working now.

```
$ cat foo.rb
require "bundler/inline"

gemfile do
  source "https://rubygems.org"
  gem "syntax_suggest"
end

require_relative "bar"
```

```
$ ruby -v foo.rb
ruby 3.2.0dev (2022-09-22T05:37:56Z master f07e651a90) +YJIT [arm64-darwin22]
/path/to/bar.rb:3: warning: mismatched indentations at 'end' with 'def' at 2
foo.rb:8:in `require_relative': /path/to/bar.rb:3: syntax error, unexpected end-of-input, expecting `end' (SyntaxError)
        from foo.rb:8:in `<main>'
```

But Ruby 3.1 is works.

```
$ ruby -v foo.rb
ruby 3.1.3p51 (2022-09-10 revision 9581248c4a) [arm64-darwin22]
/path/to/bar.rb:3: warning: mismatched indentations at 'end' with 'def' at 2
--> /path/to/bar.rb

Unmatched keyword, missing `end' ?

  1  def foo
❯ 2    def bar
  3  end

/Users/hsbt/.local/share/gem/gems/syntax_suggest-0.0.1/lib/syntax_suggest/core_ext.rb:93:in `require': /path/to/bar.rb:3: syntax error, unexpected end-of-input, expecting `end' (SyntaxError)
        from /Users/hsbt/.local/share/gem/gems/syntax_suggest-0.0.1/lib/syntax_suggest/core_ext.rb:93:in `require_relative'
        from foo.rb:8:in `<main>'
```




-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2022-09-27  6:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  9:47 [ruby-core:109995] [Ruby master Bug#19016] syntax_suggest is not working with Ruby 3.2.0-preview2 hsbt (Hiroshi SHIBATA)
2022-09-27  3:49 ` [ruby-core:110099] " hsbt (Hiroshi SHIBATA)
2022-09-27  6:47 ` hsbt (Hiroshi SHIBATA) [this message]
2022-09-27  8:10 ` [ruby-core:110103] " mame (Yusuke Endoh)
2022-09-27 18:25 ` [ruby-core:110111] " Eregon (Benoit Daloze)
2022-10-06 14:35 ` [ruby-core:110210] " mame (Yusuke Endoh)
2022-10-06 16:02 ` [ruby-core:110214] " Eregon (Benoit Daloze)
2022-10-07 21:44 ` [ruby-core:110233] " schneems (Richard Schneeman)
2022-11-14  2:32 ` [ruby-core:110738] " hsbt (Hiroshi SHIBATA)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-99358.20220927064710.572@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).