简体   繁体   English

如何在PTVS中使用IPython的搜索历史记录功能?

[英]How can I use IPython's search history function in PTVS?

I recently made the transition from IPython command windows + N++ to Python Tools for Visual Studio, mainly for rich code completion (it can search non-standard libraries such as NumPy!), but also because it looks good! 我最近从IPython命令窗口+ N ++过渡到了Visual Studio的Python工具,主要是为了实现丰富的代码(它可以搜索非标准的库,例如NumPy!),但是因为它看起来不错!

The only thing I'm missing from simple white over black IPython is the history search function. 简单的白色到黑色的IPython我唯一缺少的是历史搜索功能。 I could start typing imp then press the up arrow, and it would browse only through the commands begining with imp . 我可以开始输入imp然后按向上箭头,它将仅浏览以imp开头的命令。

Is there a way to activate this function in PTVS? 有没有办法在PTVS中激活此功能? There is a thing called "smart history" in PTVS, but it turns out it simply allows the user to browse the (unfiltered) history when the cursor is at the last position. PTVS中有一个称为“智能历史记录”的东西,但事实证明,它仅允许用户在光标位于最后一个位置时浏览(未过滤的)历史记录。 Since IPython's history feature comes from a package, shouldn't there be a way to activate it by running a startup script or something similar? 由于IPython的历史记录功能来自软件包,是否应该没有办法通过运行启动脚本或类似方法来激活它?

We currently don't have a feature like this. 我们目前没有这样的功能。 There's several related features in the issue tracker that I'd encourage you to vote or comment upon. 我鼓励您对问题跟踪器中的几个相关功能进行投票或评论。 It's also something the team has had random discussions about recently so getting feedback would be great. 团队最近也对此进行了随机讨论,因此获得反馈将是很棒的。 All the features are a little different so you might like what one says more than the other. 所有功能都有些不同,因此您可能会喜欢一个比另一个说的更多。

The reason it can't currently be activated with a startup script is that the history is currently implemented by the REPL window component running in VS. 当前无法通过启动脚本激活的原因是,历史记录当前是由VS中运行的REPL窗口组件实现的。 It's keeping all of the history in memory in VS and there's no extensibility point for the evaluator to provide history. 它会将所有历史记录保留在VS中的内存中,并且评估人员没有提供历史记录的可扩展点。 We do also accept contributions if you want to hack on a REPL window in C# :) 如果您想破解C#中的REPL窗口,我们也接受捐款 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM