UTI registrations are wrong #1169
Description
Instructions: Replace the template text and remove irrelevant text (including this line)
Describe the bug
The registration of UTIs in Info.plist is done wrong. This messes up the launch services database for the users, which can lead to all kind of problems when handling files, not just in MacVim, but any app that may need to handle any of the types declared by MacVim. In particular, the Exported Types should only contain custom types owned by MacVim. All third party types and built in types should only be declared as Imported Types. Otherwise MacVim takes ownership of them, overruling the true owners of the type, which is extremely rude. In fact, standard built-in types should not be declared at all, in particular types starting with public. What is worse, MacVim declares some types with errors. In particular, com.adobe.postscript is declared as inheriting from public.plain-text. This is absolutely wrong, as PostScript it is not plain text. It only inherits from public.data. This makes the postscript type unusable for any app that wants to use the type, and breaks the system of your users.
Environment (please complete the following information):
- Vim version 8.2.2156
Additional context
Add any other context about the problem here.
Activity
ychin commentedon Feb 5, 2021
Yeah I think this is the same as #916. This should probably be fixed as this as it's kind of broken. I'll look into this.
jgvanwyk commentedon Aug 7, 2023
I’ve taken a look at this. The available documentation for Uniform Type Identifiers appears to be the out of date Uniform Type Identifiers Overview, the out of date System Declared Uniform Type Identifiers and the up to date Uniform Type Identifiers Framework Documentation. The gist is this. An app should export a type only if it is the source of the type; any other types it must import. The system declares various types by default, which the app doesn’t need to import.
Note that The list of system declared types in the document linked above is for OS X 10.4, and is quite out of date (10.4 saw its last release in 2007). macOS now exports additional many additional types, of which public.fortran-{,77-,90-,95-}source, public.ada-source, public.yacc-source and public.pascal-source are relevant to MacVim.
Resetting, seeding and display the type identifiers database on your machine can done with the
lsregisterprogram, which lives at/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister. For example, to get a list of the declared types on your machine, runlsregister -dump | grep uti: | cut -c 29- | sort | uniq.MacVim currently exports 75 type identifiers. I’ve listed these type identifiers below along with proposed changes for most of them. I’m not sure what to do with
.cfg,.iniand.iofiles, as these are just common file extensions used for different purposes by different apps and programs, and I’m not sure what to do with.cdfg,.v,.vh,.vhdl,.scmand.gtdfiles as it’s just not clear to me what these file types are.I’m happy to submit a pull request with the relevant changes once we’ve figured out what should be done with all these type identifiers.
hofman commentedon Aug 7, 2023
Fix incorrect exported UTI registrations
Register missing document types for modern dev formats and dotfiles
Register missing document types for modern dev formats and dotfiles
Register missing document types for modern dev formats and dotfiles