Re: [CEDET-devel] CEDET and Matlab
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2008-07-19 17:16:32
|
Hi, Thanks for the patch. You're guess is correct that creating a omniscient database for MATLAB is the right way to go. That would give you the structured needed to prevent rescanning over and over. There is semanticdb-skel.el, which you can use to start a new database. Chances are you can just replace SKEL with matlab, copy your code into the right slots, and be done with it. I will likely convert your patch like that before I install it into the matlab-emacs project, though I know I don't have time for that this weekend. For the EDE part, I'm trying to build some infrastructure for simpler projects, where EDE will auto detect some kinds of basic projects w/out the need for full-up code generation. This is an important just as an abstraction layer between file management and semantic, so Semantic doesn't need to know about it. Eric >>> David <de...@ar...> seems to think that: >Following up on a thread from May '08... > >"Eric M. Ludlam" <er...@si...> writes: >>>>> David <de...@ar...> seems to think that: >>>OK, I managed to scan all the tags in my Matlab files with >>>semanticdb-mk.el. This works nicely for completing/searching tags for >>>files in the current directory, but how do I get CEDET/semantic to also >>>use the tags in all the subdirectories? As you said, Matlab doesn't have >>>an 'include' statement, so I guess I would somehow have to specify >>>"manually" which subdirectories should be included? >> >> Since MATLAB doesn't conform to the C like mechanisms, getting this >> sort of thing to work requires overloading all the functions that are >> too C centric. For example, `semanticdb-find-tag-by-name' calls >> something that builds a `path'. That semanticdb-find-translate-path >> should be overridden to include the local file, anything in private >> with the specified name, and anything on the MATLAB path with the >> specified name. (Find-translate-path builds a map of DB tables to >> search, and is different from a what might be considered an include >> path.) > >OK, after some Emacs Lisp I now got back to Matlab. :-) Matlab doesn't >have an include mechanism, instead you could say it simply includes >every function it finds in its path. So I overloaded >semantidb-find-translate-path for matlab-mode to make semantic believe a >M-file just does that. The Matlab path is for now simply specified by a >new variable (semantic-matlab-include-paths), but should be better >replaced by what you already suggested: > >> A second thing is to write a simple EDE project for MATLAB that knows >> how to look at a MATLAB install, and extract the file path. > >But since not everyone uses EDE, I guess it also makes sense to have a >variable to manually specify the search path. > >I attached to this message how far I've come. This is all pretty crude >yet and needs some serious cleaning up; I just copied most of the stuff >from semantidb-find.el, but it already works reasonably well, with the >notable exception of caching. First, caching seems to work: If I >initiate a completion, the find-translate-path function gets called, the >M-files are scanned, and in the subsequent calls to find-translate-path >(still for the same completion) the cached values are used. However, >every time I initiate a *new* completion, the files get >re-scanned. Somehow the include-path in the tag object is not saved >between completions. Maybe you immediately know what the problem is >here, otherwise I'll further have to dig into it. > >I don't know if these is even a good way to do this. Maybe one should >better use an omniscient databases for this, like in Emacs Lisp mode? > >Thanks for your help, >David > [ ... ] -- Eric Ludlam: er...@si... Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net |