C# override autocomplete does not work

Asked

Viewed 110 times

2

I can’t write a superscript with suggestions from override.

The completion of the override does not give suggestions of virtual classes or methods as Tostring().

How do I make these suggestions appear?

This is the method of my superclass I want to overwrite in my subclass:

public virtual void Withdraw(double amount)
    {
        Balance -= amount + 5.0;
    }

In my subclass, there are no suggestions like ToString() or the method Withdraw() superclass:

Não aparecem sugestões como ToString() ou o método da superclasse

  • This is a question about the editor. Which one are you using?

  • Microsoft Visual Studio

  • Override method of which class? How exactly is your code?

  • I have a virtual method in a superclass and I want to overwrite it in a subclass. In my subclass, when typing override, this virtual method does not appear as a suggestion to autocomplete, and I have to type manually.

2 answers

2


After the keyword override should not come the name of the method, has some other possibilities of what you can write there and are listed in autocomplete in your image, when you use something else in the code it may be (it depends on what you use next) that the next word to be used is the name of a method that allows overwriting, if this occurs the method names will appear. Therefore it is working properly. And even if it was not yet could write the code normally.

0

Probably a visual studio plug-in is missing to identify the language and autocomplete. If you’ve already installed a plug in, you may need to write a specific plug in command to make it work.

EX: if you write Prop when programming in C#, if you have the microsoft plug in installed, it autocomplete to create a variable, allowing you to change the values just by pressing TAB

Browser other questions tagged

You are not signed in. Login or sign up in order to post.