At the moment, sidekick looks at the mode of the buffer to choose which parser it
uses (the getParserForBuffer method).
But some buffers have more than one mode, take jsp with some java in as an exemple. it would be quite useful to be able to use java completions within a jsp buffer, completion of beanshell within an actions.xml file, ...
|Submitted||rfrancois - 2009-04-02 - 08:46:32z||Assigned||nobody|
|2009-04-02 - 13:54:52z
|You're mentioning completion, but what about the actual parsing? If a different parser is used for an inner block in the buffer, that belongs to a different mode, then how is the sidekick tree part created for that block? It should be the same wrt completion I think.|
|2009-04-02 - 14:13:44z
|Yes, that is tricky.
Maybe we could treat the chunk of code that is inside as another buffer, parse this "buffer", and add the nodes to the main tree.
completion is easier, because for many languages, you have all the information on the line where the caret is, so you can just pretend that the buffer is of the inner mode to get completion. That is what I have done here to get R completion inside sweave (latex-like) document :
|2009-04-02 - 14:23:59z
|2009-04-02 - 14:38:16z
|Nice ! Did not know about that. Thank you.
Why is this not using positions instead of lines ? (just curious)
Could this be used to delegate the completion as well, does not seem to work for me.