MCPcopy
hub / github.com/VSCodeVim/Vim / toString

Function toString

src/vimscript/expression/evaluate.ts:84–101  ·  view source on GitHub ↗
(value: Value)

Source from the content-addressed store, hash-verified

82}
83
84export function toString(value: Value): string {
85 switch (value.type) {
86 case 'number':
87 return value.value.toString();
88 case 'float':
89 throw VimError.UsingFloatAsAString();
90 case 'string':
91 return value.value;
92 case 'list':
93 throw VimError.UsingListAsAString();
94 case 'dictionary':
95 throw VimError.UsingDictionaryAsAString();
96 case 'funcref':
97 throw VimError.UsingFuncrefAsAString();
98 case 'blob':
99 return displayValue(value);
100 }
101}
102
103function toList(value: Value): ListValue {
104 switch (value.type) {

Callers 8

doPutMethod · 0.90
executeMethod · 0.90
evaluateMethod · 0.70
evaluateIndexMethod · 0.70
evaluateSliceMethod · 0.70
evaluateBinaryMethod · 0.70
evaluateFunctionCallMethod · 0.70

Calls 6

displayValueFunction · 0.90
UsingFloatAsAStringMethod · 0.80
UsingListAsAStringMethod · 0.80
UsingFuncrefAsAStringMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected