You can find what editor is assigned to a given file extension, and tell the editor to open files or folders.
The current implementation is for macOS only.