Replace xml doc -> XMLDocUtil.SubstituteHeader

Hi i want to replace xml doc above method with inherit xml doc, but it
sucks in line XMLDocUtil.SubstituteHeader, what i do wrong?



IDeclaredElement element = methodDeclaration as IDeclaredElement;
XMLDocUtil.SubstituteHeader(methodDeclaration.GetXMLDoc(true), element);

--
terrorix@centrum.sk

0
7 comments

Hello terrorix,

I'm not sure what you mean under 'it sucks in line...', but I'd start with
re-writing the first line
of your code into

IDeclaredElement element = methodDeclaration.DeclaredElement;

It's not correct to assume that IDeclarations are IDeclaredElements; while
it is currently true for
type members like methods, it would be wrong to rely upon this fact, and
the correct way to get
IDeclaredElement from IDeclaration is above.

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


Hi i want to replace xml doc above method with inherit xml doc, but it
sucks in line XMLDocUtil.SubstituteHeader, what i do wrong?

IDeclaredElement element = methodDeclaration as IDeclaredElement;
XMLDocUtil.SubstituteHeader(methodDeclaration.GetXMLDoc(true),
element);



0

Dmitry Shaporenkov wrote:

Hello terrorix,

I'm not sure what you mean under 'it sucks in line...', but I'd start
with re-writing the first line of your code into IDeclaredElement
element = methodDeclaration.DeclaredElement;

It's not correct to assume that IDeclarations are IDeclaredElements;
while it is currently true for type members like methods, it would be
wrong to rely upon this fact, and the correct way to get
IDeclaredElement from IDeclaration is above.

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


Hi i want to replace xml doc above method with inherit xml doc, but
it sucks in line XMLDocUtil.SubstituteHeader, what i do wrong?

IDeclaredElement element = methodDeclaration as IDeclaredElement;
XMLDocUtil.SubstituteHeader(methodDeclaration.GetXMLDoc(true),
element);


what i want is this situation:

i have method in class A:

/// /// Do something... /// ]]>
protected abstract void DoSomething();

and have overridden method in class B(which has no xml doc):

protected override void DoSometing()
{
...
}

and i want when i'm in method(in class B) to my plugin to adds xml doc
to this method from base method in class B.

How to work with xml doc(add, remove, edit) within resharper plugins?

--
terrorix@centrum.sk

0

You might check out GhostDoc if you haven't already. It provides some
intelligent XML documentation for methods and properties based on the
method/property names and parameters. For properties and methods that
override a base class or interface, GhostDoc pulls in the documentation from
the base class or interface (including .NET Framework methods/properties).


"terrorix" <terrorix@centrum.sk> wrote in message
news:eql6bq$ta3$1@is.intellij.net...

Dmitry Shaporenkov wrote:

>
>> Hello terrorix,
>>
>> I'm not sure what you mean under 'it sucks in line...', but I'd start
>> with re-writing the first line of your code into IDeclaredElement
>> element = methodDeclaration.DeclaredElement;
>>
>> It's not correct to assume that IDeclarations are IDeclaredElements;
>> while it is currently true for type members like methods, it would be
>> wrong to rely upon this fact, and the correct way to get
>> IDeclaredElement from IDeclaration is above.
>>
>> Dmitry Shaporenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>>
>>
>>
>> > Hi i want to replace xml doc above method with inherit xml doc, but
>> > it sucks in line XMLDocUtil.SubstituteHeader, what i do wrong?
>> >
>> > IDeclaredElement element = methodDeclaration as IDeclaredElement;
>> > XMLDocUtil.SubstituteHeader(methodDeclaration.GetXMLDoc(true),
>> > element);
>> >
>

what i want is this situation:

>

i have method in class A:

>

/// <summary>
/// Do something...
/// </summary>
protected abstract void DoSomething();

>

and have overridden method in class B(which has no xml doc):

>

protected override void DoSometing()
{
...
}

>

and i want when i'm in method(in class B) to my plugin to adds xml doc
to this method from base method in class B.

>

How to work with xml doc(add, remove, edit) within resharper plugins?

>

--
terrorix@centrum.sk



0

Lothan wrote:

You might check out GhostDoc if you haven't already. It provides some
intelligent XML documentation for methods and properties based on the
method/property names and parameters. For properties and methods that
override a base class or interface, GhostDoc pulls in the
documentation from the base class or interface (including .NET
Framework methods/properties).


"terrorix" <terrorix@centrum.sk> wrote in message
news:eql6bq$ta3$1@is.intellij.net...

Dmitry Shaporenkov wrote:

Hello terrorix,

I'm not sure what you mean under 'it sucks in line...', but I'd
start with re-writing the first line of your code into
IDeclaredElement element = methodDeclaration.DeclaredElement;

It's not correct to assume that IDeclarations are
IDeclaredElements; while it is currently true for type members
like methods, it would be wrong to rely upon this fact, and the
correct way to get IDeclaredElement from IDeclaration is above.

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


>>> Hi i want to replace xml doc above method with inherit xml doc,
but >>> it sucks in line XMLDocUtil.SubstituteHeader, what i do wrong?

>>> IDeclaredElement element = methodDeclaration as IDeclaredElement;
>>> XMLDocUtil.SubstituteHeader(methodDeclaration.GetXMLDoc(true),
>>> element);


what i want is this situation:

i have method in class A:

/// <summary>
/// Do something...
/// </summary>
protected abstract void DoSomething();

and have overridden method in class B(which has no xml doc):

protected override void DoSometing()
{
...
}

and i want when i'm in method(in class B) to my plugin to adds xml
doc to this method from base method in class B.

How to work with xml doc(add, remove, edit) within resharper
plugins?

-- terrorix@centrum.sk


I know GhostDoc, but i want to make this ones by using resharper api.

--
terrorix@centrum.sk

0

Peter Sulek wrote:

Lothan wrote:

You might check out GhostDoc if you haven't already. It provides
some intelligent XML documentation for methods and properties based
on the method/property names and parameters. For properties and
methods that override a base class or interface, GhostDoc pulls in
the documentation from the base class or interface (including .NET
Framework methods/properties).


"terrorix" <terrorix@centrum.sk> wrote in message
news:eql6bq$ta3$1@is.intellij.net...

Dmitry Shaporenkov wrote:

Hello terrorix,

I'm not sure what you mean under 'it sucks in line...', but I'd
start with re-writing the first line of your code into
IDeclaredElement element = methodDeclaration.DeclaredElement;

It's not correct to assume that IDeclarations are
IDeclaredElements; while it is currently true for type members
like methods, it would be wrong to rely upon this fact, and the
correct way to get IDeclaredElement from IDeclaration is above.

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


>>> Hi i want to replace xml doc above method with inherit xml doc,
but >>> it sucks in line XMLDocUtil.SubstituteHeader, what i do
wrong?

>>> IDeclaredElement element = methodDeclaration as
IDeclaredElement; >>>
XMLDocUtil.SubstituteHeader(methodDeclaration.GetXMLDoc(true), >>>
element);


what i want is this situation:

i have method in class A:

/// <summary>
/// Do something...
/// </summary>
protected abstract void DoSomething();

and have overridden method in class B(which has no xml doc):

protected override void DoSometing()
{
...
}

and i want when i'm in method(in class B) to my plugin to adds xml
doc to this method from base method in class B.

How to work with xml doc(add, remove, edit) within resharper
plugins?

-- terrorix@centrum.sk


I know GhostDoc, but i want to make this ones by using resharper api.


No one knows resharper-api functions to manipulate with xml-docs?

--
terrorix@centrum.sk

0

Hello Peter,

Peter Sulek wrote:

>> Lothan wrote:
>>
>>

No one knows resharper-api functions to manipulate with xml-docs?


Consider the following two interfaces:

Getting documentation for declared elements:
IDeclaredElement:
string XMLDocId { get; }
XmlNode GetXMLDoc (bool inherit);
XmlNode GetXMLDescriptionSummary (bool inherit);

Getting and setting Doc comments for source code tree nodes:
IDocCommentBlockOwnerNode:
IDocCommentBlockNode GetDocCommentBlockNode();
void SetDocCommentBlockNode(IDocCommentBlockNode node);

Best regards,
Andrey Simanovsky


0

Andrey Simanovsky (JetBrains) wrote:

Hello Peter,

Peter Sulek wrote:

Lothan wrote:

No one knows resharper-api functions to manipulate with xml-docs?


Consider the following two interfaces:

Getting documentation for declared elements:
IDeclaredElement:
string XMLDocId { get; }
XmlNode GetXMLDoc (bool inherit);
XmlNode GetXMLDescriptionSummary (bool inherit);

Getting and setting Doc comments for source code tree nodes:
IDocCommentBlockOwnerNode:
IDocCommentBlockNode GetDocCommentBlockNode();
void SetDocCommentBlockNode(IDocCommentBlockNode node);

Best regards,
Andrey Simanovsky


thanx a lot i'll try it.

--
terrorix@centrum.sk

0

Please sign in to leave a comment.