November 08, 2014
On 8/11/2014 4:16 a.m., Bruno Medeiros wrote:
> On 31/10/2014 12:16, Rikki Cattermole wrote:
>> On 1/11/2014 12:35 a.m., Bruno Medeiros wrote:
>>> On 27/10/2014 22:35, Jeremy Powers via Digitalmars-d wrote:
>>>>
>>>> An interesting path to take for an intellij plugin would be to use his
>>>> DCD/libdparse for all the heavy lifting, with the plugin just farming
>>>> out the work to external daemon process(es).  That would avoid having
>>>> yet another lexer/parser implementation to keep up to date.
>>>
>>> Integrating DCD might work well, because autocompletion is used
>>> sporadically (and is invoked explicitly by the user). But parsing is
>>> probably invoked quite often by IntelliJ, and as such it could be tricky
>>> to integrate with libdparse (because you'd have to invoke an external
>>> process all the time)
>>
>>  From my small test file with my attempt at this, its fine to call e.g.
>> DScanner to grab the ast. Its actually pretty fast which I was a little
>> shocked about.
>>
>
> How fast is "pretty fast"? Milliseconds please.

I didn't benchmark it. So no idea.

December 16, 2014
On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote:
> On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via Digitalmars-d wrote:
>> This looks eerily familiar...
>>
>> I took a stab at an Intellij plugin a long time ago, and happened to pick
>> the same name:
>>
>> https://github.com/elendel-/intelliD
>>
>> Been meaning to pick back up again, but haven't had the chance... was
>> waiting for the Eclipse plugin code to mature, then got distracted.  Feel
>> free to take anything that looks useful.
>>
>>
>> Brian Schott (Hackerpilot) has done a lot of useful work grammar wise.  See:
>>
>> https://github.com/Hackerpilot/DGrammar
>>
>> An interesting path to take for an intellij plugin would be to use his
>> DCD/libdparse for all the heavy lifting, with the plugin just farming out
>> the work to external daemon process(es).  That would avoid having yet
>> another lexer/parser implementation to keep up to date.
>>
>
> I actually forked yours originally to get it running in IDEA 14, then decided to mess with the lexer since it was causing some problems and went off from there. I saw it was somewhat inactive and tried contacting you, but couldn't find any of your contact info anywhere! Glad to see you turned up here.

Hi guys,

I have been working on an intellij plugin which is here: https://github.com/kingsleyh/DLanguage

I only started learning D a couple of weeks ago and I haven't written an intellij plugin before - and also I'm not very familiar with parsing/lexing.

On my first pass - I got all the infrastructure working - e.g. run configurations, project creation, file creation etc. And I'm working on a BNF and JFlex by hand - but I realise it will take some time - so I have a branch which implements the DDT parser/lexer so I could get something working while I work on the bnf - however it breaks the contextual run configurations - which is pretty much essential for the plugin to be useful.

I'd like to get the DDT parser/lexer working but I'm not really sure where to go from where I am now. My DDT branch is called with_ddt.

If anyone has any pointers to what I need to do next that would be very helpful - even in terms of reading or reference material. I guess it all comes down to the DParserDefinition class - as my master branch uses a FlexAdapter which gives access to the context. But in the with_ddt branch its just using the DParser - which I think needs to have the hooks into the AST tree implemented or something like that.

Anyway let me know if you have any pointers or offers of help :)

--K
December 17, 2014
On Tuesday, 16 December 2014 at 23:25:02 UTC, Kingsley wrote:
> On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote:
>> On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via Digitalmars-d wrote:
>>> This looks eerily familiar...
>>>
>>> I took a stab at an Intellij plugin a long time ago, and happened to pick
>>> the same name:
>>>
>>> https://github.com/elendel-/intelliD
>>>
>>> Been meaning to pick back up again, but haven't had the chance... was
>>> waiting for the Eclipse plugin code to mature, then got distracted.  Feel
>>> free to take anything that looks useful.
>>>
>>>
>>> Brian Schott (Hackerpilot) has done a lot of useful work grammar wise.  See:
>>>
>>> https://github.com/Hackerpilot/DGrammar
>>>
>>> An interesting path to take for an intellij plugin would be to use his
>>> DCD/libdparse for all the heavy lifting, with the plugin just farming out
>>> the work to external daemon process(es).  That would avoid having yet
>>> another lexer/parser implementation to keep up to date.
>>>
>>
>> I actually forked yours originally to get it running in IDEA 14, then decided to mess with the lexer since it was causing some problems and went off from there. I saw it was somewhat inactive and tried contacting you, but couldn't find any of your contact info anywhere! Glad to see you turned up here.
>
> Hi guys,
>
> I have been working on an intellij plugin which is here: https://github.com/kingsleyh/DLanguage
>
> I only started learning D a couple of weeks ago and I haven't written an intellij plugin before - and also I'm not very familiar with parsing/lexing.
>
> On my first pass - I got all the infrastructure working - e.g. run configurations, project creation, file creation etc. And I'm working on a BNF and JFlex by hand - but I realise it will take some time - so I have a branch which implements the DDT parser/lexer so I could get something working while I work on the bnf - however it breaks the contextual run configurations - which is pretty much essential for the plugin to be useful.
>
> I'd like to get the DDT parser/lexer working but I'm not really sure where to go from where I am now. My DDT branch is called with_ddt.
>
> If anyone has any pointers to what I need to do next that would be very helpful - even in terms of reading or reference material. I guess it all comes down to the DParserDefinition class - as my master branch uses a FlexAdapter which gives access to the context. But in the with_ddt branch its just using the DParser - which I think needs to have the hooks into the AST tree implemented or something like that.
>
> Anyway let me know if you have any pointers or offers of help :)
>
> --K

Actually I guess what I need is a way to make the PSI structure. I'm not sure how I would do that with the DDT code I have imported.
December 17, 2014
On 17/12/2014 1:35 p.m., Kingsley wrote:
> On Tuesday, 16 December 2014 at 23:25:02 UTC, Kingsley wrote:
>> On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote:
>>> On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via
>>> Digitalmars-d wrote:
>>>> This looks eerily familiar...
>>>>
>>>> I took a stab at an Intellij plugin a long time ago, and happened to
>>>> pick
>>>> the same name:
>>>>
>>>> https://github.com/elendel-/intelliD
>>>>
>>>> Been meaning to pick back up again, but haven't had the chance... was
>>>> waiting for the Eclipse plugin code to mature, then got distracted.
>>>> Feel
>>>> free to take anything that looks useful.
>>>>
>>>>
>>>> Brian Schott (Hackerpilot) has done a lot of useful work grammar
>>>> wise.  See:
>>>>
>>>> https://github.com/Hackerpilot/DGrammar
>>>>
>>>> An interesting path to take for an intellij plugin would be to use his
>>>> DCD/libdparse for all the heavy lifting, with the plugin just
>>>> farming out
>>>> the work to external daemon process(es).  That would avoid having yet
>>>> another lexer/parser implementation to keep up to date.
>>>>
>>>
>>> I actually forked yours originally to get it running in IDEA 14, then
>>> decided to mess with the lexer since it was causing some problems and
>>> went off from there. I saw it was somewhat inactive and tried
>>> contacting you, but couldn't find any of your contact info anywhere!
>>> Glad to see you turned up here.
>>
>> Hi guys,
>>
>> I have been working on an intellij plugin which is here:
>> https://github.com/kingsleyh/DLanguage
>>
>> I only started learning D a couple of weeks ago and I haven't written
>> an intellij plugin before - and also I'm not very familiar with
>> parsing/lexing.
>>
>> On my first pass - I got all the infrastructure working - e.g. run
>> configurations, project creation, file creation etc. And I'm working
>> on a BNF and JFlex by hand - but I realise it will take some time - so
>> I have a branch which implements the DDT parser/lexer so I could get
>> something working while I work on the bnf - however it breaks the
>> contextual run configurations - which is pretty much essential for the
>> plugin to be useful.
>>
>> I'd like to get the DDT parser/lexer working but I'm not really sure
>> where to go from where I am now. My DDT branch is called with_ddt.
>>
>> If anyone has any pointers to what I need to do next that would be
>> very helpful - even in terms of reading or reference material. I guess
>> it all comes down to the DParserDefinition class - as my master branch
>> uses a FlexAdapter which gives access to the context. But in the
>> with_ddt branch its just using the DParser - which I think needs to
>> have the hooks into the AST tree implemented or something like that.
>>
>> Anyway let me know if you have any pointers or offers of help :)
>>
>> --K
>
> Actually I guess what I need is a way to make the PSI structure. I'm not
> sure how I would do that with the DDT code I have imported.

I've sent you an email reguarding my own work on getting a plugin together using Dscanner. As well as the source code.
Feel free to use it.
December 17, 2014
On Wednesday, 17 December 2014 at 03:03:59 UTC, Rikki Cattermole wrote:
> On 17/12/2014 1:35 p.m., Kingsley wrote:
>> On Tuesday, 16 December 2014 at 23:25:02 UTC, Kingsley wrote:
>>> On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote:
>>>> On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via
>>>> Digitalmars-d wrote:
>>>>> This looks eerily familiar...
>>>>>
>>>>> I took a stab at an Intellij plugin a long time ago, and happened to
>>>>> pick
>>>>> the same name:
>>>>>
>>>>> https://github.com/elendel-/intelliD
>>>>>
>>>>> Been meaning to pick back up again, but haven't had the chance... was
>>>>> waiting for the Eclipse plugin code to mature, then got distracted.
>>>>> Feel
>>>>> free to take anything that looks useful.
>>>>>
>>>>>
>>>>> Brian Schott (Hackerpilot) has done a lot of useful work grammar
>>>>> wise.  See:
>>>>>
>>>>> https://github.com/Hackerpilot/DGrammar
>>>>>
>>>>> An interesting path to take for an intellij plugin would be to use his
>>>>> DCD/libdparse for all the heavy lifting, with the plugin just
>>>>> farming out
>>>>> the work to external daemon process(es).  That would avoid having yet
>>>>> another lexer/parser implementation to keep up to date.
>>>>>
>>>>
>>>> I actually forked yours originally to get it running in IDEA 14, then
>>>> decided to mess with the lexer since it was causing some problems and
>>>> went off from there. I saw it was somewhat inactive and tried
>>>> contacting you, but couldn't find any of your contact info anywhere!
>>>> Glad to see you turned up here.
>>>
>>> Hi guys,
>>>
>>> I have been working on an intellij plugin which is here:
>>> https://github.com/kingsleyh/DLanguage
>>>
>>> I only started learning D a couple of weeks ago and I haven't written
>>> an intellij plugin before - and also I'm not very familiar with
>>> parsing/lexing.
>>>
>>> On my first pass - I got all the infrastructure working - e.g. run
>>> configurations, project creation, file creation etc. And I'm working
>>> on a BNF and JFlex by hand - but I realise it will take some time - so
>>> I have a branch which implements the DDT parser/lexer so I could get
>>> something working while I work on the bnf - however it breaks the
>>> contextual run configurations - which is pretty much essential for the
>>> plugin to be useful.
>>>
>>> I'd like to get the DDT parser/lexer working but I'm not really sure
>>> where to go from where I am now. My DDT branch is called with_ddt.
>>>
>>> If anyone has any pointers to what I need to do next that would be
>>> very helpful - even in terms of reading or reference material. I guess
>>> it all comes down to the DParserDefinition class - as my master branch
>>> uses a FlexAdapter which gives access to the context. But in the
>>> with_ddt branch its just using the DParser - which I think needs to
>>> have the hooks into the AST tree implemented or something like that.
>>>
>>> Anyway let me know if you have any pointers or offers of help :)
>>>
>>> --K
>>
>> Actually I guess what I need is a way to make the PSI structure. I'm not
>> sure how I would do that with the DDT code I have imported.
>
> I've sent you an email reguarding my own work on getting a plugin together using Dscanner. As well as the source code.
> Feel free to use it.

I've successfully integrated the Psi generation stuff with the DDT parser/lexer now with a huge thanks to Rikki. So now I think I can add all the other ps related stuff - code insight, refactoring, completion etc etc

Of course its the first cut - so I'll have to do some code cleanup once I understand what I'm doing!

Thanks for your help and support :)
December 17, 2014
On 17/12/2014 09:13, Kingsley wrote:
> On Wednesday, 17 December 2014 at 03:03:59 UTC, Rikki Cattermole wrote:
>> On 17/12/2014 1:35 p.m., Kingsley wrote:
>>> On Tuesday, 16 December 2014 at 23:25:02 UTC, Kingsley wrote:
>>>> On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote:
>>>>> On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via
>>>>> Digitalmars-d wrote:
>>>>>> This looks eerily familiar...
>>>>>>
>>>>>> I took a stab at an Intellij plugin a long time ago, and happened to
>>>>>> pick
>>>>>> the same name:
>>>>>>
>>>>>> https://github.com/elendel-/intelliD
>>>>>>
>>>>>> Been meaning to pick back up again, but haven't had the chance... was
>>>>>> waiting for the Eclipse plugin code to mature, then got distracted.
>>>>>> Feel
>>>>>> free to take anything that looks useful.
>>>>>>
>>>>>>
>>>>>> Brian Schott (Hackerpilot) has done a lot of useful work grammar
>>>>>> wise.  See:
>>>>>>
>>>>>> https://github.com/Hackerpilot/DGrammar
>>>>>>
>>>>>> An interesting path to take for an intellij plugin would be to use
>>>>>> his
>>>>>> DCD/libdparse for all the heavy lifting, with the plugin just
>>>>>> farming out
>>>>>> the work to external daemon process(es).  That would avoid having yet
>>>>>> another lexer/parser implementation to keep up to date.
>>>>>>
>>>>>
>>>>> I actually forked yours originally to get it running in IDEA 14, then
>>>>> decided to mess with the lexer since it was causing some problems and
>>>>> went off from there. I saw it was somewhat inactive and tried
>>>>> contacting you, but couldn't find any of your contact info anywhere!
>>>>> Glad to see you turned up here.
>>>>
>>>> Hi guys,
>>>>
>>>> I have been working on an intellij plugin which is here:
>>>> https://github.com/kingsleyh/DLanguage
>>>>
>>>> I only started learning D a couple of weeks ago and I haven't written
>>>> an intellij plugin before - and also I'm not very familiar with
>>>> parsing/lexing.
>>>>
>>>> On my first pass - I got all the infrastructure working - e.g. run
>>>> configurations, project creation, file creation etc. And I'm working
>>>> on a BNF and JFlex by hand - but I realise it will take some time - so
>>>> I have a branch which implements the DDT parser/lexer so I could get
>>>> something working while I work on the bnf - however it breaks the
>>>> contextual run configurations - which is pretty much essential for the
>>>> plugin to be useful.
>>>>
>>>> I'd like to get the DDT parser/lexer working but I'm not really sure
>>>> where to go from where I am now. My DDT branch is called with_ddt.
>>>>
>>>> If anyone has any pointers to what I need to do next that would be
>>>> very helpful - even in terms of reading or reference material. I guess
>>>> it all comes down to the DParserDefinition class - as my master branch
>>>> uses a FlexAdapter which gives access to the context. But in the
>>>> with_ddt branch its just using the DParser - which I think needs to
>>>> have the hooks into the AST tree implemented or something like that.
>>>>
>>>> Anyway let me know if you have any pointers or offers of help :)
>>>>
>>>> --K
>>>
>>> Actually I guess what I need is a way to make the PSI structure. I'm not
>>> sure how I would do that with the DDT code I have imported.
>>
>> I've sent you an email reguarding my own work on getting a plugin
>> together using Dscanner. As well as the source code.
>> Feel free to use it.
>
> I've successfully integrated the Psi generation stuff with the DDT
> parser/lexer now with a huge thanks to Rikki. So now I think I can add
> all the other ps related stuff - code insight, refactoring, completion
> etc etc
>
> Of course its the first cut - so I'll have to do some code cleanup once
> I understand what I'm doing!
>
> Thanks for your help and support :)

Also, if you have questions about the DDT parser/lexer, or if there are changes that might help your project, let me know, I'll be glad to add such changes (assuming they also fit well with the way DDT uses the parser/lexer).


-- 
Bruno Medeiros
https://twitter.com/brunodomedeiros
December 17, 2014
On Wednesday, 17 December 2014 at 12:31:32 UTC, Bruno Medeiros wrote:
> On 17/12/2014 09:13, Kingsley wrote:
>> On Wednesday, 17 December 2014 at 03:03:59 UTC, Rikki Cattermole wrote:
>>> On 17/12/2014 1:35 p.m., Kingsley wrote:
>>>> On Tuesday, 16 December 2014 at 23:25:02 UTC, Kingsley wrote:
>>>>> On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote:
>>>>>> On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via
>>>>>> Digitalmars-d wrote:
>>>>>>> This looks eerily familiar...
>>>>>>>
>>>>>>> I took a stab at an Intellij plugin a long time ago, and happened to
>>>>>>> pick
>>>>>>> the same name:
>>>>>>>
>>>>>>> https://github.com/elendel-/intelliD
>>>>>>>
>>>>>>> Been meaning to pick back up again, but haven't had the chance... was
>>>>>>> waiting for the Eclipse plugin code to mature, then got distracted.
>>>>>>> Feel
>>>>>>> free to take anything that looks useful.
>>>>>>>
>>>>>>>
>>>>>>> Brian Schott (Hackerpilot) has done a lot of useful work grammar
>>>>>>> wise.  See:
>>>>>>>
>>>>>>> https://github.com/Hackerpilot/DGrammar
>>>>>>>
>>>>>>> An interesting path to take for an intellij plugin would be to use
>>>>>>> his
>>>>>>> DCD/libdparse for all the heavy lifting, with the plugin just
>>>>>>> farming out
>>>>>>> the work to external daemon process(es).  That would avoid having yet
>>>>>>> another lexer/parser implementation to keep up to date.
>>>>>>>
>>>>>>
>>>>>> I actually forked yours originally to get it running in IDEA 14, then
>>>>>> decided to mess with the lexer since it was causing some problems and
>>>>>> went off from there. I saw it was somewhat inactive and tried
>>>>>> contacting you, but couldn't find any of your contact info anywhere!
>>>>>> Glad to see you turned up here.
>>>>>
>>>>> Hi guys,
>>>>>
>>>>> I have been working on an intellij plugin which is here:
>>>>> https://github.com/kingsleyh/DLanguage
>>>>>
>>>>> I only started learning D a couple of weeks ago and I haven't written
>>>>> an intellij plugin before - and also I'm not very familiar with
>>>>> parsing/lexing.
>>>>>
>>>>> On my first pass - I got all the infrastructure working - e.g. run
>>>>> configurations, project creation, file creation etc. And I'm working
>>>>> on a BNF and JFlex by hand - but I realise it will take some time - so
>>>>> I have a branch which implements the DDT parser/lexer so I could get
>>>>> something working while I work on the bnf - however it breaks the
>>>>> contextual run configurations - which is pretty much essential for the
>>>>> plugin to be useful.
>>>>>
>>>>> I'd like to get the DDT parser/lexer working but I'm not really sure
>>>>> where to go from where I am now. My DDT branch is called with_ddt.
>>>>>
>>>>> If anyone has any pointers to what I need to do next that would be
>>>>> very helpful - even in terms of reading or reference material. I guess
>>>>> it all comes down to the DParserDefinition class - as my master branch
>>>>> uses a FlexAdapter which gives access to the context. But in the
>>>>> with_ddt branch its just using the DParser - which I think needs to
>>>>> have the hooks into the AST tree implemented or something like that.
>>>>>
>>>>> Anyway let me know if you have any pointers or offers of help :)
>>>>>
>>>>> --K
>>>>
>>>> Actually I guess what I need is a way to make the PSI structure. I'm not
>>>> sure how I would do that with the DDT code I have imported.
>>>
>>> I've sent you an email reguarding my own work on getting a plugin
>>> together using Dscanner. As well as the source code.
>>> Feel free to use it.
>>
>> I've successfully integrated the Psi generation stuff with the DDT
>> parser/lexer now with a huge thanks to Rikki. So now I think I can add
>> all the other ps related stuff - code insight, refactoring, completion
>> etc etc
>>
>> Of course its the first cut - so I'll have to do some code cleanup once
>> I understand what I'm doing!
>>
>> Thanks for your help and support :)
>
> Also, if you have questions about the DDT parser/lexer, or if there are changes that might help your project, let me know, I'll be glad to add such changes (assuming they also fit well with the way DDT uses the parser/lexer).

Hi Bruno,

Thanks very much. I do have a couple of questions about DDT in relation to my plugin.

Firstly - I'm not too familiar with parsing/lexing but at the moment the Psi Structure I have implemented that comes from the DDT parser/lexer is not in any kind of hierarchy. All the PsiElements are available but all at the same level. Is this how the DDT parser works? Or is it down to my implementation of the Parser/Lexer that wraps it to create some hierarchy.

For intellij it's going to be vastly easier to have a hierarchy with nested elements in order to get hold of a structure representing a class or a function for example - in order to do things like get the start and end lines of a class definition in order to apply code folding and to use for searching for classes and stuff.

Secondly - how active it the development of DDT - does it keep up with the D2 releases.

--Kingsley
December 17, 2014
> Hi Bruno,
>
> Thanks very much. I do have a couple of questions about DDT in relation to my plugin.
>
> Firstly - I'm not too familiar with parsing/lexing but at the moment the Psi Structure I have implemented that comes from the DDT parser/lexer is not in any kind of hierarchy. All the PsiElements are available but all at the same level. Is this how the DDT parser works? Or is it down to my implementation of the Parser/Lexer that wraps it to create some hierarchy.
>
> For intellij it's going to be vastly easier to have a hierarchy with nested elements in order to get hold of a structure representing a class or a function for example - in order to do things like get the start and end lines of a class definition in order to apply code folding and to use for searching for classes and stuff.
>
> Secondly - how active it the development of DDT - does it keep up with the D2 releases.
>
> --Kingsley

After doing a bit more research it looks like I have to create the psi hierarchy myself - my current psi structure is flat because I'm just converting the DeeTokens into PsiElements directly. I've still got some experimentation to do. On the plus side I implemented commenting, code folding but everything else needs a psi hierarchy

December 18, 2014
On Wednesday, 17 December 2014 at 21:05:05 UTC, Kingsley wrote:
>
>> Hi Bruno,
>>
>> Thanks very much. I do have a couple of questions about DDT in relation to my plugin.
>>
>> Firstly - I'm not too familiar with parsing/lexing but at the moment the Psi Structure I have implemented that comes from the DDT parser/lexer is not in any kind of hierarchy. All the PsiElements are available but all at the same level. Is this how the DDT parser works? Or is it down to my implementation of the Parser/Lexer that wraps it to create some hierarchy.
>>
>> For intellij it's going to be vastly easier to have a hierarchy with nested elements in order to get hold of a structure representing a class or a function for example - in order to do things like get the start and end lines of a class definition in order to apply code folding and to use for searching for classes and stuff.
>>
>> Secondly - how active it the development of DDT - does it keep up with the D2 releases.
>>
>> --Kingsley
>
> After doing a bit more research it looks like I have to create the psi hierarchy myself - my current psi structure is flat because I'm just converting the DeeTokens into PsiElements directly. I've still got some experimentation to do. On the plus side I implemented commenting, code folding but everything else needs a psi hierarchy

I've done some more investigation and I do need to build the parser myself in order to create the various constructs. I've made a start but I haven't gotten very far yet because I don't fully understand the correct way to proceed.

I also had a look at using the DeeParser - because it already does most of what I want. However the intellij plugin wants a PsiParser which returns an intellij ASTNode in the primary parse method. I can't see an easy way to hook this up with DeeParser because the ParsedResult although had a node method on it - gives back the wrong type of ASTNode.

Any pointers on how I might get the DeeParser to interface to an intellij ASTNode would be appreciated.
December 19, 2014
On 19/12/2014 10:19 a.m., Kingsley wrote:
> On Wednesday, 17 December 2014 at 21:05:05 UTC, Kingsley wrote:
>>
>>> Hi Bruno,
>>>
>>> Thanks very much. I do have a couple of questions about DDT in
>>> relation to my plugin.
>>>
>>> Firstly - I'm not too familiar with parsing/lexing but at the moment
>>> the Psi Structure I have implemented that comes from the DDT
>>> parser/lexer is not in any kind of hierarchy. All the PsiElements are
>>> available but all at the same level. Is this how the DDT parser
>>> works? Or is it down to my implementation of the Parser/Lexer that
>>> wraps it to create some hierarchy.
>>>
>>> For intellij it's going to be vastly easier to have a hierarchy with
>>> nested elements in order to get hold of a structure representing a
>>> class or a function for example - in order to do things like get the
>>> start and end lines of a class definition in order to apply code
>>> folding and to use for searching for classes and stuff.
>>>
>>> Secondly - how active it the development of DDT - does it keep up
>>> with the D2 releases.
>>>
>>> --Kingsley
>>
>> After doing a bit more research it looks like I have to create the psi
>> hierarchy myself - my current psi structure is flat because I'm just
>> converting the DeeTokens into PsiElements directly. I've still got
>> some experimentation to do. On the plus side I implemented commenting,
>> code folding but everything else needs a psi hierarchy
>
> I've done some more investigation and I do need to build the parser
> myself in order to create the various constructs. I've made a start but
> I haven't gotten very far yet because I don't fully understand the
> correct way to proceed.
>
> I also had a look at using the DeeParser - because it already does most
> of what I want. However the intellij plugin wants a PsiParser which
> returns an intellij ASTNode in the primary parse method. I can't see an
> easy way to hook this up with DeeParser because the ParsedResult
> although had a node method on it - gives back the wrong type of ASTNode.
>
> Any pointers on how I might get the DeeParser to interface to an
> intellij ASTNode would be appreciated.

Read my codebase again, it'll answer a lot of questions. Your parser is different, but what it produces shouldn't be. and yes it supports hierarchies.