是否可以在VS代码中更改Flutter的自动完成顺序?

发布于 2025-01-29 16:48:46 字数 274 浏览 3 评论 0原文

我有一个问题。 是否可以在VS代码中更改Flutter的自动完成顺序?

如果我尝试放一个偶像, 建议使用Iconbutton片段,并且自动完成如下。

例如

IconButton(onPressed: onPressed, icon: icon),

,但是我希望订单这样。

IconButton(icon: icon, onPressed: onPressed),

我该如何更改?

I have a question.
Is it possible to change Flutter's AutoComplete order in VS code?

If I try to put an IconButton,
IconButton Snippet is recommended, and autocomplete is as follows.

for example

IconButton(onPressed: onPressed, icon: icon),

But I want the order to be like this.

IconButton(icon: icon, onPressed: onPressed),

How can I change this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只怪假的太真实 2025-02-05 16:48:46

如果您没有键入任何前缀,并且正在看到代码完成的“完整列表”,则订购由DART Analysis Server确定。它们应该用顶部的“相关”项目进行排序(其中“相关”是一个考虑了许多事情的计算分数)。

但是,如果您输入了任何字符(例如“图标”),以便列出列表已过滤,则VS代码正在处理排名。 VS Code的排名仅基于完成的文本和您输入的文本,并且没有任何其他上下文(例如,最有可能在那里),这有时会导致次优的排名。

目前尚不清楚这里是哪种情况,但是屏幕截图将有助于理解。

VS代码问题跟踪器中有一些相关问题,该问题与上述第二点有关:

If you have not typed any prefix and are seeing the "full list" of code completion, then the ordering is determined by the Dart analysis server. They should be sorted with "relevant" items at the top (where "relevant" is a computed score that takes into account a number of things).

However, if you have typed any characters (such as "icon") so that the list has been filtered, then VS Code is handling the ranking. VS Code's ranking is based only on the text of the completion and the text you've typed and does not have any additional context (such as which types are most likely there), which can sometimes result in sub-optimal ranking.

It's not clear which of these is the case here, but a screenshot would help understand.

There are some related issues in the VS Code issue tracker relating to the second point above:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文