Tim*_*mmm 68 visual-studio-code
有没有办法在Visual Studio代码中禁用ctrl-click'peek'功能?理想情况下,我想按住Ctrl键单击以在新选项卡中打开包含定义的文件.
编辑:我提交了一个问题,至少让它不那么混乱.显然我的术语有些错误.
澄清一下,有两个动作:
他们的行为如下:
PD,多种定义
GtD,单一定义
所有这些都很好,除了最后一个.做这两件事会导致真正多余且令人困惑的UI,如下所示:
应该有办法让这些行为之一:
要么:
我已经发出拉取请求来修复此https://github.com/Microsoft/vscode/pull/68023,但在此之前,这是一个修复VSCode安装文件的临时修复程序.您需要重新应用每个更新.
通过此修复,Ctrl +单击将:
弄清楚需要修补的功能是什么样的.方法是DefinitionAction.prototype._onResult(editorService, editor, model)
转到VSCode安装目录.%LocalAppData%\Programs\Microsoft VS Code然后右键单击并打开VSCode中的目录,以便我们可以使用VSCode的搜索功能搜索每个文件中的文本.
搜索_onResult并评估每个结果,检查签名和正文是否符合我们在步骤1中看到的功能所期望的结果.
_openReference就在附近.用它来缩小搜索范围.workbench.main.js符合要求2454.使用括号匹配查找结尾或知道它在之前结束t.prototype._openReference格式化时的函数如下(async func被编译为statemachine,这就是为什么它看起来不像源打字稿):
t.prototype._onResult = function (e, t, r) {
  return i(this, void 0, void 0, function () {
    var i, s, a;
    return n(this, function (n) {
      switch (n.label) {
        case 0:
          return i = r.getAriaMessage(), o.alert(i), this._configuration.openInPeek ? (this._openInPeek(e, t, r), [3, 3]) : [3, 1];
        case 1:
          return s = r.nearestReference(t.getModel().uri, t.getPosition()), [4, this._openReference(t, e, s, this._configuration.openToSide)];
        case 2:
          (a = n.sent()) && r.references.length > 1 ? this._openInPeek(e, a, r) : r.dispose(), n.label = 3;
        case 3:
        return [2]
      }
    })
  })
}
将该功能替换为以下(如果使用相同版本)或格式化并编辑您发现的与此示例类似的功能.请注意,o变量是全局\窗口对象,可能会发生变化.
t.prototype._onResult = function (e, t, r) {
  return i(this, void 0, void 0, function () {
    return n(this, function (n) {
      switch (n.label) {
        case 0:
          return r.getAriaMessage(), o.alert(r.getAriaMessage()), this._configuration.openInPeek || r.references.length > 1 ? (this._openInPeek(e, t, r), [3, 3]) : [3, 1];
        case 1:
          return [4, this._openReference(t, e, r.nearestReference(t.getModel().uri, t.getPosition()), this._configuration.openToSide)];
        case 2:
          r.dispose(), n.label = 3;
        case 3:
        return [2]
      }
    })
  })
}
启动VSCode.你会得到一个Your Code installation appears to be corrupt. Please reinstall.只需点击齿轮图标并单击即可Don't Show Again.
| 归档时间: | 
 | 
| 查看次数: | 4354 次 | 
| 最近记录: |