Skip to content

Commit 1e29a19

Browse files
committed
add parentheses to all non-arg java methods
1 parent a48a3af commit 1e29a19

20 files changed

+39
-39
lines changed

presentation-compiler/src/main/dotty/tools/pc/CompilerSearchVisitor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CompilerSearchVisitor(
1717
)(using ctx: Context, reports: ReportContext)
1818
extends SymbolSearchVisitor:
1919

20-
val logger: Logger = Logger.getLogger(classOf[CompilerSearchVisitor].getName.nn).nn
20+
val logger: Logger = Logger.getLogger(classOf[CompilerSearchVisitor].getName().nn).nn
2121

2222
private def isAccessible(sym: Symbol): Boolean = try
2323
sym != NoSymbol && sym.isPublic && sym.isStatic

presentation-compiler/src/main/dotty/tools/pc/CompletionItemResolver.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ object CompletionItemResolver extends ItemResolver:
6060
else ""
6161
val companion = gsym.companion
6262
if companion == NoSymbol || gsym.is(JavaDefined) then
63-
if gsymDoc.isEmpty then
63+
if gsymDoc.isEmpty() then
6464
if gsym.isAliasType then
6565
fullDocstring(gsym.info.metalsDealias.typeSymbol, search)
6666
else if gsym.is(Method) then
@@ -73,8 +73,8 @@ object CompletionItemResolver extends ItemResolver:
7373
else gsymDoc
7474
else
7575
val companionDoc = docs(companion)
76-
if companionDoc.isEmpty then gsymDoc
77-
else if gsymDoc.isEmpty then companionDoc
76+
if companionDoc.isEmpty() then gsymDoc
77+
else if gsymDoc.isEmpty() then companionDoc
7878
else
7979
List(
8080
s"""|### ${keyword(companion)} ${companion.name}

presentation-compiler/src/main/dotty/tools/pc/HoverProvider.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ object HoverProvider:
7878
)
7979
end report
8080
reportContext.unsanitized.create(report, ifVerbose = true)
81-
ju.Optional.empty.nn
81+
ju.Optional.empty().nn
8282
else
8383
val skipCheckOnName =
8484
!pos.isPoint // don't check isHoveringOnName for RangeHover
@@ -146,7 +146,7 @@ object HoverProvider:
146146
)
147147
).nn
148148
case _ =>
149-
ju.Optional.empty.nn
149+
ju.Optional.empty().nn
150150
end match
151151
end match
152152
end if
@@ -189,7 +189,7 @@ object HoverProvider:
189189

190190
refTpe.flatMap(findRefinement).asJava
191191
case _ =>
192-
ju.Optional.empty.nn
192+
ju.Optional.empty().nn
193193

194194
end HoverProvider
195195

presentation-compiler/src/main/dotty/tools/pc/InferredTypeProvider.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ final class InferredTypeProvider(
6767

6868
val sourceText = adjustOpt.map(_.text).getOrElse(params.text.nn)
6969
val source =
70-
SourceFile.virtual(filePath.toString, sourceText)
70+
SourceFile.virtual(filePath.toString(), sourceText)
7171
driver.run(uri, source)
7272
val unit = driver.currentCtx.run.nn.units.head
7373
val pos = driver.sourcePosition(params)
@@ -308,7 +308,7 @@ final class InferredTypeProvider(
308308
val end = if withBacktick then idx + 1 else idx
309309
val pos = tree.source.atSpan(Span(start, end, start))
310310
Some(pos)
311-
case None if idx < text.length =>
311+
case None if idx < text.length() =>
312312
val ch = text.charAt(idx)
313313
if ch == realName.head then
314314
lookup(idx + 1, Some((idx, realName.tail)), withBacktick)

presentation-compiler/src/main/dotty/tools/pc/MetalsDriver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class MetalsDriver(
4848

4949
override def run(uri: URI, sourceCode: String): List[Diagnostic] =
5050
val diags =
51-
if alreadyCompiled(uri, sourceCode.toCharArray.nn) then Nil
51+
if alreadyCompiled(uri, sourceCode.toCharArray().nn) then Nil
5252
else super.run(uri, sourceCode)
5353
lastCompiledURI = uri
5454
diags

presentation-compiler/src/main/dotty/tools/pc/PcCollector.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ abstract class PcCollector[T](
3737
val filePath = Paths.get(uri).nn
3838
val sourceText = params.text.nn
3939
val source =
40-
SourceFile.virtual(filePath.toString, sourceText)
40+
SourceFile.virtual(filePath.toString(), sourceText)
4141
driver.run(uri, source)
4242
given ctx: Context = driver.currentCtx
4343

presentation-compiler/src/main/dotty/tools/pc/PcDefinitionProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class PcDefinitionProvider(
5454
if findTypeDef then findTypeDefinitions(path, pos, indexedContext)
5555
else findDefinitions(path, pos, indexedContext)
5656

57-
if result.locations.nn.isEmpty then fallbackToUntyped(pos)(using ctx)
57+
if result.locations.nn.isEmpty() then fallbackToUntyped(pos)(using ctx)
5858
else result
5959
end definitions
6060

presentation-compiler/src/main/dotty/tools/pc/PcInlineValueProviderImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class PcInlineValueProviderImpl(
2727
) extends PcCollector[Occurence](driver, params)
2828
with InlineValueProvider:
2929

30-
val text = params.text.nn.toCharArray.nn
30+
val text = params.text.nn.toCharArray().nn
3131

3232
val position: l.Position = pos.toLsp.getStart.nn
3333

presentation-compiler/src/main/dotty/tools/pc/SemanticdbTextDocumentProvider.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SemanticdbTextDocumentProvider(
2929
val validCode = removeMagicImports(sourceCode, filePath)
3030
driver.run(
3131
uri,
32-
SourceFile.virtual(filePath.toString, validCode)
32+
SourceFile.virtual(filePath.toString(), validCode)
3333
)
3434
val tree = driver.currentCtx.run.nn.units.head.tpdTree
3535
val extractor = ExtractSemanticDB.Extractor()
@@ -42,7 +42,7 @@ class SemanticdbTextDocumentProvider(
4242
if Properties.isWin then relativeUri.toString().replace("\\", "/")
4343
else relativeUri.toString()
4444
}
45-
.getOrElse(filePath.toString)
45+
.getOrElse(filePath.toString())
4646

4747
val document = TextDocument(
4848
schema = Schema.SEMANTICDB4,
@@ -57,7 +57,7 @@ class SemanticdbTextDocumentProvider(
5757
val out = SemanticdbOutputStream.newInstance(byteStream)
5858
document.writeTo(out)
5959
out.flush()
60-
byteStream.toByteArray.nn
60+
byteStream.toByteArray().nn
6161
end textDocument
6262

6363
end SemanticdbTextDocumentProvider

presentation-compiler/src/main/dotty/tools/pc/SignatureHelpProvider.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ object SignatureHelpProvider:
175175
info
176176

177177
private def markupContent(content: String): l.MarkupContent | Null =
178-
if content.isEmpty then null
178+
if content.isEmpty() then null
179179
else
180180
val markup = new l.MarkupContent
181181
markup.setKind("markdown")
182-
markup.setValue(content.trim)
182+
markup.setValue(content.trim())
183183
markup
184184

185185
end SignatureHelpProvider

0 commit comments

Comments
 (0)