Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab completion support #443

Merged
merged 6 commits into from
Jun 6, 2019
Merged

Conversation

OpportunityLiu
Copy link
Member

No description provided.

@OpportunityLiu OpportunityLiu changed the base branch from master to dev June 4, 2019 08:44
@waruqi
Copy link
Member

waruqi commented Jun 4, 2019

之后有特性改动,请先在issues上提feature request进行评估后,再提pr,避免有些特性不被采纳导致做无用工作,另外也可以在提pr前,先讨论好实现方案,减少不必要的改动,提高开发效率。。

@OpportunityLiu OpportunityLiu changed the title Tap completion support Tab completion support Jun 4, 2019
end
if result ~= nil then print(result) end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里需要防止输出多余的空行,应该不会有什么兼容性问题吧。。。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全局strip还是有点影响的,说不定有些模块就是要输出多个空行呢,尽管这个概率很低,但也不排除这个可能性,这个还是应该让模块自己去控制

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

模块输出不是应该用print?这里是lua脚本返回值的地方

不改这里我的脚本调用以后永远会有一行空行。。。
除非我把最后一个结果留下当返回值。。也太蠢了吧

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ruki:xmake ruki$ xmake l private.utils.complete xmake l
lua
plugin
hello
global
build
clean
install
uninstall
ruki:xmake ruki$ 

我没看到有多余空行么?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我不是已经删掉了吗。。。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦,你说的是这个 print nil? 我以为你是要在加个 result:trim() 后去 print

print nil这个去掉没啥问题,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

图片
平台差异?不会吧。。。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我测了下,确实win上显示多了一样,xmake l echo hello 一样也是多了一行,但是 mac下正常

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我测了下win上,似乎跟xmake没啥关系,我把整个 xmake 的主程序入口main代码清空了,啥也不执行,还是会有一行空行。。

而执行系统 echo hello 命令,也会有一行空行,这个似乎是cmd自己加的

@OpportunityLiu
Copy link
Member Author

在 zsh 和 bash 上也试过了

@OpportunityLiu OpportunityLiu marked this pull request as ready for review June 5, 2019 06:20
@OpportunityLiu
Copy link
Member Author

OpportunityLiu commented Jun 5, 2019

zsh

图片

@OpportunityLiu
Copy link
Member Author

OpportunityLiu commented Jun 5, 2019

bash

图片

@waruqi
Copy link
Member

waruqi commented Jun 5, 2019

ok,我先测下

@waruqi
Copy link
Member

waruqi commented Jun 5, 2019

我tab 参数的时候 似乎会多加个下划线,而且等号后面会多加个空格:

xmake i --installdir\=

@OpportunityLiu
Copy link
Member Author

那就是平台处理的问题了,返回的时候只是返回完成列表。
要保证兼容性的话就只能吧返回的等号去掉, “kv" 和 ”k” 采用同样的处理

@waruqi
Copy link
Member

waruqi commented Jun 5, 2019

那就是平台处理的问题了,返回的时候只是返回完成列表。
要保证兼容性的话就只能吧返回的等号去掉, “kv" 和 ”k” 采用同样的处理

win下ok?如果是这样的话,可以对linux/macx下去掉等号好了

@OpportunityLiu
Copy link
Member Author

我在Ubuntu下测了zsh和bash也都没这个问题。。。

@waruqi
Copy link
Member

waruqi commented Jun 5, 2019

我在Ubuntu下测了zsh和bash也都没这个问题。。。

你是指等号那个问题,我刚切到 arch 下试了下,也是有问题的么。。

image

@OpportunityLiu
Copy link
Member Author

你看我上面两个截图,尤其是zsh那个。。。

明天再调查下吧

@waruqi
Copy link
Member

waruqi commented Jun 5, 2019

嗯 我只在bash下测了,明天我测测zsh 说不定是bash的问题

@waruqi
Copy link
Member

waruqi commented Jun 6, 2019

我在 zsh下测试 ,=号没问题,不过之后还会有个 空格

image

不过这个倒是写小问题,我先merge了,回头可以再想办法改进

@waruqi waruqi merged commit 9a4b1a4 into xmake-io:dev Jun 6, 2019
@waruqi waruqi added this to the v2.2.7 milestone Jun 6, 2019
@OpportunityLiu
Copy link
Member Author

别这么着急啊。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants