コード例 #1
0
		public TypeScriptCompletionItem(CompletionEntry entry, CompletionEntryDetailsProvider completionDetailsProvider)
			: base(entry.name)
		{
			this.entry = entry;
			this.completionDetailsProvider = completionDetailsProvider;
			Image = GetImage(entry);
		}
コード例 #2
0
		public ICompletionItemList GenerateCompletionList(ITextEditor editor)
		{
			CompletionInfo result = context.GetCompletionItems(
				editor.FileName,
				editor.Caret.Offset,
				editor.Document.Text,
				memberCompletion);
			
			var itemList = new DefaultCompletionItemList();
			if (result != null) {
				
				var completionDetailsProvider = new CompletionEntryDetailsProvider(
					context,
					editor.FileName,
					editor.Caret.Offset);
				
				itemList.Items.AddRange(result.entries.Select(entry => new TypeScriptCompletionItem(entry, completionDetailsProvider)));
				itemList.SortItems();
			}
			return itemList;
		}