Is your feature request related to a problem? Please describe.
Certain file types need to be opened in certain mode like ihex:// srec:// jar:// and so on. Opening them as file:// will result in completely wrong result.
Describe the solution you'd like
Create a list of typical extensions for the IO modes where it makes sense. And add some sanity checks or warnings if user tries to do something which is probably wrong.
Keep in mind that
not all io modes have meaningful extension
and sometimes user might want to open a file as raw file even if there is a suitable IO mode
some formats with known extensions, might also be often used with wide range of less common extension or no extension at all
While adding this information it might be also useful to add a flag whether io mode expects file at all.
Describe alternatives you've considered
a) show a warning if there is a more likely IO mode for current file extension
b) After user selects a file, automatically switch to more likely IO mode base on extension if there is one. Don't change anything if extension doesn't have any reasonable guesses. Either way they can still override the IO mode afterwards if guess was wrong or they want to do something unusual.
c) secretly switch the mode under the hood when IO mode is set to file://
d) when opening a file directly without the initial window use the best guess for choosing IO mode.
Additional context
I am unsure about approach c). In ideal world user wouldn't need to manually choose anything, on other hand the file:// IO mode has a specific meaning. Changing the meaning behind the scenes can cause more misunderstandings, and it's less clear how to override things when guesses aren't good enough. b) is probably better as it achieves similar thing while being more explicit to the user of what's happening.
Partially related problem #2204 , but that one might require a more custom solution compared to the file extension check suggested here.
Is your feature request related to a problem? Please describe.
Certain file types need to be opened in certain mode like ihex:// srec:// jar:// and so on. Opening them as file:// will result in completely wrong result.
Describe the solution you'd like
Create a list of typical extensions for the IO modes where it makes sense. And add some sanity checks or warnings if user tries to do something which is probably wrong.
Keep in mind that
While adding this information it might be also useful to add a flag whether io mode expects file at all.
Describe alternatives you've considered
a) show a warning if there is a more likely IO mode for current file extension b) After user selects a file, automatically switch to more likely IO mode base on extension if there is one. Don't change anything if extension doesn't have any reasonable guesses. Either way they can still override the IO mode afterwards if guess was wrong or they want to do something unusual. c) secretly switch the mode under the hood when IO mode is set to file:// d) when opening a file directly without the initial window use the best guess for choosing IO mode.
Additional context
I am unsure about approach c). In ideal world user wouldn't need to manually choose anything, on other hand the file:// IO mode has a specific meaning. Changing the meaning behind the scenes can cause more misunderstandings, and it's less clear how to override things when guesses aren't good enough. b) is probably better as it achieves similar thing while being more explicit to the user of what's happening.
Partially related problem #2204 , but that one might require a more custom solution compared to the file extension check suggested here.