首页 > 解决方案 > VS Code、Git 提交和 Electron 非上下文感知本机模块

问题描述

我在 Windows 10 上使用 Git 2.26.2.windows.1 和 VS Code 1.45.1 作为提交日志消息编辑器

今天我在 VS Code 中使用git commit并编辑了提交日志消息,然后退出了 VS Code(保存过程中的更改)。Git 完成了提交,但首先我收到了来自 VS Code 的各种 Electron 警告:

hint: Waiting for your editor to close the file...
[main 2020-06-05T15:08:31.739Z] update#setState idle
(node:1924) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
...
[main 2020-06-05T15:09:01.747Z] update#setState checking for updates
[main 2020-06-05T15:09:01.776Z] update#setState idle

这是什么意思?我的恐惧:这是否意味着 Electron 正在删除 VS Code 用作 Git 编辑器的东西,以便 Git 很快会删除 VS Code 支持?(我对 Electron 和 VS Code 实现的了解不够,无法完全解释这一点。)

标签: visual-studio-codeelectrongit-for-windows

解决方案


这条消息,如果它来自 VS Code 的标准输出日志,仅仅意味着 VS Code 当前使用了 Electron 团队计划弃用的功能。由于 VS Code 是使用 Electron 构建的,这是一个必须由 VS Code 开发人员解决的问题(他们很可能已经意识到这一点),并不意味着您最终会得到一个无法正常工作的编辑器. 由于 VS Code 捆绑了 Electron,只要它捆绑了一个可以使用的版本(它很可能会这样做;否则就没有意义了),你就可以使用 VS Code。

此外,Git 在技术上并不“支持” VS Code,您只是告诉 Git 使用 VS Code 来编辑您的消息。


推荐阅读