I am using PTVS assemblies to generate strongly typed bindings for a Python library. I've got an instance of ModuleAnalysis
, which I use to perform various queries about guessed types in Python code.
At this moment I stumbled upon a need in my C# output to explicitly mark all overriden methods with override
keyword. However, I can't seem to figure how to determine if the one of the parent classes already has a member with a same name, that is being overriden.
Here is a sample of what I am trying to convert:
class Base:
def virt(self):
print("Base.virt")
class A(Base):
def virt(self):
super().virt()
def non_virt(self):
pass
When processing A's virt, I tried to do this:
analysis.GetValuesByIndex("super()." + node.Name, node.Body.EndIndex)
Here, ModuleAnalysis analysis
and FunctionDefinition node
. I also tried Body.StartIndex
and "super(A, self)." + node.Name
.
Unexpectedly, this gives no results.