Closed FantasyGao closed 6 years ago
能否给我看一下vscode 的配置, 既 gpm.rootPath
字段
顺便说一下环境吧,vscode版本,gpm版本,操作系统.
因为我这么Linux和Mac都是正常的,是不是windows (:
@axetroy "gpm.searchBehavior": "openInNewWindow", "gpm.rootPath": ["$HOME/gpm"], "gpm.isAutoRunHook": false
vscode: 1.24.0
gpm: 0.20.1
mac
我看了下我的 ~/gpm文件夹是空的,正常吗?
@FantasyGao
项目是从 $HOME/gpm
加载的. 如果这个目录是空目录,那么自然就显示不出来
最近更新了个版本,支持多个根目录 "gpm.rootPath": ["$HOME/gpm"]
也可以这样 "gpm.rootPath": ["$HOME/gpm", "$GOPATH/src"]
@axetroy 我现在的配置是覆盖了gpm.rootPath项的,我指到自己的定义的项目底下,报的错
@FantasyGao
你能确保目录存在吗。
能不能打开了给一个开发者调试页面
菜单 >> 帮助 >> 切换开发人员工具
看看里面的报错信息是什么
@axetroy 确定目录存在,之前是没问题的,近两天出现的问题。明天回去给你截图。
@axetroy 找到解决办法了,我把我的工作目录在setting中在覆盖的时候"gpm.rootPath"的值用数组包装就好了,之前版本的记得应该不是数组,所以报这个错。
@FantasyGao
是的,之前的版本 gpm.rootPath
是字符串,只支持一个目录.
最新版本 gpm.rootPath
是数组, 为了支持多个目录
我也在代码里面做了处理,按理来说,是向下兼容的. (可是你在工作目录中的setting设置了...)
@axetroy 我在setitng中覆盖gpm.rootPath放了我的工作目录,这是正常的步骤,只是向下兼容字符串处理应该有些问题,从而引起这个错误。
@FantasyGao 向下兼容的代码在这里
如果发现 gpm.rootPath
字段是字符串的话,自动 Update 成为数组.
但是只更新全局的配置,项目内的 .vscode
是不更新的
@axetroy 意思是如果我的项目没有.vscode的文件,我在之前的配置是不会出错的吗
@FantasyGao 是的...
因为把 gpm.rootPath
这个配置写在 .vscode 的情况实在太少了,就不考虑了.
@axetroy 好吧,明白了,谢谢解答
之前是正常的,最近突然不能使用了, 启动之后: command 'gpm.search' not found command 'gpm.add' not found command 'gpm.refresh' not found