Skip to content

Simplify Source Positions #5713

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

Merged
merged 102 commits into from
Jan 18, 2019
Merged
Changes from 1 commit
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
f21bd00
Rename nextId -> nextSymId in Context
odersky Dec 18, 2018
4e25176
Make nextTreeId counter a context field
odersky Dec 19, 2018
db6b9df
Adapt refelect.TreeOps to new scheme
odersky Dec 19, 2018
b2e17fd
@transientParam annotation
odersky Dec 19, 2018
75d338d
Apply @transientParam to compiler
odersky Dec 19, 2018
1a634c7
Produce tree ids in chunks
odersky Dec 19, 2018
c4ec3f6
Set source field of context directly
odersky Dec 19, 2018
e86057d
Make TreeCopiers preserve source
odersky Dec 19, 2018
6c13e88
Refactor getSource and withSource
odersky Dec 19, 2018
fc6daf0
Serialize source file changes
odersky Dec 20, 2018
3f938fb
Better caching of sources
odersky Dec 20, 2018
9e705e9
Allocate tree ids globally
odersky Dec 20, 2018
9abee3d
Follow source changes when unpickling
odersky Dec 21, 2018
945c296
Remove unpickleTypeTree
odersky Dec 23, 2018
c8454e5
Keep sourcefile info when pickling
odersky Dec 23, 2018
67786d0
Eliminate Decorators.sourcePos
odersky Dec 23, 2018
c85d707
Fix position of inline bodies in unpickler.
odersky Dec 25, 2018
eceeb1b
Lazy load contents of source position
odersky Dec 31, 2018
b62a156
Print full source positions in trees
odersky Dec 31, 2018
a68e776
Fix dropInlined
odersky Dec 31, 2018
36e0212
Check sources correspond under -Ytest-pickler
odersky Dec 31, 2018
b3ebfb2
Fix PositionPickler
odersky Dec 31, 2018
f0d1dfb
Make Inliner source-position aware
odersky Dec 31, 2018
3a23f4b
Fix Symbol#sourceFile
odersky Jan 1, 2019
6198884
Make PositionPickler work for shared trees
odersky Jan 1, 2019
7bb25bd
Make Modifiers not extend from Positioned
odersky Jan 2, 2019
4d3fa4a
Temporary hack to circumvent missing sourcefile info
odersky Jan 2, 2019
bae1f6b
Add source component to Positioned
odersky Jan 2, 2019
48f3367
Inliner tweaks
odersky Jan 2, 2019
7199965
withPos(Positioned) -> withPosOf
odersky Jan 3, 2019
cde9d60
Unpickler always takes source from context
odersky Jan 3, 2019
1b39bd0
withPos -> withSpan
odersky Jan 3, 2019
79eee51
Fix position pickler
odersky Jan 3, 2019
10a6db5
Harden IDE: Survive duplicate package and object
odersky Jan 3, 2019
8699aa7
Position -> Span
odersky Jan 3, 2019
2d7e819
Add missing check files
odersky Jan 3, 2019
50c3eef
Fix rebase breakage
odersky Jan 3, 2019
b136568
atPos -> atSpan
odersky Jan 3, 2019
a1a87d9
Rename SourcePos#pos -> SourcePos#span
odersky Jan 4, 2019
616bc85
Rename Span#pos -> Span#span
odersky Jan 4, 2019
f7c76c2
Rename Symbol#pos -> span, Comment#pos -> span
odersky Jan 4, 2019
7c99d35
Apply renamings to language server
odersky Jan 4, 2019
cc5e90c
Rename other uses of `pos` to `span`
odersky Jan 4, 2019
1404a4d
Polishings
odersky Jan 4, 2019
58d8fbc
Convert some checking methods to take Positioned arguments
odersky Jan 4, 2019
baf7dc1
Simplify Parser
odersky Jan 4, 2019
18eaae0
Fix rebase breakage
odersky Jan 6, 2019
b1462cc
Add missing source to context
nicolasstucki Jan 5, 2019
7d87656
Add missing contents to vitual files
nicolasstucki Jan 5, 2019
3de898e
Avoid memoization of virtual source files with same path
nicolasstucki Jan 5, 2019
bf6af32
Use non-virtual files in dottydoc tests
nicolasstucki Jan 6, 2019
e160073
Update test to use Spans
nicolasstucki Jan 6, 2019
57954c4
Update missing `pos` to `span`
nicolasstucki Jan 6, 2019
a8adf1b
Update implicit modifier test
nicolasstucki Jan 7, 2019
220a5fd
Add missing spans in closures
nicolasstucki Jan 7, 2019
ec322f6
Comment debug assertion
nicolasstucki Jan 7, 2019
f8be33f
Remove unnecessary workaround for repl
nicolasstucki Jan 7, 2019
14911e1
Fix rebase breakage
odersky Jan 9, 2019
70b5819
Avoid creating source positions in backend interface
odersky Jan 7, 2019
72a8765
Optimize computation of Sourcefile#content
odersky Jan 7, 2019
a22c366
Make SourceFile equals depend on file
odersky Jan 9, 2019
4cf02c5
Optimize equals + hashCode on PlainFile
odersky Jan 9, 2019
77b4b4c
Reduce concurrent hashmap lookups
odersky Jan 9, 2019
b915632
Refactor SourceFile operations
odersky Jan 9, 2019
e7c1d20
Optimize PlainFile.equals
odersky Jan 10, 2019
94b4b01
Implement -Ydebug-pos
odersky Jan 10, 2019
e021019
Revise PositionPickler
odersky Jan 10, 2019
570e95c
Fix rebase breakage
odersky Jan 10, 2019
a44d43f
Optimize initialPos in Positioned
odersky Jan 10, 2019
819f20f
Optimize SourceFile.fromId
odersky Jan 11, 2019
aabdc75
Optimize Symbol#source
odersky Jan 11, 2019
f740996
Use SourceFile implicits instead of SourceInfo
odersky Jan 11, 2019
a448629
Make virtual source files explicit
nicolasstucki Jan 14, 2019
fa3b4b9
Sourcefile refactoring
odersky Jan 14, 2019
729a3d1
Don't read contents when creating a source file
odersky Jan 14, 2019
ed45da0
Drop withPosOf and withSourcePos
odersky Jan 13, 2019
decc730
Don't ask defTree for Symbol's source after erasure
odersky Jan 15, 2019
1771a16
Fix diagnostics breakage
odersky Jan 15, 2019
17a901a
Simplify source positions
odersky Jan 15, 2019
fe2d3ae
Improve pickling of holes
odersky Jan 15, 2019
953a6b1
Avoid special cases in Positioned#envelope
odersky Jan 15, 2019
7100da8
Compare sourcefiles structurally
odersky Jan 15, 2019
7fa7a06
Add missing spans in Desugar
nicolasstucki Jan 16, 2019
e110858
Fixes after rebase
nicolasstucki Jan 16, 2019
c2acbf0
Add missing span for tab complete
nicolasstucki Jan 16, 2019
e2966a9
Add another missing span
nicolasstucki Jan 16, 2019
3558cb8
Inferred TypedSplice spans
nicolasstucki Jan 16, 2019
dec6b95
Use the same virtual file for parsing and compiling in REPL
nicolasstucki Jan 16, 2019
8e12771
Use the index in the repl state for the line module
nicolasstucki Jan 16, 2019
607ac1b
Revert "Add missing spans in Desugar"
nicolasstucki Jan 17, 2019
791eb2b
Add missing span when expanding FunctionAppliedTo
nicolasstucki Jan 17, 2019
cac4e18
Update to compile with latest master
odersky Jan 18, 2019
2244eb1
Add missing span when expanding FunctionAppliedTo
nicolasstucki Jan 18, 2019
4ef3cea
Optimization: change Array.copy to System.arrayCopy
odersky Jan 18, 2019
21b3904
Rename Parser.atPos -> atSpan
odersky Jan 18, 2019
360510c
Track source changes in TreeMap and TreeAccumulator
odersky Jan 18, 2019
829acf0
Address other review comments
odersky Jan 18, 2019
9fa170c
Rename transientParam -> constructorOnly
odersky Jan 18, 2019
8d3b7ef
Address overlooked comment
odersky Jan 18, 2019
652b570
Drop unnecessary compatibility hack
odersky Jan 18, 2019
570b26f
Talk consistently about spans in Parser
odersky Jan 18, 2019
fc2e654
Address more review comments
odersky Jan 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions compiler/src/dotty/tools/dotc/core/Symbols.scala
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,7 @@ object Symbols {
final def sourcePos(implicit ctx: Context): SourcePosition = {
val source = {
val f = sourceFile
if (f == null || f.isVirtual)
// don't trust virtual files for tree creation - replTest fails otherwise
ctx.source
if (f == null) ctx.source
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Relieved that we could remove this!

else ctx.getSource(f)
}
source.atSpan(span)
Expand Down