Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 6c2f0f4

Browse files
committed
Avoid unnecessary access to entity.Documentation. Improves code completion performance.
1 parent 1fbd200 commit 6c2f0f4

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public IEntity Entity {
3737
public EntityCompletionData(IEntity entity) : base(entity.Name)
3838
{
3939
this.entity = entity;
40-
this.Description = entity.Documentation;
4140
this.Image = ClassBrowserIconService.GetIcon(entity);
41+
// don't set this.Description -- we use CreateFancyDescription() instead,
42+
// and accessing entity.Documentation in the constructor is too slow
4243
}
4344

4445
protected override object CreateFancyDescription()

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ public IType Type {
3535
public TypeCompletionData(IType type) : base(type.Name)
3636
{
3737
this.type = type;
38-
ITypeDefinition typeDef = type.GetDefinition();
39-
if (typeDef != null)
40-
this.Description = typeDef.Documentation;
4138
this.Image = ClassBrowserIconService.GetIcon(type);
39+
// don't set this.Description -- we use CreateFancyDescription() instead,
40+
// and accessing entity.Documentation in the constructor is too slow
4241
}
4342

4443
protected override object CreateFancyDescription()

0 commit comments

Comments
 (0)