Save FileDialog on Linux does not update the file endings when you select possible file types
This is a long-standing inconvenience.

I don't really know where to start to look into this.
I looked into a few examples. On Windows it appears that the default tools that have "Save as" abilities such as Paint/Snipping Tool do this extension change when the filter changes. In Fedora 36 I tested LibreOffice writer, and it handle this differently, with the extension being completely hidden, and simply chosen from the drop down, with only a file name being specified by the user.
Changing the extension is something that we could implement using:
void
gtk_file_chooser_set_current_name (
GtkFileChooser* chooser,
const gchar* name
)
However, I'm not sure how Windows/Cocoa SWT behaves currently. If someone else can comment on that we can begin discussing this further.
On Windows (and Mac) it will always match the file ending to the combo box selection

which is why I thought this is a bug
I found that this has been brought up before https://bugs.eclipse.org/bugs/show_bug.cgi?id=578096. GTK isn't providing a signal that we can use when a filter is changed so instead I tried hooking notify::filter to a callback but it never gets called. This is something that might work in FileChooserDialog, but we currently use GtkFileChooserNative. From the GTK docs on GtkFileChooserNative, "No operations that change the dialog work while the dialog is visible. Set all the properties that are required before showing the dialog".
I created an issue in the GNOME gtk repository (https://gitlab.gnome.org/GNOME/gtk/-/issues/4626) earlier this year in January but it has gotten no attention.
I was able to modify the snippet that was included in this issue https://gitlab.gnome.org/GNOME/gtk/-/issues/1820 to modify the file name when a filter is changed using the notify signal.
However, this only works with GtkFileChooserDialog and not GtkFileChooserNative which we currently use to allow Eclipse to support flatpak. I see no notify signal emitted from the native file chooser.
I thought this was a good beginners task, but it doesn't look like it. Could there maybe be a parallel FileDialog and NativeFileDialog for when Flatpak matters vs. when a non-broken extension switcher matters more?
@akurtakov Is this a feature (autoextending file extension) that would be worth it to have, but that would require two code paths for flatpak vs non flatpak?
@joel-majano Is the issue present with Gtk 4.x too? The feature is nice but right now we can't afford maintaining 2 codepaths, esp if issue is not there with Gtk4.
@akurtakov Yes the issue is still present. I tested with the snippet #171 provided and in GTK4.6.3 changing the filter does not change the extension.
I have just tested under KDE on Fedora on GTK 4 to see nice surprise :
https://github.com/user-attachments/assets/5e3c22ea-2e83-4bc9-8e44-386d6d7d5789
Unfortunately it doesn't work with Gtk dialog.
Base on https://gitlab.gnome.org/GNOME/gtk/-/issues/5367 the feature is totally "optional" . It's worth investigating what other gtk apps are doing as mentioned in it and try to replicate it.