Re: [cedet-semantic] (PHP) Resolving Lost Scanned Includes
Brought to you by:
zappo
From: Andrea T. <and...@gm...> - 2015-08-10 12:08:25
|
Eric, It sure does help, that's precisely what I was after! I did some quick experimentation and found that the function `semantic-dependency-tag-file` while reading the docs of `semantic-tag-include-filename` which you suggested. As soon as I changed the body of `semantic-dependency-tag-file`, I was able to see the include tags get highlighted in yellow like they do in Java, as opposed to red. (define-mode-local-override semantic-dependency-tag-file php-mode (tag) "" (ede-php-autoload-find-class-def-file (ede-current-project) (semantic-tag-name tag))) In the above code I'm mapping the type name to an absolute path using `ede-php-autoload-find-class-def-file`, sadly however, the include tags don't do anything when clicked. Could this be caused by the use of an absolute path, or do I have to provide a body to `semantic-tag-include-filename` that's not just `(semantic-tag-name tag)`? Your help is greatly appreciated. Andrea Turso On Mon, Aug 10, 2015 at 1:58 AM, Eric Ludlam <er...@si...> wrote: > On 08/09/2015 06:25 PM, Andrea Turso wrote: > >> Dear Eric, >> >> I have used the the Wisent grammar in semantic/wisent/java-tags.wy to >> create a small parser for PHP [1] >> >> My objective is to extract the list of included classes from a buffer >> and make their name clickable (to jump to definition). >> >> When testing the java-tags parser all import statements are converted >> into Semantic Includes, and it's possible to click on the class name to >> visit its file. >> >> My PHP grammar is also using the INCLUDE-TAG macro, but all includes end >> up being lost, so I wonder if there is anything non-obvious that must be >> done. >> >> I suppose Semantic/SemanticDB/TypeCache (which one?) needs a function to >> map the type name to a file — and for that I might rely on the code from >> another user of this mailing list [2]. >> >> In the past I remember getting as far as finding the >> semanticdb-find-translate-path-includes-default function, but failed to >> understand how to get include tags to be resolved. >> >> I would appreciate if you could tell me what functions do I need to >> override, or write, to achieve similar results to that of the java-tags >> grammar? >> > > Hi Andrea, The PHP stuff sounds great. It is has been unfortunate that > the version in cedet/contrib hasn't been usable. > > The magic you need is `semantic-tag-include-filename', which appears to be > in lisp/cedet/semantic/java.el. > > This converts the string in the tag into a file name. Without it, the > includes infrastructure just trys to use it directly. > > I hope this helps. > Eric > |