Skip to content

Commit f085ce8

Browse files
committed
Revert "add safe checks of workspace process status before making calls"
This reverts commit cd4a20e.
1 parent 4910fc7 commit f085ce8

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextController.kt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ class ProjectContextController(private val project: Project, private val cs: Cor
5252
fun getProjectContextIndexComplete() = projectContextProvider.isIndexComplete.get()
5353

5454
suspend fun queryChat(prompt: String, timeout: Long?): List<RelevantDocument> {
55-
if (!getProjectContextIndexComplete()) {
56-
logger.warn { "attempt to query project context while index for ${project.name} isn't ready" }
57-
return emptyList()
58-
}
5955
try {
6056
return projectContextProvider.query(prompt, timeout)
6157
} catch (e: Exception) {
@@ -64,13 +60,8 @@ class ProjectContextController(private val project: Project, private val cs: Cor
6460
}
6561
}
6662

67-
suspend fun queryInline(query: String, filePath: String): List<InlineBm25Chunk> {
68-
if (!getProjectContextIndexComplete()) {
69-
logger.warn { "attempt to query project context while index for ${project.name} isn't ready" }
70-
return emptyList()
71-
}
72-
73-
return try {
63+
suspend fun queryInline(query: String, filePath: String): List<InlineBm25Chunk> =
64+
try {
7465
projectContextProvider.queryInline(query, filePath, InlineContextTarget.CODEMAP)
7566
} catch (e: Exception) {
7667
var logStr = "error while querying inline for project context $e.message"
@@ -80,14 +71,9 @@ class ProjectContextController(private val project: Project, private val cs: Cor
8071
logger.warn { logStr }
8172
emptyList()
8273
}
83-
}
8474

8575
@RequiresBackgroundThread
8676
fun updateIndex(filePaths: List<String>, mode: IndexUpdateMode) {
87-
if (!getProjectContextIndexComplete()) {
88-
return
89-
}
90-
9177
try {
9278
return projectContextProvider.updateIndex(filePaths, mode)
9379
} catch (e: Exception) {

0 commit comments

Comments
 (0)