Skip to content

Conversation

@Will-ShaoHua Will-ShaoHua requested a review from a team as a code owner October 17, 2024 08:50
@Will-ShaoHua Will-ShaoHua mentioned this pull request Oct 17, 2024
6 tasks
@Will-ShaoHua Will-ShaoHua marked this pull request as draft October 17, 2024 12:28
rli pushed a commit that referenced this pull request Oct 18, 2024
}

// takeLast(11) will extract 10 lines (exclusing current line) of left context as the query parameter
fun generateQuery(fileContext: FileContextInfo) = fileContext.caretContext.leftFileContext.split("\n").takeLast(11).joinToString("\n")

Check notice

Code scanning / QDJVMC

Class member can have 'private' visibility Note

Function 'generateQuery' could be private
Copy link
Contributor Author

@Will-ShaoHua Will-ShaoHua Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wanna add test for this query fun later so leave it public for now.

@Will-ShaoHua Will-ShaoHua requested a review from leigaol October 22, 2024 18:18
@leigaol
Copy link
Contributor

leigaol commented Oct 22, 2024

unit test fixes.

change log item like vsc

}
}

private object NaiveSampleCase {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sg, thanks for the info richard, i will do it in a followup

@Will-ShaoHua
Copy link
Contributor Author

Will-ShaoHua commented Oct 23, 2024

test failed due to

java.lang.AssertionError: Thread leaked: Thread[#38,DefaultDispatcher-worker-5 @software.aws.toolkits.jetbrains.services.amazonq.project.ProjectContextController#1087,5,main] (alive) WAITING
--- its stacktrace:
 at java.base/sun.nio.ch.Net.poll(Native Method)
 at java.base/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:191)
 at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:280)
 at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:304)
 at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
 at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
 at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1099)
 at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:489)
 at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:483)
 at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
 at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
 at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1506)
 at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1421)
 at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
 at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
 at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:586)
 at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
 at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1675)
 at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599)
 at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:531)
 at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:307)
 at com.intellij.util.io.HttpRequests.openConnection(HttpRequests.java:626)
 at com.intellij.util.io.HttpRequests$RequestImpl.getConnection(HttpRequests.java:366)
 at com.intellij.util.io.HttpRequests$RequestImpl.doReadBytes(HttpRequests.java:442)
 at com.intellij.util.io.HttpRequests$RequestImpl.readString(HttpRequests.java:431)
 at com.intellij.util.io.RequestBuilder.lambda$readString$5(RequestBuilder.java:85)
 at com.intellij.util.io.HttpRequests.doProcess(HttpRequests.java:529)
 at com.intellij.util.io.HttpRequests.process(HttpRequests.java:511)
 at com.intellij.util.io.HttpRequests$RequestBuilderImpl.connect(HttpRequests.java:340)
 at com.intellij.util.io.RequestBuilder.readString(RequestBuilder.java:85)
 at com.intellij.util.io.RequestBuilder.readString(RequestBuilder.java:89)
 at software.aws.toolkits.jetbrains.core.HttpUtilsKt.getTextFromUrl(HttpUtils.kt:18)
 at software.aws.toolkits.jetbrains.services.amazonq.project.manifest.ManifestManager.fetchFromRemoteAndSave(ManifestManager.kt:100)
 at software.aws.toolkits.jetbrains.services.amazonq.project.manifest.ManifestManager.getManifest(ManifestManager.kt:68)
 at software.aws.toolkits.jetbrains.services.amazonq.project.EncoderServer.downloadArtifactsIfNeeded(EncoderServer.kt:155)
 at software.aws.toolkits.jetbrains.services.amazonq.project.EncoderServer.downloadArtifactsAndStartServer(EncoderServer.kt:59)
 at software.aws.toolkits.jetbrains.services.amazonq.project.ProjectContextController$initJob$1.invokeSuspend(ProjectContextController.kt:28)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
 at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
---
(its trace after 10 seconds wait:) Thread[#38,DefaultDispatcher-worker-5 @software.aws.toolkits.jetbrains.services.amazonq.project.ProjectContextController#1087,5,main] (alive) WAITING

@Will-ShaoHua
Copy link
Contributor Author

Will-ShaoHua commented Oct 23, 2024

thread leak fix #5003

@Will-ShaoHua Will-ShaoHua requested a review from rli October 23, 2024 16:25
@Will-ShaoHua Will-ShaoHua changed the title feat(amazonq): Add project context to inline completion config(amazonq): Add project context to inline completion Oct 23, 2024
@Will-ShaoHua Will-ShaoHua requested a review from leigaol October 23, 2024 21:14
@rli rli merged commit 41965f8 into aws:main Oct 24, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants