Reputation: 4371
Is it possible to just enter first letters of a static member of a class and then (by a magic shortcut) the completion list lists all possible class.member entries?
More detailed explanation:
I have 15 classes in form of:
class AClass
{
public static readonly string Volumeclass = "abcd";
//... other members
}
class AnotherClass
{
public static readonly string Volumeclass = "xyz";
//... other members
}
When I want to access these members I want type Volumeclass and want to get the list:
by intelligence. So I need to select only the right symbol instead of remember the right class name.
I tried Smart Completion, but it did not work in that manner.
Upvotes: 3
Views: 386
Reputation: 31548
I can't say that I know of such shortcut. Obviously if you use the Go To Symbol navigation (IntelliJ:
Ctrl-Shift-Alt-T or Visual Studio:
Ctrl-Shift-Alt-T) , you can have a list of all VolumeClass
properties in your code:
But this is not what you want. The closest I could suggest is using the Import Symbol
completion (Ctrl-Alt-Space) and then type the first letters of the type. It will show all globally available types, and will import the appropriate using
directive when needed.
Edit Another idea is to generate this with ReSharper Live Template that would allow you to generate the statement based on the first few letters:
vc
. Optionally, write a description.$prefix$.Volumeclass
You can now type in your code vc
, and then the name of the class that has the property.
Hope that helps.
Upvotes: 3
Reputation: 6711
You can put the classes into a common namespace. Then after you type the dot following the namespace name, the list of classes should pop up. After you select a class, you will still need to add the Volumeclass
property, though.
I wouldn't restructure your namespace hierarchy just for this purpose, but it may be a good option if the classes should logically be grouped together. If the namespace name is long, you can optionally add a using alias directive (e.g., using Prods = MyCompany.MyProject.Products;
)
Upvotes: 1
Reputation: 112334
You have to type the class name first
AClass.<now the list of static members appears>
Note that there are tens of thousands classes in the .NET Framework class library. Do you want millions of members appear automatically?
Upvotes: 0