update/plugins/org.eclipse.wildwebdeveloper_0.5.8.202005190736/node_modules/@angular/language-server/index.js
/**
	 * Convert ts.CompletionEntry to LSP Completion Item.
	 * @param entry completion entry
	 * @param position position where completion is requested.
	 * @param scriptInfo
	 */
Convert ts.CompletionEntry to LSP Completion Item.
@param entry completion entry
@param position position where completion is requested.
@param scriptInfo
Convert ts . CompletionEntry to LSP Completion Item . @param entry completion entry @param position position where completion is requested . @param scriptInfo
function tsCompletionEntryToLspCompletionItem(entry, position, scriptInfo) {
	    const item = vscodeLanguageserver.CompletionItem.create(entry.name);
	    const kind = entry.kind;
	    item.kind = ngCompletionKindToLspCompletionItemKind(kind);
	    item.detail = entry.kind;
	    item.sortText = entry.sortText;
	    const insertText = entry.insertText || entry.name;
	    item.textEdit = entry.replacementSpan ?
	        vscodeLanguageserver.TextEdit.replace(utils.tsTextSpanToLspRange(scriptInfo, entry.replacementSpan), insertText) :
	        vscodeLanguageserver.TextEdit.insert(position, insertText);
	    return item;
	}
function tsCompletionEntryToLspCompletionItem ( entry , position , scriptInfo ) { const item = vscodeLanguageserver . CompletionItem . create ( entry . name ) ; const kind = entry . kind ; item . kind = ngCompletionKindToLspCompletionItemKind ( kind ) ; item . detail = entry . kind ; item . sortText = entry . sortText ; const insertText = entry . insertText || entry . name ; item . textEdit = entry . replacementSpan ? vscodeLanguageserver . TextEdit . replace ( utils . tsTextSpanToLspRange ( scriptInfo , entry . replacementSpan ) , insertText ) : vscodeLanguageserver . TextEdit . insert ( position , insertText ) ; return item ; }
Convert ts.CompletionEntry to LSP Completion Item.
Convert ts . CompletionEntry to LSP Completion Item .
// Even though `entry.kind` is typed as ts.ScriptElementKind, it's // really Angular's CompletionKind. This is because ts.ScriptElementKind does // not sufficiently capture the HTML entities. // This is a limitation of being a tsserver plugin. // Text that actually gets inserted to the document. It could be different // from 'entry.name'. For example, a method name could be 'greet', but the // insertText is 'greet()'.