1
How do I sync Interface with Concrete Implementations?
Question asked by Brett - 10/12/2021 at 5:53 AM
Unanswered
Hi,

I've seen that you can use GhostDoc to keep an implementation in sync with the interface, but I'm not finding that, when I generate documentation on the method, it generates fresh documentation, not based on the interface. Is there an option I need to enable?

5 Replies

Reply to Thread
0
Misha Zhutov Replied
Employee Post
Hi Brett, 

GhostDoc keeps inherited documentation by default. Could you please provide us with a code snippet or a sample project which reproduces the issue?
0
Brett Replied
Hey Misha,

I've realised it's a bug with asyncs.

Take this example:
interface ITest{

        /// <summary>
        /// Test Message.
        /// </summary>
        /// <returns>A Task representing the asynchronous operation.</returns>
        Task Test();

}
This code won't get the documentation inherited:

class Test : ITest{

public async Task Test(){
 return Task.CompletedTask();
}

}

But this code will:
class Test : ITest{

public Task Test(){
 return Task.CompletedTask();
}

}
Note the only change is the addition and deletion of the async keyword, which obviously isn't valid in the interface itself, but is on the concrete implementation.

Hope that helps,
Brett
0
Misha Zhutov Replied
Employee Post
Hi Brett, 

What GhostDoc version are you using? We cannot reproduce the issue using the GhostDoc Community v2021.2.21150.
0
Brett Replied
I'm using the trial of GhostDoc Pro at the moment (considering purchasing), version 2021.2.21150

I've just tried again and it's still doing it for me, if I remove the async keyword then press Ctrl + Shift + D, in the popup I get the "Test Message", if I put async back in and do it again, I get a generated message, not the message from the interface.
0
Misha Zhutov Replied
Employee Post
I attached the sample project we tried that. Please download and try to reproduce the issue on it.

Reply to Thread