Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kaste opened this issue Sep 2, 2022 · 0 comments
Open

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

kaste opened this issue Sep 2, 2022 · 0 comments

Comments

@kaste
Copy link
Contributor

kaste commented Sep 2, 2022

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.

kaste added a commit that referenced this issue Sep 9, 2022
The plan was to remove the deprecated setting `syntax_map`.  But
`get_tempfile_suffix` still relies on it and we have no other way
implemented to actually solve the problem.

See #1868
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant