过滤Eclipse的C ++内容辅助 [英] Filtering Eclipse's C++ Content Assist

查看:96
本文介绍了过滤Eclipse的C ++内容辅助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C ++项目中使用Eclipse Ganymede(版本3.4.1).有什么方法可以过滤内容辅助列表,使其仅显示当前上下文中可用的方法和字段?
如果没有,为什么不呢?曾经有一种情况我想访问对象中的私有字段等吗?

I'm using Eclipse Ganymede (version 3.4.1) with a C++ project. Is there some way to filter the content assist list to only show methods and fields that are available in the current context?
If not, why not? Is there ever a situation where I would want to access the private fields, etc. in an object?

推荐答案

看起来不像.至少有一对

Doesn't look like it. There are at least a couple of bugs open regarding this. You're lucky it shows too much! It never seems to assists in any way for me.

最新的CDT(在编写Helios时,CDT版本为7.0.0.201006141710)已修复了第二个错误.但是,当我尝试使用私有成员变量时,它仍然显示在完成列表中,如下所示.

The latest CDT (at the time of writing Helios, with CDT version 7.0.0.201006141710) has the 2nd of those bugs fixed. However private member variables still showed up on the completion list when I tried it out, as shown below.

它似乎确实取决于类中变量声明的顺序.如果在 public 部分之前有 private 部分,则将正确过滤出私有变量.虽然并不完美,但肯定比木卫三要好得多.

It does seem to depend on the order of variable declaration in the class. If you have the private section before the public section the private variables are filtered out correctly. While not perfect, it's certainly a great deal better than it was in Ganymede.

这篇关于过滤Eclipse的C ++内容辅助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆