Re: [CEDET-devel] Completion problem with Qt
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2010-03-27 11:43:04
|
Hi, First, could someone suggest some Ubuntu package names I need to install to get all the Qt4 headers? Thanks. When you start a completion, Semantic tries to resolve as much as it can. Thus in the second example, it has resolved "Key", but doesn't know what to do with it. In the first example, "Ke" doesn't resolve, so it finds some completions for you. When you use semantic-debug-assist, it assumes that you haven't gotten the answer you want. Thus, it tries to provide suggestions about what you can do to find more completions other than the ones in the Possible completions list. If the completions you want are there, then you are ok. Thus, in the first case, it fails to find "Ke" in the Qt namespace, which is true. "Prefix" is the internal name of the text Semantic tries to look up, and it failed to resolve to any single thing. Thus, I think it is doing the right thing, but perhaps the output could be better. Would this change help? "Cannot find prefix " --> "Cannot find symbol " For the second, the debug assistant appears to have not been setup for type chains. I'll poke into that a bit more later. Eric On 03/23/2010 06:24 PM, Hannu Koivisto wrote: > Greetings, > > #include<QKeyEvent> > > > int main() > { > Qt::Ke<M-x semantic-analyze-debug-assist RET> > } > > => > > --------------------------------------------------------------- > Cannot find prefix "Ke" in datatype: > namespace Qt {} > Semantic may not have found all possible namespaces with > the name Qt. You can debug the entire typecache, including > merged namespaces with the command: > > M-x semanticdb-typecache-dump RET [ Do It ] > > Possible completions are: > enum Key {} > enum KeyboardModifier {} > > > Known members of Qt: > "enum GlobalColor {}" > ... > "enum Key {}" > ... > --------------------------------------------------------------- > > What does "Cannot find prefix "Ke" in datatype: namespace Qt {}" > mean? Below it seems to list completions beginning with "Ke" > anyway. > > The actual problem: > > #include<QKeyEvent> > > > int main() > { > Qt::Key<M-x semantic-analyze-debug-assist RET> > } > > => > > --------------------------------------------------------------- > Unable to find datatype for: "enum Key {}". > Declared type is: "enum" > > Semantic could not find this data type in any of its global tables. > --------------------------------------------------------------- > > So if I try to complete Qt::Ke, it can find enum Key {}, but if I > try to complete Qt::Key, it cannot find it? It also no longer can > find Qt::KeyboardModifier. > > Difficult to interpret, this is. > > I'm using CEDET from CVS and Qt 4.6 with configuration for CEDET as > follows: > > (defvar qt4-include-base-dir > (if (file-exists-p "~/sroot/usr/include/qt4") > "~/sroot/usr/include/qt4" > "/usr/include/qt4")) > > (defun se::setup-ede-projects () > (interactive) > ;; Qt4 > (loop for dir in (directory-files qt4-include-base-dir t "^Q") > do (semantic-add-system-include dir 'c++-mode)) > (semantic-add-system-include qt4-include-base-dir 'c++-mode) > (add-to-list 'auto-mode-alist (cons (expand-file-name qt4-include-base-dir) 'c++-mode)) > (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-include-base-dir "/Qt/qconfig.h")) > (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-include-base-dir "/Qt/qconfig-dist.h")) > (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-include-base-dir "/Qt/qglobal.h"))) > > Any ideas? > |