Eclipse CDT(用于 C++/C 开发)如何在键入时自动调用内容辅助
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5509052/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse CDT (for C++/C development) how to invoke content assist automatically while typing
提问by Nadith Pathirage
Eclipse CDT (for C++/C development) how to invoke content assist automatically while typing like in Visual Assist for Visual Studio. In other words how to give triggers as all keyboard characters to invoke content assist. Please help me..
Eclipse CDT(用于 C++/C 开发)如何在键入时自动调用内容辅助,如 Visual Assist for Visual Studio。换句话说,如何将触发器作为所有键盘字符来调用内容辅助。请帮我..
回答by EboMike
It seems that all the useful content assist options are turned off by default. Go to the preferences -> C++ -> Editor -> Content Assist -> Advanced, and check Parsing-based proposal for default (top list) and then some more (like parsing, word, template) in the bottom one.
似乎所有有用的内容辅助选项都默认关闭。转到首选项 -> C++ -> 编辑器 -> 内容辅助 -> 高级,并检查基于解析的默认建议(顶部列表),然后在底部检查更多(如解析、单词、模板)。
Of course, you're free to check even more, but parsing-based is the one that matters the most. Of course, you also need to have indexing enabled, by at least thatseems to be enabled by default.
当然,您可以自由检查更多内容,但基于解析的才是最重要的。当然,您还需要启用索引,至少这似乎是默认启用的。
And, of course, as already suggested, go to the Content Assist pane itself and make sure it's all turned on, and reduce the delay to make it show up faster (unless you want it to only show up when you press Ctrl+Space).
而且,当然,正如已经建议的那样,转到“内容辅助”窗格本身并确保其全部打开,并减少延迟以使其显示得更快(除非您希望它仅在按 Ctrl+Space 时显示) .
回答by Janis
The sad thing is that - at least to my knowledge - content assist didn't change in those 2 years. It is still only triggered by ".", "->" and "::" and there is no way to configure it. The Eclipse Java editor though can be freely configured as wished by Nadith Pathirage: You can add any keys you wish to trigger content assist there. I wonder why CDT can't achieve the same...
可悲的是 - 至少据我所知 - 内容辅助在那两年没有改变。它仍然只由“.”、“->”和“::”触发,并且没有办法配置它。Eclipse Java 编辑器可以根据 Nadith Pathirage 的意愿自由配置:您可以添加任何您希望在那里触发内容辅助的键。我想知道为什么 CDT 不能实现相同的...
(I know this is an old thread, but the topic is still important in my opinion...)
(我知道这是一个旧线程,但在我看来这个话题仍然很重要......)
回答by dzhwinter
ctrl+Space can work well. but configure as auto-complete just like emacs auto-complete or vim youcompleteme, when typing words will invoke proposal, no way.
ctrl+Space 可以很好地工作。但是配置为自动完成就像 emacs 自动完成或 vim youcompleteme 一样,输入单词时会调用建议,没办法。
回答by trenki
Have you tried Ctrl+Space
? Also search for "Content Assist" in the preferences.
你试过Ctrl+Space
吗?同时在首选项中搜索“内容辅助”。