是否可以在VS代码中更改Flutter的自动完成顺序?
我有一个问题。 是否可以在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
如果您没有键入任何前缀,并且正在看到代码完成的“完整列表”,则订购由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: