Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sourceCode to TASTy reflect Position #5870

Merged

Conversation

nicolasstucki
Copy link
Contributor

Partial fix for #5782:

  • get the ~raw code of arguments of the root context (in def foo(s: Seq[Int])(implicit foo: Foo), with the implicit materialization of Foo backed by a macro - how can the macro get a String "(1 to 10).sum" in f((1 to 10).sum)?). Prevents to have sourcecode.Text work fine.

@nicolasstucki
Copy link
Contributor Author

@alexarchambault could you have a look at this to see if it is enough for the sourcecode macros.

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test with nested macros? Otherwise, LGTM

Partial fix for scala#5782:
* get the ~raw code of arguments of the root context (in `def foo(s: Seq[Int])(implicit foo: Foo)`, with the implicit materialization of `Foo` backed by a macro - how can the macro get a String `"(1 to 10).sum"` in `f((1 to 10).sum)`?). Prevents to have `sourcecode.Text` work fine.
@nicolasstucki nicolasstucki force-pushed the tasty-reflect-get-source-at-position branch from 0c09917 to c6876ff Compare February 12, 2019 09:59
@nicolasstucki
Copy link
Contributor Author

Currently, the positions of nested trees are wrong. I added #5904 to track this other issue.

@nicolasstucki nicolasstucki merged commit 66f57a0 into scala:master Feb 12, 2019
@ghost ghost removed the stat:needs review label Feb 12, 2019
@nicolasstucki nicolasstucki deleted the tasty-reflect-get-source-at-position branch February 12, 2019 12:02
alexarchambault added a commit to alexarchambault/sourcecode that referenced this pull request Mar 13, 2019
alexarchambault added a commit to alexarchambault/sourcecode that referenced this pull request Mar 13, 2019
alexarchambault added a commit to alexarchambault/sourcecode that referenced this pull request Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants