Visitar URL original
`get_tempfile_suffix` uses the setting `syntax_map` so I can't remove it · Issue #1868 · SublimeLinter/SublimeLinter · GitHub
Skip to content

get_tempfile_suffix uses the setting syntax_map so I can't remove it #1868

Open

Description

@kaste

The setting syntax_map has been deprecated. We have some help text in the settings file but this text is misleading because the setting isn't used anymore to select linters for a given view. (We only use selector or scopes for this.)

But we still use syntax_map in the tempfile suffix code. For example haskell defines

    tempfile_suffix = {
        'haskell': 'hs',
        'haskell-sublimehaskell': 'hs',
        'literate haskell': 'lhs'
    }

It has a mapping from syntax (which is the base or stem (=name without suffix in Python terminology)) to the file extension (suffix in Python land) used when generating tempfiles.

So the users uses 'Packages/Haskell/Haskell.sublime-syntax' for its view, and therefore we use "hs" as the tempfile suffix.
But if the user writes literal haskell bird style (LiterateHaskellBirdStyle) must be mapped to lhs but the syntax is not in the mapping.

The user can now define

    "syntax_map": {
        "literatehaskellbirdstyle": "literate haskell"
    }

to make it work. So we map from our used syntax, to the one defined in the plugin code, which maps finally to the wanted extension.

Nobody does that because it is way too complicated. Esp. that we first map to literate haskell is pure magic, the user must lookup the source code.

Anyhow that's the wanted legacy functionality.

Ideally we could lookup and ask Sublime Text which is a (or the) typical extension for this syntax/language. Or we at least had a direct mapping from used syntax or base scope (source.haskell.bird) to extension.

Activity

  1. added a commit that references this issue on Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions