ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:110513] [Ruby master Feature#19083] Add `node_id_for_location` to ast.c
@ 2022-10-25 13:38 eileencodes (Eileen Uchitelle)
  2022-10-29 15:25 ` [ruby-core:110544] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` " eileencodes (Eileen Uchitelle)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: eileencodes (Eileen Uchitelle) @ 2022-10-25 13:38 UTC (permalink / raw
  To: ruby-core

Issue #19083 has been reported by eileencodes (Eileen Uchitelle).

----------------------------------------
Feature #19083: Add `node_id_for_location` to ast.c
https://bugs.ruby-lang.org/issues/19083

* Author: eileencodes (Eileen Uchitelle)
* Status: Open
* Priority: Normal
----------------------------------------
Opening a ticket to get public comments on https://github.com/ruby/ruby/pull/6593. I worked on this with Aaron Patterson.

We want to use error highlight with eval'd code, specifically ERB templates. We're able to recover the generated code for eval'd templates and can get a parse tree for the ERB generated code, but we don't have a way to get the node id from the backtrace location. So we can't pass the right node into error highlight.

This patch gives us an API to get the node id from the backtrace location so we can find the node in the AST.

This change is needed for column info in ERB templates that Aaron worked on here https://github.com/rails/rails/pull/46171. Without this change we need to set `RubyVM.keep_script_lines = true`. With the changes here we should be able to remove keep_script_lines.



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:110544] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` to ast.c
  2022-10-25 13:38 [ruby-core:110513] [Ruby master Feature#19083] Add `node_id_for_location` to ast.c eileencodes (Eileen Uchitelle)
@ 2022-10-29 15:25 ` eileencodes (Eileen Uchitelle)
  2022-10-31  2:04 ` [ruby-core:110550] " matz (Yukihiro Matsumoto)
  2022-10-31  4:40 ` [ruby-core:110553] " mame (Yusuke Endoh)
  2 siblings, 0 replies; 4+ messages in thread
From: eileencodes (Eileen Uchitelle) @ 2022-10-29 15:25 UTC (permalink / raw
  To: ruby-core

Issue #19083 has been updated by eileencodes (Eileen Uchitelle).

File 0001-Add-node_id_for_backtrace_location-function.patch added
Subject changed from Add `node_id_for_location` to ast.c to Add `node_id_for_backtrace_location` to ast.c

I've update the function name from node_id_for_location to node_id_for_backtrace_location. Also I attached the patch here.

----------------------------------------
Feature #19083: Add `node_id_for_backtrace_location` to ast.c
https://bugs.ruby-lang.org/issues/19083#change-99873

* Author: eileencodes (Eileen Uchitelle)
* Status: Open
* Priority: Normal
----------------------------------------
Opening a ticket to get public comments on https://github.com/ruby/ruby/pull/6593. I worked on this with Aaron Patterson.

We want to use error highlight with eval'd code, specifically ERB templates. We're able to recover the generated code for eval'd templates and can get a parse tree for the ERB generated code, but we don't have a way to get the node id from the backtrace location. So we can't pass the right node into error highlight.

This patch gives us an API to get the node id from the backtrace location so we can find the node in the AST.

This change is needed for column info in ERB templates that Aaron worked on here https://github.com/rails/rails/pull/46171. Without this change we need to set `RubyVM.keep_script_lines = true`. With the changes here we should be able to remove keep_script_lines.

---Files--------------------------------
0001-Add-node_id_for_backtrace_location-function.patch (3.07 KB)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:110550] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` to ast.c
  2022-10-25 13:38 [ruby-core:110513] [Ruby master Feature#19083] Add `node_id_for_location` to ast.c eileencodes (Eileen Uchitelle)
  2022-10-29 15:25 ` [ruby-core:110544] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` " eileencodes (Eileen Uchitelle)
@ 2022-10-31  2:04 ` matz (Yukihiro Matsumoto)
  2022-10-31  4:40 ` [ruby-core:110553] " mame (Yusuke Endoh)
  2 siblings, 0 replies; 4+ messages in thread
From: matz (Yukihiro Matsumoto) @ 2022-10-31  2:04 UTC (permalink / raw
  To: ruby-core

Issue #19083 has been updated by matz (Yukihiro Matsumoto).


Sounds OK. Please merge.

Matz.


----------------------------------------
Feature #19083: Add `node_id_for_backtrace_location` to ast.c
https://bugs.ruby-lang.org/issues/19083#change-99878

* Author: eileencodes (Eileen Uchitelle)
* Status: Open
* Priority: Normal
----------------------------------------
Opening a ticket to get public comments on https://github.com/ruby/ruby/pull/6593. I worked on this with Aaron Patterson.

We want to use error highlight with eval'd code, specifically ERB templates. We're able to recover the generated code for eval'd templates and can get a parse tree for the ERB generated code, but we don't have a way to get the node id from the backtrace location. So we can't pass the right node into error highlight.

This patch gives us an API to get the node id from the backtrace location so we can find the node in the AST.

This change is needed for column info in ERB templates that Aaron worked on here https://github.com/rails/rails/pull/46171. Without this change we need to set `RubyVM.keep_script_lines = true`. With the changes here we should be able to remove keep_script_lines.

---Files--------------------------------
0001-Add-node_id_for_backtrace_location-function.patch (3.07 KB)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:110553] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` to ast.c
  2022-10-25 13:38 [ruby-core:110513] [Ruby master Feature#19083] Add `node_id_for_location` to ast.c eileencodes (Eileen Uchitelle)
  2022-10-29 15:25 ` [ruby-core:110544] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` " eileencodes (Eileen Uchitelle)
  2022-10-31  2:04 ` [ruby-core:110550] " matz (Yukihiro Matsumoto)
@ 2022-10-31  4:40 ` mame (Yusuke Endoh)
  2 siblings, 0 replies; 4+ messages in thread
From: mame (Yusuke Endoh) @ 2022-10-31  4:40 UTC (permalink / raw
  To: ruby-core

Issue #19083 has been updated by mame (Yusuke Endoh).

Status changed from Open to Closed

Thank you all! I have merged the PR at commit:3391c51effcd61f9a718adf59740661d99f57b5b

----------------------------------------
Feature #19083: Add `node_id_for_backtrace_location` to ast.c
https://bugs.ruby-lang.org/issues/19083#change-99881

* Author: eileencodes (Eileen Uchitelle)
* Status: Closed
* Priority: Normal
----------------------------------------
Opening a ticket to get public comments on https://github.com/ruby/ruby/pull/6593. I worked on this with Aaron Patterson.

We want to use error highlight with eval'd code, specifically ERB templates. We're able to recover the generated code for eval'd templates and can get a parse tree for the ERB generated code, but we don't have a way to get the node id from the backtrace location. So we can't pass the right node into error highlight.

This patch gives us an API to get the node id from the backtrace location so we can find the node in the AST.

This change is needed for column info in ERB templates that Aaron worked on here https://github.com/rails/rails/pull/46171. Without this change we need to set `RubyVM.keep_script_lines = true`. With the changes here we should be able to remove keep_script_lines.

---Files--------------------------------
0001-Add-node_id_for_backtrace_location-function.patch (3.07 KB)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-31  4:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-25 13:38 [ruby-core:110513] [Ruby master Feature#19083] Add `node_id_for_location` to ast.c eileencodes (Eileen Uchitelle)
2022-10-29 15:25 ` [ruby-core:110544] [Ruby master Feature#19083] Add `node_id_for_backtrace_location` " eileencodes (Eileen Uchitelle)
2022-10-31  2:04 ` [ruby-core:110550] " matz (Yukihiro Matsumoto)
2022-10-31  4:40 ` [ruby-core:110553] " mame (Yusuke Endoh)

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).