Visual Studio Code 中没有 Rust 自动完成用于外部板条箱,例如“gtk-rs" [英] No Rust autocomplete in Visual Studio Code for external crates such as 'gtk-rs'

查看:59
本文介绍了Visual Studio Code 中没有 Rust 自动完成用于外部板条箱,例如“gtk-rs"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许这个问题以前有人做过,但我找不到任何东西.

Maybe this question has been done before but I can not find anything.

我想知道要遵循哪些步骤,以便 Visual Studio Code 可以显示显示 Rust 方法等的自动完成窗口,例如在使用 ctrl+space 时(在许多公共领域,编辑器)我所看到的是它适用于 std 但不适用于 gtk-rs.

I would like to know what steps to follow so that Visual Studio Code can show the autocomplete window that shows Rust methods and such, for example when using ctrl+space (In many commons, editors) What I see is that it works for std but not for gtk-rs.

我想知道是否需要以某种方式告诉您如何找到文件或类似的东西.

I was wondering if I would have to tell you in some way how to find the files or something like that.

我不知道这是否取决于每个编辑器或都包含一些特定文件,我的 IDE 是 Visual Studio Code.

I do not know if this will depend on each editor or all have some specific files included, my IDE is Visual Studio Code.

...您忘记包含已安装的扩展

卡利塔列克谢用于 Visual Studio 代码的 Rust

kalitaalexey Rust for Visual Studio Code

Rust Language Server integration.
Autocompletion (via racer or RLS).
Go To Definition (via racer or RLS).
Go To Symbol (via rustsym or RLS).
Code formatting (via rustfmt).
Code Snippets.
//..

推荐答案

尽管 Rust 扩展在 Visual Studio Code 中,以下步骤应该可以帮助任何遇到此类问题的人:

Although there could be many possible causes of a problem with the Rust extension in Visual Studio Code, the following steps should help anyone with issues of this kind:

  • 不要使用旧的扩展Rusty Code",因为它不再被维护.相反,您有两个选择:
    • 官方 rust-lang.rust 扩展由一个官方 Rust 团队,专注于 Rust 语言服务器 (RLS) 集成.它正在积极开发中.
    • kalitaalexey.vscode-rust 扩展,从 Rusty 分叉在传统模式下运行时,代码较旧,但可能比官方扩展更稳定.然而,它目前处于非常被动的维护状态.
    • Do not use the old extension "Rusty Code", since it's no longer maintained. Instead, you have two options:
      • The official rust-lang.rust extension is developed by an official Rust team and is focused on Rust Language Server (RLS) integration. It is in active development.
      • The kalitaalexey.vscode-rust extension, forked from Rusty Code, is older but possibly more stable than the official extension when run in Legacy Mode. It is currently under very passive maintenance however.

      如果执行这些步骤后仍然有问题,则可能实际上是一个错误,应该报告.

      If there's still a problem after these steps, it might actually be a bug, which should be reported.

      这篇关于Visual Studio Code 中没有 Rust 自动完成用于外部板条箱,例如“gtk-rs"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆