gpt4 book ai didi

c++ - Emacs CEDET Semantic 没有自动完成 `this` 关键字。 (C++)

转载 作者:太空宇宙 更新时间:2023-11-04 11:58:32 25 4
gpt4 key购买 nike

#include <iostream>

class SomeStructure
{
int mMemberOne;
float mMemberTwo;

char MemberFunction()
{
int test = 0;
++test;
this->
}
};

int main()
{
SomeStructure abc;
abc.MemberFunctionMemberFunction
}

除我尝试自动完成 this-> 外,此文件中的任何其他自动完成都有效。我没有得到任何建议。运行 semantic-analyze-debug-assist 给我这个:

Unable to find symbol this.

The prefix lookup code threw the following error:
(error "Cannot find definition for \"this\"")

To debug this error you can do this:
M-x toggle-debug-on-error RET [ Do It ]
and then re-run the debug analyzer.

M-x bovinate 给我:

(("iostream" include   (:system-flag t)   (unlink-hook    (semantic--tag-unlink-secondary-overlays)    secondary-overlays    (#<overlay from 1 to 20 in junk.cpp>)    dependency-file "c:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/include/iostream" link-hook    (semantic--tag-link-secondary-overlays)    unlink-copy-hook    (semantic--tag-unlink-copy-secondary-overlays)    :filename "d:/project/client/junk.cpp")   #<overlay from 1 to 20 in junk.cpp>)  ("SomeStructure" type   (:members    (("mMemberOne" variable
(:type "int")
(reparse-symbol classsubparts)
#<overlay from 46 to 61 in junk.cpp>)
("mMemberTwo" variable
(:type "float")
(reparse-symbol classsubparts)
#<overlay from 64 to 81 in junk.cpp>)
("MemberFunction" function
(:type "char")
(unlink-copy-hook
(semantic--tag-unlink-copy-secondary-overlays)
link-hook
(semantic--tag-link-secondary-overlays)
reparse-symbol classsubparts secondary-overlays
(#<overlay from 85 to 107 in junk.cpp>)
unlink-hook
(semantic--tag-unlink-secondary-overlays))
#<overlay from 85 to 165 in junk.cpp>)) :type "class") (unlink-copy-hook (semantic--tag-unlink-copy-secondary-overlays) link-hook (semantic--tag-link-secondary-overlays) secondary-overlays (#<overlay from 22 to 42 in junk.cpp>) unlink-hook (semantic--tag-unlink-secondary-overlays)) #<overlay from 22 to 168 in junk.cpp>) ("main" function (:type "int") (unlink-copy-hook (semantic--tag-unlink-copy-secondary-overlays) link-hook (semantic--tag-link-secondary-overlays) secondary-overlays (#<overlay from 172 to 183 in junk.cpp>) unlink-hook (semantic--tag-unlink-secondary-overlays)) #<overlay from 172 to 250 in junk.cpp>))

所以看起来 SomeStructure 结构被正确解析了。看起来语义在 this 方面有某种问题。

此外,我还按照错误的建议在启用 toggle-debug-on-error 的情况下重新运行,但是即使启用了该功能,调试器似乎也不会因错误而中断。

使用最新版本的 emacs (24) 和 cedet (trunk)。

我不敢相信我是唯一遇到这个问题的人,这一定是我做错了什么......

最佳答案

我已经与其中一位维护者 (David Engster) 通信,他非常积极地为此提供了修复。自修订版 8490 起,可以在 CEDET 的 bzr 存储库中找到该修复程序

关于c++ - Emacs CEDET Semantic 没有自动完成 `this` 关键字。 (C++),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15128186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com