MCPcopy Index your code
hub / github.com/microsoft/vscode-languageserver-node / addItemFirst

Method addItemFirst

jsonrpc/src/linkedMap.ts:199–210  ·  view source on GitHub ↗
(item: Item<K, V>)

Source from the content-addressed store, hash-verified

197 */
198
199 private addItemFirst(item: Item<K, V>): void {
200 // First time Insert
201 if (!this._head && !this._tail) {
202 this._tail = item;
203 } else if (!this._head) {
204 throw new Error('Invalid list');
205 } else {
206 item.next = this._head;
207 this._head.previous = item;
208 }
209 this._head = item;
210 }
211
212 private addItemLast(item: Item<K, V>): void {
213 // First time Insert

Callers 1

setMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected