特定のプログラミング言語でショートカットキーを有効化する

[
    {
        "key": "f1",
        "command": "rust-analyzer.openDocs",
        "when": "editorLangId == rust"
    },
]

when プロパティに editorLangId の条件を追加してやればよい.

リファレンス - https://code.visualstudio.com/api/references/when-clause-contexts - https://code.visualstudio.com/docs/languages/identifiers