Skip to content

Conversation

rli
Copy link
Contributor

@rli rli commented Aug 29, 2025

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

rli and others added 30 commits March 6, 2025 11:32
…anes on local or remote (#5463)

* Fixing bugs IDE-16164 and IDE-16163
…#5489)

https://developer.mozilla.org/en-US/docs/Web/API/Clipboard
`navigator.clipboard` is only accessible from a "secure context", which JCEF does not think we are using,
because the URI authority is not localhost or https. Since we are hooking onto the CEF resource request handler,
it does not matter what we use for the scheme/authority as long as there is no conflict with real resources.

Previous implementation used a different load mechanism which somehow met the secure context criteria.
aws-toolkit-automation and others added 25 commits August 6, 2025 18:16
on remote, it can take 10+ seconds for chat to be visible.

additionally, delete some unneeded assets to slightly reduce load time
Per internal discussion, feature deemed not ready for external users due to https://youtrack.jetbrains.com/issue/IJPL-203169
@rli rli requested review from a team as code owners August 29, 2025 21:58
Copy link

github-actions bot commented Aug 29, 2025

Qodana Community for JVM

13 new problems were found

Inspection name Severity Problems
Unstable API Usage 🔶 Warning 6
Extension class should be final and non-public 🔶 Warning 2
ActionUpdateThread is missing 🔶 Warning 1
Unused symbol 🔶 Warning 1
Private property naming convention ◽️ Notice 2
Boolean expression can be simplified ◽️ Notice 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@@ -139,7 +142,7 @@

ApplicationManager.getApplication().invokeAndWait {
selectionRange = ApplicationManager.getApplication().runReadAction<Range?> {
val editor = FileEditorManager.getInstance(project).selectedTextEditor
val editor = FileEditorManager.getInstance(project).selectedTextEditorWithRemotes.firstOrNull()

Check warning

Code scanning / QDJVMC

Unstable API Usage Warning

'getSelectedTextEditorWithRemotes()' is marked unstable with @ApiStatus.Experimental
@@ -217,7 +217,7 @@
logger.debug { "$FEATURE_NAME: Processing InsertCodeAtCursorPosition: $message" }

withContext(EDT) {
val editor: Editor = FileEditorManager.getInstance(context.project).selectedTextEditor ?: return@withContext
val editor: Editor = FileEditorManager.getInstance(context.project).selectedTextEditorWithRemotes.firstOrNull() ?: return@withContext

Check warning

Code scanning / QDJVMC

Unstable API Usage Warning

'getSelectedTextEditorWithRemotes()' is marked unstable with @ApiStatus.Experimental
@@ -178,7 +178,7 @@

override suspend fun processInsertCodeAtCursorPosition(message: IncomingCwcMessage.InsertCodeAtCursorPosition) {
withContext(EDT) {
val editor: Editor = FileEditorManager.getInstance(context.project).selectedTextEditor ?: return@withContext
val editor: Editor = FileEditorManager.getInstance(context.project).selectedTextEditorWithRemotes.firstOrNull() ?: return@withContext

Check warning

Code scanning / QDJVMC

Unstable API Usage Warning

'getSelectedTextEditorWithRemotes()' is marked unstable with @ApiStatus.Experimental
val editor = computeOnEdt {
FileEditorManager.getInstance(project).selectedTextEditor
when {
isRunningOnRemoteBackend() -> editorManager.selectedTextEditorWithRemotes.firstOrNull()

Check warning

Code scanning / QDJVMC

Unstable API Usage Warning

'getSelectedTextEditorWithRemotes()' is marked unstable with @ApiStatus.Experimental
val editor = computeOnEdt {
FileEditorManager.getInstance(project).selectedTextEditor
when {
isRunningOnRemoteBackend() -> editorManager.selectedTextEditorWithRemotes.firstOrNull()

Check warning

Code scanning / QDJVMC

Unstable API Usage Warning

'getSelectedTextEditorWithRemotes()' is marked unstable with @ApiStatus.Experimental
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow

class DefaultProblemsViewMutator : ProblemsViewMutator {

Check warning

Code scanning / QDJVMC

Extension class should be final and non-public Warning

Extension class should not be public
) : CefRequestHandlerAdapter() {
private val myResources: MutableMap<String, () -> CefResourceHandler?> = HashMap()

private val REJECTING_RESOURCE_HANDLER: CefResourceHandler = object : CefResourceHandlerAdapter() {

Check notice

Code scanning / QDJVMC

Private property naming convention Note

Private property name REJECTING_RESOURCE_HANDLER should not contain underscores in the middle or the end
}
}

private val RESOURCE_REQUEST_HANDLER = resourceHandlerWrapper { path ->

Check notice

Code scanning / QDJVMC

Private property naming convention Note

Private property name RESOURCE_REQUEST_HANDLER should not contain underscores in the middle or the end
private fun streamHandler(path: String, stream: InputStream) =
JBCefStreamResourceHandler(
stream,
if (path.endsWith(".wasm") == true) "application/wasm" else URLConnection.getFileNameMap().getContentTypeFor(path),

Check notice

Code scanning / QDJVMC

Boolean expression can be simplified Note

Boolean expression can be simplified
}
}

fun addResource(path: String, stream: InputStream?) =

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Function "addResource" is never used
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.

4 participants