For a given global.Symbol, .sourceFile may return null, whereas pos.source (when the latter is defined) returns a value. Quite certainly a small compiler quirk. Right now the code only looks at .sourceFile. Observed for https://github.com/allenai/pipeline.
So in those cases (seems to be rare) where only pos.source has the path, then we likely miss out on correlating a symbol to a given source and location. Worst, as it currently stands we also deduce whether a symbol is external v.s. project-defined by this value.
So we should likely grab .pos.source if it has something, when .sourceFile does not - everywhere that the latter is currently being used. Which means wrap this all as our own getSourcePath(global.Symbol): Option[String] method somewhere.
For a given
global.Symbol,.sourceFilemay return null, whereaspos.source(when the latter is defined) returns a value. Quite certainly a small compiler quirk. Right now the code only looks at.sourceFile. Observed for https://github.com/allenai/pipeline.So in those cases (seems to be rare) where only
pos.sourcehas the path, then we likely miss out on correlating a symbol to a given source and location. Worst, as it currently stands we also deduce whether a symbol is external v.s. project-defined by this value.So we should likely grab
.pos.sourceif it has something, when.sourceFiledoes not - everywhere that the latter is currently being used. Which means wrap this all as our owngetSourcePath(global.Symbol): Option[String]method somewhere.