Skip to content

Commit 7ae6c6e

Browse files
committed
Fix issue with non jvm compatible characters
1 parent 88871af commit 7ae6c6e

File tree

7 files changed

+179
-130
lines changed

7 files changed

+179
-130
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package example
2+
3+
class BinaryOp {
4+
1 #:: 2 #:: Stream.empty
5+
}

semanticdb/input/src/main/scala/example/MethodUsages.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package example
22

33
class MethodUsages {
44
val m = new Methods[Int]
5-
m.m1
5+
/*m.m1
66
m.m2()
77
m.m3(0)
88
m.m4(0)(0)
@@ -13,7 +13,7 @@ class MethodUsages {
1313
m.m6(Nil)
1414
m.m7a(m, new m.List[Int])
1515
m.m7b(new m.List[Int])
16-
m.`m8().`()
16+
*/m.`m8().`()/*
1717
m.m9(null)
1818
m.m10(null)
1919
m.m11(Predef)
@@ -29,5 +29,5 @@ class MethodUsages {
2929
m.m17("")
3030
m.m18.m()
3131
m.m18(1)
32-
m.m18("")
32+
m.m18("")*/
3333
}

semanticdb/input/src/main/scala/example/Synthetic.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ class Synthetic {
4343
b <- scala.concurrent.Future.successful(2)
4444
if a < b
4545
} yield a
46-
4746
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package example
2+
3+
import scala.language.existentials
4+
import scala.language.higherKinds
5+
6+
object TypBug {
7+
class M {
8+
def m: Int = ???
9+
}
10+
class C extends M {
11+
case class RepeatedType(s: String*) {
12+
def m1(x: Int*): Int = s.length
13+
}
14+
}
15+
}

semanticdb/src/dotty/semanticdb/SemanticdbConsumer.scala

Lines changed: 116 additions & 94 deletions
Large diffs are not rendered by default.

semanticdb/test/dotty/semanticdb/Semanticdbs.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ object Semanticdbs {
8787
occurrences.foreach { occ =>
8888
val range = occ.range.get
8989
val end = sourceFile.lineToOffset(range.endLine) + range.endCharacter
90-
//println(occ)
9190
sb.append(doc.text.substring(offset, end))
9291
sb.append(" /* ")
9392
.append(occ.symbol)
@@ -118,7 +117,14 @@ object Semanticdbs {
118117
a.startCharacter,
119118
b.startCharacter
120119
)
121-
byCharacter
120+
if (byCharacter == 0) {
121+
Integer.compare(
122+
a.endCharacter,
123+
b.endCharacter
124+
)
125+
} else {
126+
byCharacter
127+
}
122128
}
123129
}
124130
}

semanticdb/test/dotty/semanticdb/Tests.scala

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -175,36 +175,38 @@ class Tests {
175175
}
176176

177177

178-
//@Test def testAccess(): Unit = checkFile("example/Access.scala")
179-
//@Test def testAdvanced(): Unit = checkFile("example/Advanced.scala")
180-
//@Test def testAnonymous(): Unit = checkFile("example/Anonymous.scala")
181-
//@Test def testClasses(): Unit = checkFile("example/Classes.scala")
182-
//@Test def testEmpty(): Unit = checkFile("example/Empty.scala")
183-
//@Test def testEmptyObject(): Unit = checkFile("example/EmptyObject.scala")
184-
//@Test def testExample(): Unit = checkFile("example/Example.scala")
185-
//@Test def testExample2(): Unit = checkFile("example/Example2.scala")
186-
//@Test def testExclude(): Unit = checkFile("example/Exclude.scala")
187-
//WIP @Test def testFlags(): Unit = checkFile("example/Flags.scala")
188-
//@Test def testImports(): Unit = checkFile("example/Imports.scala")
189-
//@Test def testIssue1749(): Unit = checkFile("example/Issue1749.scala")
190-
//@Test def testLocalFile(): Unit = checkFile("example/local-file.scala")
191-
//@Test def testLocals(): Unit = checkFile("example/Locals.scala")
192-
//@Test def testMacroAnnotations(): Unit = checkFile("example/MacroAnnotations.scala")
193-
//WIP(assert) @Test def testMethods(): Unit = checkFile("example/Methods.scala")
194-
//@Test def testMultiArguments(): Unit = checkFile("example/MultiArguments.scala")
195-
//@Test def testMethodUsages(): Unit = checkFile("example/MethodUsages.scala")
196-
//def testObjects(): Unit = checkFile("example/Objects.scala")
197-
//@Test def testOverrides(): Unit = checkFile("example/Overrides.scala")
178+
/*@Test def testAccess(): Unit = checkFile("example/Access.scala")
179+
@Test def testAdvanced(): Unit = checkFile("example/Advanced.scala")
180+
@Test def testAnonymous(): Unit = checkFile("example/Anonymous.scala")
181+
@Test def testClasses(): Unit = checkFile("example/Classes.scala")
182+
@Test def testEmpty(): Unit = checkFile("example/Empty.scala")
183+
@Test def testEmptyObject(): Unit = checkFile("example/EmptyObject.scala")
184+
@Test def testExample(): Unit = checkFile("example/Example.scala")
185+
@Test def testExample2(): Unit = checkFile("example/Example2.scala")
186+
@Test def testExclude(): Unit = checkFile("example/Exclude.scala")
187+
@Test def testFlags(): Unit = checkFile("example/Flags.scala")
188+
@Test def testImports(): Unit = checkFile("example/Imports.scala")
189+
@Test def testIssue1749(): Unit = checkFile("example/Issue1749.scala")
190+
@Test def testLocalFile(): Unit = checkFile("example/local-file.scala")
191+
@Test def testLocals(): Unit = checkFile("example/Locals.scala")
192+
@Test def testMacroAnnotations(): Unit = checkFile("example/MacroAnnotations.scala")
193+
@Test def testMethods(): Unit = checkFile("example/Methods.scala")
194+
@Test def testMultiArguments(): Unit = checkFile("example/MultiArguments.scala")
195+
@Test def testObjects(): Unit = checkFile("example/Objects.scala")
196+
@Test def testOverrides(): Unit = checkFile("example/Overrides.scala")
198197
@Test def testPrefixes(): Unit = checkFile("example/Prefixes.scala")
199-
//@Test def testSelfs(): Unit = checkFile("example/Selfs.scala")
200-
//@Test def testSelfUse(): Unit = checkFile("example/SelfUse.scala")
198+
@Test def testSelfs(): Unit = checkFile("example/Selfs.scala")
199+
@Test def testSelfUse(): Unit = checkFile("example/SelfUse.scala")
200+
@Test def testTraits(): Unit = checkFile("example/Traits.scala")
201+
@Test def testTypes(): Unit = checkFile("example/Types.scala")
202+
@Test def testVals(): Unit = checkFile("example/Vals.scala")
203+
@Test def testDependantModule(): Unit = checkFile("example/DependantModule.scala")
204+
@Test def testNew(): Unit = checkFile("example/New.scala")
205+
@Test def testIgnoredSymbol(): Unit = checkFile("example/IgnoredSymbol.scala")
206+
@Test def testCase(): Unit = checkFile("example/Case.scala")
207+
@Test def testApply(): Unit = checkFile("example/Apply.scala")
208+
@Test def testTypeBug(): Unit = checkFile("example/TypeBug.scala")*/
201209
//@Test def testSynthetic(): Unit = checkFile("example/Synthetic.scala")
202-
//WIP @Test def testTraits(): Unit = checkFile("example/Traits.scala")
203-
//@Test def testTypes(): Unit = checkFile("example/Types.scala")
204-
//@Test def testVals(): Unit = checkFile("example/Vals.scala")
205-
//@Test def testDependantModule(): Unit = checkFile("example/DependantModule.scala")
206-
//@Test def testNew(): Unit = checkFile("example/New.scala")
207-
//@Test def testIgnoredSymbol(): Unit = checkFile("example/IgnoredSymbol.scala")
208-
//@Test def testCase(): Unit = checkFile("example/Case.scala")
209-
//@Test def testApply(): Unit = checkFile("example/Apply.scala")
210+
//@Test def testBinaryOp(): Unit = checkFile("example/BinaryOp.scala")
211+
@Test def testMethodUsages(): Unit = checkFile("example/MethodUsages.scala")
210212
}

0 commit comments

Comments
 (0)