Re: Altering semantic semantic-complete-analyze-inline completion

Eric Ludlam <[email protected]> Wed, 26 Aug 2015 10:07:10 -0400
Newsgroups gmane.emacs.semantic
Message-ID <CACXnnKNXhYHnFWOpjA3GV8eaH5r4iA031Lvf5XRe69CDfs_2iw@mail.gmail.com>
I need to answer this from memory as my computer is still in the shop for a
repair.

Several of the completion tools eventually call one of the
semantic-format-* functions to output the string.  That could be a good
entry point.  On the whole though, the assumption is that symbols are just
symbols.  If you need more the format fcns can assemble a sequence
together.  (I think).

Another possibility is to tweak things at the layer that parses symbol
sequences to allow $ etc between symbols, and then the user needs to know
to type that first.

Eric
On Aug 25, 2015 7:02 PM, "Andrea Turso" <[email protected]> wrote:

> Hello,
>
> tl;dr: the completion displayer class (semantic-complete-
> inline-analyzer-displayor-class) only controls only the appearance of the
> completion candidate so how can I alter the completion string when it's
> actually inserted in the buffer, for example to drop the first character
> under a specific condition?
>
> What would be the recommended way of handling this odd completion
> requirement?
>
> In PHP class fields – being variables – they all notoriously begin with a
> $ symbol which creates an interesting problem when the completion happens
> when completing instance attributes, for example:
>
> $this->fieldName;
>
> To complicate things, static fields are accessed with the self:: or
> static:: prefix so ideally I would like to be able to control this
> behaviour based on that.
>
> At first I thought about catering for this directly in the parser to strip
> the first char off certain tags either by means of changing the regexp
> analyser for variables – provided that capturing groups work? – or with
> some lisp code in the grammar actions, alternatively a custom tag and/or
> macro.
>
> The only somewhat related option that propped up in my search was the
> variable semantic-complete-inline-analyzer-displayor-class, which I think
> only affects how the possible completions get displayed and doesn't seem
> like a good starting point.
>
> Thanks,
> Andrea.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> cedet-semantic mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cedet-semantic
>
>

------------------------------------------------------------------------------

_______________________________________________
cedet-semantic mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-semantic