Open Camuvingian opened 10 years ago
I changed the avalon edit version in the completion sample to use the NRefactory IDocument, normally it has it's own (the plan was for avalon edit to eventually have a version that shares IDocument with NRefactory, I read this somewhere on the Nrefactory forums). This is why it works so seamlessly in my example. However if you add NRefactory and AvalonEdit from NuGet some additional work is required.
See the current CShell code for more details: https://github.com/lukebuehler/CShell/tree/dev/Src/CShell.Completion
The completion result is returned here: https://github.com/lukebuehler/CShell/blob/dev/Src/CShell.Completion/CSharpCompletion.cs#L95 and then used here: https://github.com/lukebuehler/CShell/blob/dev/Src/CShell.Completion/CodeTextEditor.cs#L112
Essentially, the returned completions are already created for AvalonEdit and not for nrefactory.
Thanks for your reply, it is most appreciated. I will look at what you have done in CShell. Just to clarify, have you used the NuGet Versions of AvalonEdit and NRefactory in CShell?
In CShell I'm using the Nuget version of AvalonEdit and the Nrefactory from here (https://github.com/lukebuehler/NRefactory) because there was a small rare bug that they havent fixed yet. I think you should be fine with using Nuget Nrefactory though.
On Tue, Nov 11, 2014 at 12:38 PM, Nicholas Camus notifications@github.com wrote:
Thanks for your reply, it is most appreciated. I will look at what you have done in CShell. Just to clarify, have you used the NuGet Versions of AvalonEdit and NRefactory in CShell?
— Reply to this email directly or view it on GitHub https://github.com/lukebuehler/NRefactory-Completion-Sample/issues/4#issuecomment-62585150 .
I have implemented both the latest NuGet packges for NRefactory and AvalonEdit following your work with CShell. I am well impressed! Some fantastic code in there. How long did it take you to cobble together?
I would like to add the ability to add in namespaces via using System.*
at run-time and have the namespace included dynamically. Is this something you have thought about or looked at?
Thanks again.
Thanks!
Yes, I'm actually working on this right now, but in my case there's a whole another layer of complexity as we are trying to support ScriptCS as well...
I dont have a clear idea yet though.
On Tue, Nov 11, 2014 at 5:42 PM, Nicholas Camus notifications@github.com wrote:
I have implemented both the latest NuGet packges for NRefactory and AvalonEdit following your work with CShell. I am well impressed! Some fantastic code in there. How long did it take you to cobble together?
I would like to add the ability to add in namespaces via using System.* at run-time and have the namespace included dynamically. Is this something you have thought about or looked at?
Thanks again.
— Reply to this email directly or view it on GitHub https://github.com/lukebuehler/NRefactory-Completion-Sample/issues/4#issuecomment-62635592 .
I will take a look at the basic case as i go forward with what I am attempting to do. If i have anything I think will be of use I will let you know.
All the best.
Hi Luke,
In
OverrideCompletionData.cs
you usevar syntaxTree = new CSharpParser().Parse(document);
(as one of a handful of examples) wheredocument
here is of typeICSharpCode.AvalonEdit.Document.TextDocument
. TheParse(...)
method expects a type ofICSharpCode.NRefactory.Editor.ITextSource
and it is gettingICSharpCode.AvalonEdit.Document.ITextSource
. So I am getting a compiler fail, but in your solution you do not. My question is what am I missing here?Thanks for your time.