1 comment
Comment actions Permalink

Hi there! To add a particular word as an abbreviation programmatically, you need to use a chunk of code similar to the following:

var managerInstance = solution.GetPsiServices().Naming;
var provider = managerInstance.Policy.GetPolicyProvider(myLanguage, null);
provider.AddAbbreviation(myCandidate, solution);
Shell.Instance.SaveSettings();
Daemon.Daemon.GetInstance(solution).Invalidate();

In the above,

myLanguage
refers to the language you’re adding (e.g.,
CSharpLanguage.Instance
), and
solution
refers to the currently loaded
ISolution
.
Hope this helps,
Dmitri
0

Please sign in to leave a comment.