public static bool GotoDeclaration() { ScintillaNet.ScintillaControl sci = PluginBase.MainForm.CurrentDocument.SciControl; if (sci == null) { return(false); } if (sci.ConfigurationLanguage != "xml") { return(false); } int pos = sci.CurrentPos; int len = sci.TextLength; while (pos < len) { char c = (char)sci.CharAt(pos); if (c <= 32 || c == '/' || c == '>') { break; } pos++; } XMLContextTag ctag = XMLComplete.GetXMLContextTag(sci, pos); if (ctag.Name == null) { return(true); } string word = sci.GetWordFromPosition(sci.CurrentPos); string type = ResolveType(mxmlContext, ctag.Name); ClassModel model = context.ResolveType(type, mxmlContext.model); if (model.IsVoid()) // try resolving tag as member of parent tag { parentTag = XMLComplete.GetParentTag(sci, ctag); if (parentTag.Name != null) { ctag = parentTag; type = ResolveType(mxmlContext, ctag.Name); model = context.ResolveType(type, mxmlContext.model); if (model.IsVoid()) { return(true); } } else { return(true); } } if (!ctag.Name.EndsWith(word)) { ASResult found = ResolveAttribute(model, word); ASComplete.OpenDocumentToDeclaration(sci, found); } else { ASResult found = new ASResult(); found.InFile = model.InFile; found.Type = model; ASComplete.OpenDocumentToDeclaration(sci, found); } return(true); }