1

How can I force IntelliSense to show a star next to a method or property in my custom class?

Is it a markup thing?

I know it's gleaned from usage patterns of each individual engineer, but how can I do this manually?

public class RabbitHole
{
    public double Width;
    public double Depth;

    public void Descend(double toDepth)
    {
        // ...
    }

    public void Ascend(double toHeight)
    {
        // ...
    }
}

I would like Depth and Descend to be marked with a star in the IntelliSense code-completion popup when a user types:

currentRabbithole.
//               ^ when the dot is typed

For an example of what I'm talking about, instances of the string class show Length, Replace, Split, Trim, and Contains with stars next to them (and moved to the top of the list) when typing the dot after the instance name:

string text = "hello";

text.
//  ^ when the dot is typed
Greg
  • 143
  • 1
  • 7
  • See: [Why is IntelliSense showing a star to the left of functions within if statements](https://stackoverflow.com/q/59398968/880990). – Olivier Jacot-Descombes Apr 28 '23 at 12:57
  • See [this](https://stackoverflow.com/q/59398968/5133585). I doubt the star is something you can control. Whether or not to show a star is apparently controlled by some mysterious AI thingys. – Sweeper Apr 28 '23 at 12:58
  • Ya, I read those. Was wondering if it's possible to influence the intellisense system to just go ahead and put stars next to methods/properties i want highlighted for other developers at my company who use the libraries I'm working on. I think it would be a helpful out-of-the-box experience for them. – Greg Apr 28 '23 at 13:02
  • You can only do this by creating your own Visual Studio Extension. See: e.g. [How to extend the information that provides Intellisense using the Visual Studio SDK?](https://stackoverflow.com/q/33461580/880990) or [Custom Intellisense Extension](https://stackoverflow.com/q/10460138/880990). But creating such an extension is quite hard. Information on this topic is sparse and you usually have to do a lot of research and try different approaches until it works. – Olivier Jacot-Descombes Apr 28 '23 at 13:09

0 Answers0