MCPcopy
hub / github.com/microsoft/vscode-languageserver-node / set

Method set

jsonrpc/src/linkedMap.ts:62–88  ·  view source on GitHub ↗
(key: K, value: V, touch: Touch = Touch.None)

Source from the content-addressed store, hash-verified

60 }
61
62 public set(key: K, value: V, touch: Touch = Touch.None): void {
63 let item = this._map.get(key);
64 if (item) {
65 item.value = value;
66 if (touch !== Touch.None) {
67 this.touch(item, touch);
68 }
69 } else {
70 item = { key, value, next: undefined, previous: undefined };
71 switch(touch) {
72 case Touch.None:
73 this.addItemLast(item);
74 break;
75 case Touch.First:
76 this.addItemFirst(item);
77 break;
78 case Touch.Last:
79 this.addItemLast(item);
80 break;
81 default:
82 this.addItemLast(item);
83 break;
84 }
85 this._map.set(key, item);
86 this._size++;
87 }
88 }
89
90 public delete(key: K): boolean {
91 const item = this._map.get(key);

Callers 15

asWorkspaceEditFunction · 0.80
registerFunction · 0.80
registerMethod · 0.80
notificationSentMethod · 0.80
registerMethod · 0.80
registerMethod · 0.80
registerMethod · 0.80
registerRawMethod · 0.80
registerMethod · 0.80
registerMethod · 0.80
handleDiagnosticsFunction · 0.80
registerFeatureFunction · 0.80

Calls 4

touchMethod · 0.95
addItemLastMethod · 0.95
addItemFirstMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected