Re: [cedet-semantic] Semantic search and intellisense completion.
Brought to you by:
zappo
From: Hadron <had...@go...> - 2007-05-15 10:05:16
|
"Jamie Macbeth" <jam...@gm...> writes: > Hi, Hadron, Eric, and others > > I went through some of the same difficulty with semantic intellisense > completion a couple of months ago. i hope that you guys don't mind me > putting my two cents in. please correct me on any of these points if > i'm wrong > > first, semantic does require that you include the header file of > interest in order to get completion on any symbols. to me this seems The file must be re-opened too which is a pain to be honest. Eric has indicated he might change this in the future. I would sooner wait for 10 seconds when I open a C program than have to manually track and open each header file which includes values I wish to complete on. > to be a nice optimization. by default semantic performs a recursive > search through included header files to collect tags for completion, > so if your fstab.h header file includes other header files that are > needed to perform the completion they will be searched. A recent correspondence suggests that some of the clever c wizardry in the Linux headers might just not be handled properly at the moment by semantic parser :( (What *do* the Linux app programmers use for completion etc ?). Surely not that java horror Eclipse :-; ? > > second, and way more important, usually semantic needs to be able to > find the header file itself in the filesystem before it gets it's > tags. it needs the full path to the header before it tries to find > the tag table for the header in any database. semantic stores tag > caches on a directory by directory basis, so it wants the full path to > the file to know which directory cache to look in. > > for system databases, i found that i needed to add the path in > manually before creating the database. i put this in my .emacs. > > (defun semantic-c-mode-hook () > (semantic-add-system-include "/path/to/header/files")) > (add-hook 'c-mode-common-hook 'semantic-c-mode-hook) > (add-hook 'c-mode-hook 'semantic-c-mode-hook) I pointed this to the root of my (local) Linux header hierarchy and still no joy. > > one easy way to make sure that semantic is indeed caching tags and > creating system databases correctly is by looking for a file called > "semantic.cache" in the directory of interest. it is a text file and > you can look through it. by the way, if you try to create a database > where you don't have permission to write a file i think it will fail > ... i always put this in my .emacs. > > (setq semanticdb-default-save-directory "/home/directory/.semanticdb") Yup - I had that since at one stage I didnt keep a local copy. > > and it stores all of the caches there. > > finally, if the "unloaded" flag is not set in the > semanticdb-find-default-throttle, semantic will not automatically open > a header file that it has never seen, even if it has the path to it. I believe from earlier comments from Eric that this is broken. I have a situation at the moment where even if I open the file of interest (in my local Linux header hierarchy) it is not parsing and creating a cache file which makes me wonder if I have to add each and every directory to the system-include? The paths confuse me. I see no real reason to differentiate between "system headers" and "project headers". Simply have a set of paths each of which is the root of a hierarchy to search - and an option to follow symbolic links. I would say that how semantic locates files is the most difficult for a noob at the moment. I am pretty sure I read something somewhere in the docs that it ignores certain system files too - but I cant find it again. > > Jamie |