-
Notifications
You must be signed in to change notification settings - Fork 273
fix(amazonq): change to use withExtensionFilter to hide unallowed files #5909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -0,0 +1,4 @@ | |||
{ | |||
"type" : "bugfix", | |||
"description" : "change to use withExtensionFilter to hide unallowed files when selecting image" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description" : "change to use withExtensionFilter to hide unallowed files when selecting image" | |
"description" : "Fix unsupported files being shown in file picker when selecting images for adding image context in Windows" |
if (isExtensionFilterSupported()) { | ||
// Use reflection to call withExtensionFilter which is only available in 2024.3+ | ||
try { | ||
val method = this.javaClass.getMethod("withExtensionFilter", String::class.java, Array<String>::class.java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have different source modules that support code compatibility based on versions. Instead of using reflection, we can use those? This code can be added to src-243+. Will this still be an issue on 242?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
* The withExtensionFilter method was introduced in IntelliJ Platform 2024.3 (baseline version 243). | ||
* For older versions, fall back to withFileFilter which provides similar functionality | ||
*/ | ||
interface FileChooserCompat { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this interface, can we just add a separate function in the separate modules?
Types of changes
Description
Problem
Solution
Starting Version 2024.3, use
withExtensionFilter
to hide unallowed files.Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.