MCPcopy
hub / github.com/microsoft/pyright / set

Method set

server/src/common/stringMap.ts:20–26  ·  view source on GitHub ↗
(key: string, value: T)

Source from the content-addressed store, hash-verified

18 // Adds a new entry, replacing an existing entry.
19 // Returns false if it was already present.
20 set(key: string, value: T): boolean {
21 const encodedKey = this.encodeKey(key);
22 const wasPresent = this._map[encodedKey] !== undefined;
23
24 this._map[encodedKey] = value;
25 return !wasPresent;
26 }
27
28 // Adds a new entry if the key isn't already defined.
29 // Returns false if it was already present.

Callers 15

_createTypeVarTypeMethod · 0.95
_parseVarArgsListMethod · 0.95
_createNamedTupleTypeMethod · 0.80
visitImportAsMethod · 0.80
canAssignTypeMethod · 0.80
cloneTypeVarMapMethod · 0.80
addUnboundSymbolMethod · 0.80

Calls 1

encodeKeyMethod · 0.95

Tested by

no test coverage detected