vscode 建议在编辑器中将小部件孤立 ```markdown 建议在编辑器中将小部件孤立 ```

9vw9lbht  于 5个月前  发布在  Vscode
关注(0)|答案(4)|浏览(43)

我没有确切的步骤,但我相信大概意思是:

  1. 输入一些触发建议小部件的内容
  2. 按ctrl+shift+k删除整行
  3. 🐛建议小部件被放置在错误的位置
    如果我在这里选择其中一个建议项,它甚至会尝试更新我的光标当前所在的位置,而建议从一开始就从未有效过。
bzzcjhmw

bzzcjhmw1#

当这种情况发生时,控制台上是否有任何错误?我无法重现,并且代码没有任何明显的迹象表明为什么会发生这种情况。

tpxzln5u

tpxzln5u2#

我可以轻易地复现这个问题,这里有一段录音。在接下来的场景中,当我按下ctrl+shift+k时,我希望建议小部件被关闭:
suggest-widget.mp4
以下是我的设置(仅供参考)

{
    "editor.inlineSuggest.enabled": true,
    "github.copilot.advanced": {
        "slashCommands": {
            "*": true
        }
    },
    "typescript.inlayHints.propertyDeclarationTypes.enabled": true,
    "typescript.inlayHints.enumMemberValues.enabled": true,
    "typescript.inlayHints.functionLikeReturnTypes.enabled": true,
    "typescript.inlayHints.parameterNames.enabled": "all",
    "typescript.inlayHints.parameterTypes.enabled": true
}

这是开发者工具显示的内容

[perf] Renderer reported VERY LONG TASK (3084ms), starting profiling session '86cbdfcd-d384-46f6-b5d0-96d210e8293f'
log.ts:441   ERR [PerfSampleError]: [PerfSampleError] by <<renderer>> in _deliver#event.js:822:17
	 at _deliver (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:822:17)
	 at fire (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:851:13)
	 at (anonymous) (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js:135:71)
	 at _deliver (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:822:17)
	 at _deliverQueue (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:839:22)
	 at fire (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:851:13)
	 at (anonymous) (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/widget/codeEditorWidget.js:1194:54)
	 at _deliver (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:822:17)
	 at fire (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:851:13)
	 at _emitOutgoingEvents (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/common/viewModelEventDispatcher.js:36:28)
	 at endEmitViewEvents (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/common/viewModelEventDispatcher.js:72:26)
	 at _withViewEventsCollector (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/common/viewModel/viewModelImpl.js:850:33)
	 at _executeCursorEdit (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/common/viewModel/viewModelImpl.js:789:27)
	 at executeEdits (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/common/viewModel/viewModelImpl.js:797:21)
	 at executeEdits (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/widget/codeEditorWidget.js:833:21)
	 at insert (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/contrib/snippet/browser/snippetSession.js:498:15)
	 at _doInsert (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/contrib/snippet/browser/snippetController2.js:80:18)
	 at insert (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/contrib/snippet/browser/snippetController2.js:65:15)
	 at _insertSuggestion (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/contrib/suggest/browser/suggestController.js:219:26)
	 at (anonymous) (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/contrib/suggest/browser/suggestController.js:96:56)
	 at _deliver (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:822:17)
	 at fire (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:851:13)
	 at fire (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:979:13)
	 at _select (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/contrib/suggest/browser/suggestWidget.js:251:16)
	 at _onListMouseDownOrTap (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/contrib/suggest/browser/suggestWidget.js:237:30)
	 at (anonymous) (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/contrib/suggest/browser/suggestWidget.js:187:58)
	 at _deliver (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:822:17)
	 at fire (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:851:13)
	 at (anonymous) (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:98:79)
	 at _deliver (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:822:17)
	 at fire (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/common/event.js:851:13)
	 at fn (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/browser/event.js:14:24)
log.ts:441   ERR [PerfSampleError]: [PerfSampleError] by <<renderer>> in getBoundingClientRect
	 at getBoundingClientRect
	 at getDomNodePagePosition (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/base/browser/dom.js:370:36)
	 at createEditorPagePosition (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/editorDom.js:68:38)
	 at EditorMouseEvent (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/editorDom.js:92:20)
	 at _create (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/editorDom.js:106:16)
	 at (anonymous) (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/editorDom.js:135:67)
log.ts:441   ERR [PerfSampleError]: [PerfSampleError] by <<renderer>> in collect#viewPart.js:44:23
	 at collect (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/view/viewPart.js:44:23)
	 at mouseTargetIsWidget (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/controller/mouseTarget.js:365:28)
	 at _onMouseMove (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/controller/mouseHandler.js:168:21)
	 at (anonymous) (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/controller/mouseHandler.js:22:81)
	 at (anonymous) (vscode-file://vscode-app/c:/Users/huer/Source/vscode/out/vs/editor/browser/editorDom.js:135:67)
ohtdti5x

ohtdti5x3#

谢谢,我现在可以复现了。这个重要的部分是光标不会改变,例如下面的行必须等长或更长,以便光标保持不变。然后我们确实收到了一个模型更改事件,但定位仍然是一样的,所以我们不会取消或更新当前会话。
这是一个有趣的bug,我相信这个问题已经存在多年了

8oomwypt

8oomwypt4#

这不是固定的,我只是推送了一个失败/跳过的测试。

相关问题