ethusdt
0.01D

VSCode 如何禁止 cmd+click 查看方法定义时弹出来嵌套的视图?

  •  
  •   ethusdt ·
    FaiChou · Jul 16, 2018 · 2572 views
    This topic created in 2856 days ago, the information mentioned may be changed or developed.

    vscode

    比如说用 react 写一个方法或 Component, 在另一地方 /文件使用这个方法或 Component, 使用 cmd+鼠标左键 点击进去查看定义, 总会弹出来嵌套的可滚动的视图. 可明明已经到了方法 /component 定义的文件位置了. 还要显示这视图,有点不明白.

    每次都是按 esc 来取消这嵌套滚动视图, 有没有什么 setting 让点击不显示此视图?

    或者 vscode 这么做的初心是什么?

    (原谅每次升级都忽略阅读 release.md :)

    4 replies    2018-07-16 11:59:13 +08:00
    ethusdt
        1
    ethusdt  
    OP
       Jul 16, 2018
    这种快捷键设置 官网不建议提 issue.

    于是在 [stackoverflow]( https://stackoverflow.com/questions/51349228/vscode-how-to-disable-cmdclick-jump-definitions-pop-up?noredirect=1) 上提了问题, 目前没有解答.
    maichael
        2
    maichael  
       Jul 16, 2018
    这个其实跟用箭头函数定义有关,如果你用的是 function 或者 class,是不会这样的。

    猜测是因为语义分析时,认为变量的定义和类型定义是不一样的。
    aaronly
        3
    aaronly  
       Jul 16, 2018
    这个视图会在 vscode 检测到多个定义的时候才会出现,只有一个定义的时候会直接跳转。

    const Comment = () => {
    const myId = 1;
    return (
    <div id={myId}></div>
    );
    };

    export default Comment;

    并没有复现, 未安装任何 react, jsx 相关扩展
    ethusdt
        4
    ethusdt  
    OP
       Jul 16, 2018 via iPhone
    @aaronly
    @maichael

    好的, 原来如此, 那我去 github isuee 问下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1002 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 22:17 · PVG 06:17 · LAX 15:17 · JFK 18:17
    ♥ Do have faith in what you're doing.