Skip to content

UTI registrations are wrong #1169

Open
Open

Description

@hofman

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

  1. ychin commented on Feb 5, 2021

    @ychin
    Member

    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.

  2. modified the milestones: Release 174, Release 175 on Sep 12, 2022
  3. modified the milestones: Release 175, Release 176 on Feb 3, 2023
  4. modified the milestones: Release 177, Release 178 on Jul 9, 2023
  5. jgvanwyk commented on Aug 7, 2023

    @jgvanwyk

    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 lsregister program, 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, run lsregister -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, .ini and .io files, 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, .scm and .gtd files 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.

    Current (exported) Proposed
    org.vim.vim-script export org.vim.vim-script
    public.plain-text system declared
    org.vim.tex-file import org.tug.tex-source
    public.c-header system declared
    org.vim.pch-file system declared public.precompiled-c-header
    public.c-plus-plus-header system declared
    org.vim.pch++-file system declared public.precompiled-c-plus-plus-header
    public.c-source system declared
    public.objective-c-source system declared
    public.objective-c-plus-plus-source system declared
    public.c-plus-plus-source system declared
    public.assembly-source system declared
    com.apple.rez-source system declared
    com.sun.java-source system declared
    com.apple.xcode.lex-source system declared public.lex-source
    com.apple.xcode.yacc-source system declared public.yacc-source
    public.mig-source system declared
    com.apple.symbol-export system declared
    com.apple.xcode.fortran-source system declared public.fortran-{,77-,90-,95-}source
    com.apple.xcode.pascal-source system declared public.pascal-source
    com.apple.xcode.ada-source system declared public.ada-source
    public.html system declared
    public.xml system declared
    com.netscape.javascript-source system declared
    public.perl-script system declared
    public.python-script system declared
    public.php-script system declared
    public.ruby-script system declared
    public.shell-script system declared
    com.sun.java-class system declared
    org.vim.patch-file system declared public.patch-file
    com.apple.xcode.strings-text import com.apple.xcode.strings-text
    com.apple.applescript.text system declared
    org.vim.as-file import com.adobe.action-script
    org.vim.asp-file import com.microsoft.active-server-pages-script
    org.vim.aspx-file import com.microsoft.active-server-pages-script
    org.vim.bib-file import org.tug.bib
    org.vim.cs-file import com.microsoft.c-sharp-source
    org.vim.cdfg-file
    org.vim.csv-file system declared public.comma-separated-values-text
    org.vim.tsv-file system declared public.tab-separated-values-text
    org.vim.cgi-file import org.ietf.common-gateway-interface-source
    org.vim.cfg-file
    org.vim.css-file system declared public.css
    org.vim.dtd-file import org.w3.document-type-definition-text
    org.vim.dylan-file import org.opendylan.dylan-soure
    org.vim.erl-file import org.erlang.erlang-source
    org.vim.f-script-file
    org.vim.hs-file org.haskell.haskell-source
    org.vim.inc-file
    org.vim.ics-file system-declared com.apple.ical.ics
    org.vim.ini-file
    org.vim.io-file
    org.vim.bsh-file org.beanshell.beanshell-script
    org.vim.properties-file
    org.vim.jsp-file com.sun.jakarta-server-pages-source
    org.vim.lisp-file
    org.vim.log-file system declared public.log
    org.vim.wiki-file export org.vim.vim-wiki-text
    com.adobe.postscript system declared
    org.vim.scm-file
    org.vim.sql-file import org.iso.structured-query-language-source
    org.vim.tcl-file import tk.tcl.tcl-script
    org.vim.xsl-file import org.w3.extensible-style-sheet-source
    public.vcard system declared
    org.vim.vb-file import com.microsoft.visual-basic-source
    org.vim.yaml-file org.yaml.yaml-text
    org.vim.gtd-file
    net.darlingfireball.markdown import net.darlingfireball.markdown
    org.vim.rst-file import org.python.restructuredtext
    org.vim.vba-file import com.microsoft.visual-basic-source
    org.vim.vhdl-file
    org.lua.lua-source import org.lua.lua-source
    org.vim.v-file
    org.vim.vh-file
  6. hofman commented on Aug 7, 2023

    @hofman
    Author
  7. modified the milestones: Release 178, Release 179 on Sep 9, 2023
  8. modified the milestones: Release 179, Release 180 on Jan 3, 2024
  9. added a commit that references this issue on Apr 30, 2024
    481c1d8
  10. modified the milestones: Release 180, Release 181 on Sep 10, 2024
  11. modified the milestones: Release 181, Release 182 on Feb 7, 2025
  12. modified the milestones: Release 182, Release 183 on Oct 25, 2025
  13. modified the milestones: Release 183, Release 184 on Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions