-
Notifications
You must be signed in to change notification settings - Fork 780
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
Allow apps to force lang via code.language and add special cased files #1451
base: main
Are you sure you want to change the base?
Conversation
aa0337c
to
d2288b6
Compare
I personally think an app that wants to force a language should override the |
Totally agree. If the problem is that forced language should take precedents over an application specific language then we just need to make the matcher of the forced context more specific. |
Hrm ya that makes sense, is simpler. I'll change it. Will try the 'mode: all' thing as well, as ya I think we still want forced language to take precedence over overridden code.langauge |
I will look into if we can make the forced override more specific and always win over application specific |
Hopefully will be obsolete if we find a better solution (e.g. talonhub#1451).
To be clear we tried A temporary workaround if you've already got code.language overrides is to do something like this: but @AndreasArvidsson wasn't too excited about having to do that everywhere and neither am I… |
It appears that the |
Do you think creating another context for this is better than calling |
I guess both work I just prefer to actually use the Talon context for what it's made for. Just to be clear you put this |
I'm OK with the |
d2288b6
to
d77ad8e
Compare
Finally got time to circle back to this. I use the |
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
Similar to #1451 this uses a context using not forced language to override `code.language` and enable python lang features inside the talon repl. It also makes the title matching more restricting, as this currently matches on anything with repl in the name, and there are many repls that aren't talon or python... I also enable readline so that common navigation commands work inside.
This makes some tweaks to language modes:
code.language
#1256 semi-recently went the route of removing language-specific tags. This has the side effect (afaict) that an app that doesn't expose the file extension in its title can no longer force a language (previously it would justtag: user.<lang>
). Given we removed the tags I assume we don't want them back, so this change goes a different route and adds an action that can be overridden to force a language. It's done in a way that the language being forced by an app will still be overridden by a user manually forcing a language withforce <lang>
. I've included an obsidian skeleton to demonstrate how to use it. Obsidian is a markdown editor that doesn't include file extensions in it's title. I took a look at search.talonvoice.com and see that some people are using tag.markdown (so are their community is not up to date, or they custom implemented tags again) and some others are re-implementing markdown commands. Since I tried to use this app recently, and I don't like forcing a language across my entire system and have to remember to clear it afterwards, I figured I should add a way to do it.I'm open to other ways to do this if there is a better idea.