You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the project ICSharpCode.AvalonEdit.Sample, the code about code completion is shown below.
voidtextEditor_TextArea_TextEntered(objectsender,TextCompositionEventArgse){if(e.Text =="."){// open code completion after the user has pressed dot:completionWindow=new CompletionWindow(textEditor.TextArea);// provide AvalonEdit with the data:IList<ICompletionData>data= completionWindow.CompletionList.CompletionData;
data.Add(new MyCompletionData("Item1"));
data.Add(new MyCompletionData("Item2"));
data.Add(new MyCompletionData("Item3"));
data.Add(new MyCompletionData("Another item"));
completionWindow.Show();
completionWindow.Closed +=delegate{completionWindow=null;};}}
Every time before the completion window is used, it needs to be created. It wastes much computing force, especially when the CompletionData is large
So, I think there are two approaches below to improve.
Create the completion window only one time. When it's needed, activated it.
CompletionWindow.CompletionList.CompletionData should be writable for users. In this way, we can create the data only once. Every time the completion window is needed, we can pass the data to CompletionData.
The text was updated successfully, but these errors were encountered:
In the project
ICSharpCode.AvalonEdit.Sample
, the code about code completion is shown below.Every time before the completion window is used, it needs to be created. It wastes much computing force, especially when the CompletionData is large
So, I think there are two approaches below to improve.
CompletionWindow.CompletionList.CompletionData
should be writable for users. In this way, we can create the data only once. Every time the completion window is needed, we can pass the data toCompletionData
.The text was updated successfully, but these errors were encountered: