artbycrunk / vscode-maya

A Visual Studio Code extension with support for coding for Maya.
MIT License
45 stars 11 forks source link

Provide a configuration to modify editorLangId == 'mel' in when column when configuring hotkeys #35

Open oglops opened 1 year ago

oglops commented 1 year ago

I am setting file association in vscode for *.mel to c as a trick to use all the features like ctrl+alt+o and jump to mel global proc definition by ctrl+click, but it stops me from being able to use the hotkeys. As in vscode the shortcuts configuration page, the When column is hardcoded to be editorTextFocus && editorLangId == 'mel'

Screenshot from 2023-04-11 23-26-50

Screenshot from 2023-04-11 23-31-29

I hope the plugin configuration can offer a setting which allows me to choose what langid to use for the when, so that even for c language type, I can still use hotkey to send code to maya.

oglops commented 1 year ago

I suddenly realized that I can customize this via vscode shortcuts json config, so

    {
        "key": "shift+alt+m",
        "command": "mayacode.sendMelToMaya",
        "when": "editorTextFocus && editorLangId == 'c'"
    },

this would work as a temp workaround