打开QML Language Server
对于多种编程语言而言,只要集成开发环境支持通过语言服务器协议(LSP)进行通信,语言服务器就会向集成开发环境提供有关代码的信息。然后,集成开发环境就可以提供代码补全等服务。
在开发Qt Quick 应用程序时,打开QML Language Server 以获得代码编辑服务,如果:
- 默认 Qt 版本支持QML Language Server (自 Qt 6.5 起可用)。
- Visual Studio 版本支持LSP。
您获得的服务取决于您使用的 Qt 版本和 Visual Studio 版本。
要打开QML Language Server 并设置运行它的选项:
- 转到Extensions >Qt VS Tools >Options >Qt >General > QML Language Server.

- 在Enable 中,选择Enable 以打开QML Language Server 。
- 在Log 中,选择Enable 可将 LSP 消息写入临时文件夹中的日志文件。
- 在Log size 中,以 KB 为单位设置日志文件的最大大小。
- 在 QML Language Server path中,选择要使用的QML Language Server 版本的路径。如果要使用 Qt VS Tools 提供的默认版本,请将该字段留空。但是,如果您使用早于 6.5.0 的 Qt 版本进行开发,Qt VS Tools 会尝试启动该版本的QML Language Server ,如果不可用,则使用默认版本。
- 在Search for updates 中,选择Enable 可在 Visual Studio 闲置 60 秒后每 24 小时搜索QML Language Server 更新。
接收更新通知
要接收QML Language Server 更新通知:
- 转到Extensions >Qt VS Tools >Options >Qt >General >Notifications 。

- 在 QML Language Server update中,选择Enable 。
另请参阅 更新 IntelliSense 信息。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.