Skip to content

Commit 30d7c9c

Browse files
committed
detekt
1 parent 2e3ad80 commit 30d7c9c

File tree

1 file changed

+6
-9
lines changed
  • plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp

1 file changed

+6
-9
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class AmazonQLspService(private val project: Project, private val cs: CoroutineS
9292
private val launcherFuture: Future<Void>
9393
private val launcherHandler: KillableProcessHandler
9494

95-
private fun createClientCapabilities(): ClientCapabilities {
96-
return ClientCapabilities().apply {
95+
private fun createClientCapabilities(): ClientCapabilities =
96+
ClientCapabilities().apply {
9797
textDocument = TextDocumentClientCapabilities().apply {
9898
// For didSaveTextDocument, other textDocument/ messages always mandatory
9999
synchronization = SynchronizationCapabilities().apply {
@@ -114,19 +114,17 @@ class AmazonQLspService(private val project: Project, private val cs: CoroutineS
114114
}
115115
}
116116
}
117-
}
118117

119118
// needs case handling when project's base path is null: default projects/unit tests
120-
private fun createWorkspaceFolders(): List<WorkspaceFolder> {
121-
return project.basePath?.let { basePath ->
119+
private fun createWorkspaceFolders(): List<WorkspaceFolder> =
120+
project.basePath?.let { basePath ->
122121
listOf(
123122
WorkspaceFolder(
124123
URI("file://$basePath").toString(),
125124
project.name
126125
)
127126
)
128127
} ?: emptyList() // no folders to report or workspace not folder based
129-
}
130128

131129
private fun createClientInfo(): ClientInfo {
132130
val metadata = ClientMetadata.getDefault()
@@ -136,15 +134,14 @@ class AmazonQLspService(private val project: Project, private val cs: CoroutineS
136134
}
137135
}
138136

139-
private fun createInitializeParams(): InitializeParams {
140-
return InitializeParams().apply {
137+
private fun createInitializeParams(): InitializeParams =
138+
InitializeParams().apply {
141139
processId = ProcessHandle.current().pid().toInt()
142140
capabilities = createClientCapabilities()
143141
clientInfo = createClientInfo()
144142
workspaceFolders = createWorkspaceFolders()
145143
initializationOptions = createExtendedClientMetadata()
146144
}
147-
}
148145

149146
init {
150147
val cmd = GeneralCommandLine("amazon-q-lsp")

0 commit comments

Comments
 (0)