xmake-io / xmake-vscode

🍩 A XMake integration in Visual Studio Code
https://xmake.io
Apache License 2.0
228 stars 55 forks source link

Remove diagnosis from internal files #177

Closed LelouchHe closed 1 year ago

LelouchHe commented 1 year ago

It seems that apart from xmake.lua, xmake check also output warnings/errors from internal files, which could be confusing, since they're not visible to users

This removes them from diagnosis info

image

waruqi commented 1 year ago

isEligible

这里面仅仅判断 xmake.lua 可能不通用,很多是 includes("xxx.lua") 进来的。。

你应该根据根目录过滤。比如过滤掉 @progamdir/

LelouchHe commented 1 year ago

有道理..已改..

LelouchHe commented 1 year ago

待我测试下你说的那种情况

waruqi commented 1 year ago

测试过了么,ok 了,我就 merge 了

LelouchHe commented 1 year ago

image

我之前没用过 includes 的用法,这里测试了下,它的输出貌似和其他的错误不一样,没有文件名,没有行号,而且是在 summary 之后输出的

如果暂时不管这个的话,那该 pr 就可以了

includes 的错误输出是正确的么?还有哪些 api 会 check 出不同的错误呢?

waruqi commented 1 year ago

我之前没用过 includes 的用法,这里测试了下,它的输出貌似和其他的错误不一样,没有文件名,没有行号,而且是在 summary 之后输出的

有些不是 xmake check 输出的,属于内部的一些早期检测,暂时不用管

LelouchHe commented 1 year ago

ok. 不过这个错误信息也挺正确的,比如我输入错误的 includes, xmake check 就没有错误,相反那个早期检测的错误就能弄出来

待我研究下具体输出,然后再开一个 pr 吧

waruqi commented 1 year ago

ok. 不过这个错误信息也挺正确的,比如我输入错误的 includes, xmake check 就没有错误,相反那个早期检测的错误就能弄出来

待我研究下具体输出,然后再开一个 pr 吧

因为 xmake check 里面暂时没加对 includes 的检测

waruqi commented 1 year ago

我修复了插件 xmake check -F xmake.lua 强行设置 -F 。。导致子目录 xmake.lua 作为项目根目录的一些问题。。

但是,现在还有一些其他问题,子目录下的 xmake.lua 本身语法错误,会被这个 patch 解析忽略。。

也许需要改进下 xmake 的报错信息。。同时这里简单的忽悠 programdir 可能还不行,还是得吧后面的错误解析出来。。

相关 issues https://github.com/xmake-io/xmake/issues/3553

waruqi commented 1 year ago

我 xmake/dev 版本,改进修复错误信息后,子 xmake.lua 的错误也能显示了,

但是有个其他的问题,我把根 xmake.lua 的错误代码,移动到子 xmake.lua 中去,但是诊断列表中,之前根 xmake.lua 错误信息还是在列表里面,不会删掉,也无法跳转

image