int IVsLanguageDebugInfo.GetProximityExpressions(IVsTextBuffer pBuffer, int iLine, int iCol, int cLines, out IVsEnumBSTR ppEnum) { ppEnum = null; var file = getFile(pBuffer); var list = new List <String>(); XElement member; // We use our orignal syntax here (so SELF and ":"). The expression compiler // in the debugger takes care of translating SELF to this and ':' to '.' if (file != null) { member = file.FindMemberAtRow(iLine); switch (member.Kind) { case Kind.Method: case Kind.Access: case Kind.Assign: case Kind.Property: case Kind.Event: case Kind.Field: case Kind.Constructor: case Kind.Destructor: case Kind.Operator: if (!member.Modifiers.HasFlag(Modifiers.Static)) { list.Add(XSettings.FormatKeyword("SELF")); } break; } var buffer = _editorAdaptersFactoryService.GetDataBuffer(pBuffer); Dictionary <string, XVariable> locals = null; if (member != null) { if (member is XMemberDefinition) { locals = new Dictionary <string, XVariable>(StringComparer.OrdinalIgnoreCase); var tm = member as XMemberDefinition; var vars = tm.GetLocals(buffer.CurrentSnapshot, iLine, file.Project.ParseOptions.Dialect); foreach (var v in vars) { locals.Add(v.Name, (XVariable)v); } foreach (var p in tm.Parameters) { locals.Add(p.Name, (XVariable)p); } } addtokens(buffer, iLine, list, file, locals); } } ppEnum = new VsEnumBSTR(list); return(VSConstants.S_OK); }
int IVsLanguageDebugInfo.GetProximityExpressions(IVsTextBuffer pBuffer, int iLine, int iCol, int cLines, out IVsEnumBSTR ppEnum) { ppEnum = null; var file = getFile(pBuffer); var list = new List <String>(); XSourceEntity member; // We use our original syntax here (so SELF and ":"). The expression compiler // in the debugger takes care of translating SELF to this and ':' to '.' if (file != null) { member = file.FindMemberAtRow(iLine); if (member.Kind.IsClassMember(file.Project.ParseOptions.Dialect)) { if (!member.Modifiers.HasFlag(Modifiers.Static)) { list.Add(XSettings.FormatKeyword("SELF")); } } var buffer = _editorAdaptersFactoryService.GetDataBuffer(pBuffer); Dictionary <string, IXVariableSymbol> locals = null; if (member != null) { if (member is XSourceMemberSymbol tm) { locals = new Dictionary <string, IXVariableSymbol>(StringComparer.OrdinalIgnoreCase); var location = new XSharpSearchLocation(tm.File, tm, buffer.CurrentSnapshot, iLine); var vars = tm.GetLocals(location); foreach (var v in vars) { if (!locals.ContainsKey(v.Name)) { locals.Add(v.Name, v); } } foreach (var p in tm.Parameters) { if (!locals.ContainsKey(p.Name)) { locals.Add(p.Name, p); } } } addtokens(buffer, iLine, list, file, locals); } } ppEnum = new VsEnumBSTR(list); return(VSConstants.S_OK); }
public int Clone(out IVsEnumBSTR ppEnum) { ppEnum = new VsEnumBSTR(_values); return(VSConstants.S_OK); }