vaticle / typedb-studio

TypeDB Studio (IDE)
https://typedb.com
Mozilla Public License 2.0
186 stars 43 forks source link

File associations (support opening .tql files from file browser) #662

Open jamesreprise opened 1 year ago

jamesreprise commented 1 year ago

Problem to Solve

After installing TypeDB Studio, .tql files aren't bound to any particular program. Manually informing macOS that Studio can open .tql files and double clicking them doesn't render the expected behaviour (opening the parent folder as a project and opening the requested .tql file.)

Current Workaround

Open Studio, open a project folder, open the .tql file.

Proposed Solution

Inform the OS during installation that TypeDB Studio can open .tql files. Support starting TypeDB Studio with file arguments.

Additional Information

We will want to integrate this into the install process, and this will vary per OS.

alexjpwalker commented 1 year ago

Looks like this might be pleasantly straightforward! https://stackoverflow.com/questions/57950442/how-to-use-file-associations-with-jpackage

Here is what the packager lists in its own help:

--file-associations — Path to a Properties file that contains list of key, value pairs (absolute path or relative to the current directory). The keys "extension", "mime-type", "icon", and "description" can be used to describe the association. This option can be used multiple times.

Of course, there is then also the matter of programming TypeDB Studio to respond appropriately when we ask to "open a file in TypeDB Studio".