Open mikl opened 6 years ago
Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.
Seems reasonable! I think we have it setup for certain app types (as listed in the package.json
) but not generally to appear in that "Open With" context menu.
I know the same functionality was added to the Windows binary so I expect we'd want feature parity when possible. (Only reason I didn't add it to Mac was since I'm unable to test it there and on Windows its done with registy keys which isn't applicable outside Windows).
@mikl thanks for the opening this so we can track this 👍. We actually use electron-builder
's config settings to register oni
as a default filetype on macOS but we have to manually specify the filetypes and I think at present that list is just
"fileAssociations": [
{
"ext": "js",
"name": "javascript",
"role": "Editor",
"isPackage": true
},
{
"ext": "json",
"name": "JSON",
"role": "Editor",
"isPackage": true
},
{
"ext": "jsx",
"name": "JSX",
"role": "Editor",
"isPackage": true
},
{
"ext": "py",
"name": "Python",
"role": "Editor",
"isPackage": true
},
{
"ext": "go",
"name": "Go Lang",
"role": "Editor",
"isPackage": true
},
{
"ext": "re",
"name": "Reason",
"role": "Editor",
"isPackage": true
},
{
"ext": "vim",
"name": "VimL",
"role": "Editor",
"isPackage": true
},
{
"ext": "ts",
"name": "Typescript",
"role": "Editor",
"isPackage": true
},
{
"ext": "tsx",
"name": "Typescript",
"role": "Editor",
"isPackage": true
},
{
"ext": "css",
"name": "CSS",
"role": "Editor",
"isPackage": true
},
{
"ext": "txt",
"name": "Text",
"role": "Editor",
"isPackage": true
},
{
"ext": "md",
"name": "Markdown",
"role": "Editor",
"isPackage": true
}
]
Very open to adding more it'd be great to have oni show up with more filetypes, which ones did you have in mind? (unfortunately I dont think theres a catch all)
I was looking at what Atom does (it also being an Electron app), and they simply have a (much) longer list of file extensions, and they also have a wildcard in there: https://github.com/atom/atom/blob/master/resources/mac/atom-Info.plist#L1521
This part might also be significant
<key>CFBundleTypeRole</key>
<string>Editor</string>
Ok, I’ll take a stab at extending the electron-builder
settings to have more supported file extensions and also some of the special keys I’ve seen in other apps.
That'd be great! Thanks for the help, @mikl 👍
First PR is up.
@mikl Did your PR address this issue?
I know very little of macOS app development, so this is a suggestion for now…
A nice “Quality of Life” improvement for users on macOS would be for Oni to register itself as an editor for everything, so it always shows up in “Open with…” like I have a bunch of other apps doing in this screenshot:
I don’t know the mechanism for this, but it appears to be something any app can do (even if it makes very little sense, as is the case with “Day One” or “Notes.app” in this example), and it would be a huge help for Oni users on the Mac, since otherwise you have to select “Other” and find the app manually for every new file type.