private CompletionCandidateResult GetCandidates(Type type) { if (!type.IsEnum) { return(CompletionCandidateResult.Default); } return(CompletionCandidateResult.Keywords(Enum.GetNames(type).Select(x => new CompletionCandidateValue(x, string.Empty)))); }
public CompletionCandidateResult GetCandidates(CoconaCompletionCandidatesMetadata metadata) { var attr = metadata.ParameterAttributes.OfType <CompletionCandidatesAttribute>().FirstOrDefault(); if (attr != null) { return(CompletionCandidateResult.Keywords(((ICoconaCompletionCandidatesStaticKeywords)attr).Candidates)); } return(CompletionCandidateResult.Default); }