-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make custom grammar + restrict key combination to this grammar #26
Comments
My issue too. Is it possible to make the shortcut conditional or language specific, so I could use Ctrl+Enter in my normal workflow to insert new lines? |
This plugin is short of maintainers, but PRs are very welcome. |
The same request goes for Shift+Enter too, what is used for multiline search and commit messages. As @KoltesDigital suggested, you probably have to define your own language ID so you can make use of the |
@yaxu this seems to be a low hanging fruit. AFAIK adding a language ID to package.json then scoping relevant keyboard shortcuts to the language ID would resolve this issue. (Not the custom grammar part, but the OP noticed that his "real issue" is with keyboard shortcuts and solving it doesn't require a custom grammar.) Although I found an unrelated problem. I checked out the code, ran tests and one of them failed. It leads to a rather complex constructor and is eventually related to the VS Code extension API. I'm not ready to dig into it at the moment. Will you accept a PR even if I don't fix the failing test case? |
I've not looked at the code at all, @kindohm might have a view on that |
@kkeri I would be happy to take a look at a PR, regardless of the state of the tests. I will take a look at the tests in the meantime. I also want to make sure I understand the feature. Would this allow you to use the Tidal keyboard shortcuts in a |
@kindohm thanks for your feedback. Yes, this feature would restrict shortcuts like Ctrl+Enter to Although there is something you should know about. I wrongly assumed that this can be done without making a custom grammar. However defining a new language ID for Tidal files conflicts with the suggested user setting that associates I can't invest into writing a full fledged Haskell syntax, but I can try to find one whose license is compatible with this project. |
@kkeri thanks for digging in to this. I don't think we want to lose the syntax highlighting. One workaround is to define your own keyboard shortcut to eval Tidal code. e.g. remap the "Eval Multiline" command to something other than |
@kindohm I agree, losing syntax highlight is not an option. I keep exploring, including filing an issue to the VS Code project. Possibly there are other embedded DSLs that could benefit from using the syntax highlighter of the parent language. Until then I'll be using my own keyboard shortcuts. |
I found a possible workaround. It would allow for using Haskell highlighters as before, but it doesn't work as expected. I reported the issue to Microsoft. |
Like for the Atom plugin, I suggest making your own grammar, which would merely extends Haskell. It also gives the opportunity to add autocompletion (#11).
My real issue: I regularly use Ctrl+Enter to make new lines, and I'm frustrated that this plugin squats this key combination for all languages.
The text was updated successfully, but these errors were encountered: