Migrate extension_lang_map to a global Talon list
See original GitHub issueI think we should migrate the variable extension_lang_map to a Talon list.
Ideally, someone implementing support for a new programming language would not have to modify any existing code, and each language mode would append the programming language name and its file extensions to the global list, which would trigger the creation of a new language mode. I assume that this requires registering an event handler in code.py
, rather than the current loop which creates language modes once based on a constant mapping.
In the current setup, the mapping is not exposed, which leads to developers copying it into their own project whenever they need to know about language modes and file extensions. For instance, see talon_hud. Such copies naturally get out of sync with the copy in this repository. Furthermore, someone implementing support for a new language must also know to update the list in talon_hud/status_bar_poller.py
and any other project which uses this mapping.
If approved, I should be able to make this change with minimal guidance, and I would be happy to also update chaosparrot/talon_hud.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
I’ve been using it in my personal set up, and it works just fine.
It’s bad practice in general, but, e.g., matplotlib does it.
Yeah, I understand that concern. However, we might be able to let
code.py
expose an action which binds in a new language mode?