是否有允许一起打开文件的配置?

Is there a config that allows opening of files together?

例如,如果我打开 Button.jsx,VS Code 将在另一个面板上打开 Button.module.css

基本上并排查看相关文件。

据我所知,无法以打开文件时自动打开相关文件的方式定义文件“组”。您可以通过以下方式打开文件 side-by-side,因为您的相关文件可能位于同一位置: 1. 在文件资源管理器中 Ctrl+click 到 select 文件,然后将它们拖到编辑器,然后 2. 单击文件名,然后将其拖到右侧。这将打开文件 side-by-side:

您可以使用扩展 HTML Related Links v0.16.0

使用命令 htmlRelatedLinks.openFile 并根据当前编辑器的语言 ID 创建激活的键绑定。

也许你必须更改 editorLangId == javascriptreact 因为我不知道 .jsx 个文件的语言 ID

{
    "key": "ctrl+i r",
    "command": "htmlRelatedLinks.openFile",
    "args": {
      "file": "${fileDirname}/${fileBasenameNoExtension}.module.css",
      "method": "vscode.open",
      "viewColumn": "split"
    },
    "when": "editorTextFocus && editorLangId == javascriptreact"
  },
  {
    "key": "ctrl+i r",
    "command": "htmlRelatedLinks.openFile",
    "args": {
      "file": "${fileDirname}/${fileBasenameNoExtension:find=\.module:replace=:}.jsx",
      "method": "vscode.open",
      "viewColumn": "split"
    },
    "when": "editorTextFocus && editorLangId == css"
  }