Skip to content

Commit dc1e127

Browse files
committed
traverse parents if span exists
1 parent 69f3d60 commit dc1e127

File tree

5 files changed

+46
-53
lines changed

5 files changed

+46
-53
lines changed

compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,8 @@ class ExtractSemanticDB extends Phase with
170170
if !excludeDef(ctorSym)
171171
registerDefinition(ctorSym, tree.constr.span, Set.empty)
172172
ctorParams(tree.constr.vparamss, tree.body)(traverseCtorParamTpt(ctorSym, _))
173-
for parent <- tree.parentsOrDerived do
174-
if
175-
parent.symbol != defn.ObjectClass.primaryConstructor
176-
&& parent.tpe.dealias != defn.SerializableType
177-
&& parent.symbol != defn.ProductClass
178-
then
179-
traverse(parent)
173+
for parent <- tree.parentsOrDerived if parent.span.hasLength do
174+
traverse(parent)
180175
val selfSpan = tree.self.span
181176
if selfSpan.exists && selfSpan.hasLength then
182177
traverse(tree.self)

compiler/src/dotty/tools/dotc/semanticdb/Tools.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ object Tools with
4343
val realURI = realPath.toString
4444
given SourceFile = SourceFile.virtual(doc.uri, doc.text)
4545
sb.append(realURI).nl
46-
sb.append("_" * realURI.length).nl
46+
sb.append("-" * realURI.length).nl
4747
sb.nl
4848
sb.append("Summary:").nl
4949
sb.append("Schema => ").append(schemaString(doc.schema)).nl
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package example
22

3-
class FilenameWithSpaces/*<-example::FilenameWithSpaces#*//*<=example.FilenameWithSpaces#*/
3+
class FilenameWithSpaces/*<-example::FilenameWithSpaces#*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package example
22

3-
class FilenameWithSpaces/*<=example.FilenameWithSpaces#*/
3+
class FilenameWithSpaces

0 commit comments

Comments
 (0)