Browse Source

Avoid unnecessary access to entity.Documentation. Improves code completion performance.

pull/505/merge
Daniel Grunwald 11 years ago
parent
commit
6c2f0f4320
  1. 3
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EntityCompletionData.cs
  2. 5
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/TypeCompletionData.cs

3
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EntityCompletionData.cs

@ -37,8 +37,9 @@ namespace CSharpBinding.Completion @@ -37,8 +37,9 @@ namespace CSharpBinding.Completion
public EntityCompletionData(IEntity entity) : base(entity.Name)
{
this.entity = entity;
this.Description = entity.Documentation;
this.Image = ClassBrowserIconService.GetIcon(entity);
// don't set this.Description -- we use CreateFancyDescription() instead,
// and accessing entity.Documentation in the constructor is too slow
}
protected override object CreateFancyDescription()

5
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/TypeCompletionData.cs

@ -35,10 +35,9 @@ namespace CSharpBinding.Completion @@ -35,10 +35,9 @@ namespace CSharpBinding.Completion
public TypeCompletionData(IType type) : base(type.Name)
{
this.type = type;
ITypeDefinition typeDef = type.GetDefinition();
if (typeDef != null)
this.Description = typeDef.Documentation;
this.Image = ClassBrowserIconService.GetIcon(type);
// don't set this.Description -- we use CreateFancyDescription() instead,
// and accessing entity.Documentation in the constructor is too slow
}
protected override object CreateFancyDescription()

Loading…
Cancel
Save