Skip to content

ReadPositions when unpickling a coord of a symbol #8987

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

Closed

Conversation

bishabosha
Copy link
Member

pre requisite for #8983

@bishabosha bishabosha requested a review from smarter May 15, 2020 16:59
@@ -531,7 +531,7 @@ class TreeUnpickler(reader: TastyReader,
def complete(denot: SymDenotation)(implicit ctx: Context) =
denot.info = typeReader.readType()
}
val sym = ctx.newSymbol(ctx.owner, name, Flags.Case, completer, coord = coordAt(start))
val sym = ctx.newSymbol(ctx.owner, name, Flags.Case, completer, coord = coordAt(start)(ctx.addMode(Mode.ReadPositions)))
Copy link
Member

Choose a reason for hiding this comment

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

addMode is somewhat expensive since it will require making a copy of the Context if the mode isn't already present. Maybe coordAt should have an extra parameter to force reading the position even if ReadPosition isn't set. I think we should discuss the purpose of ReadPosition in the next meeting because I don't recall the details.

@nicolasstucki
Copy link
Contributor

test performance please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 0 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/8987/ to see the changes.

Benchmarks is based on merging with master (9450bf2)

@bishabosha
Copy link
Member Author

bishabosha commented May 18, 2020

how about putting a method in Context that is true if -Ysemanticdb or ReadModes is set (or any other similar setting)?

@smarter
Copy link
Member

smarter commented May 18, 2020

More direct: If -Ysemanticdb is set, then enable ReadPositions globally

@bishabosha
Copy link
Member Author

Enabling ReadPositions in Compiler.newRun also triggered correctly the sourcePathAt in TreeUnpickler, which then exposed the same semanticdb bugs fixed in #8983 , so I'll implement the change there

@bishabosha bishabosha closed this May 19, 2020
@bishabosha bishabosha deleted the read-positions-for-coord branch May 19, 2020 09:21
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.

4 participants