
List tools helps you convert effortlessly between common list formats, such as JSON
, CSV
, YAML
or XML
and programming languages such as SQL
, JavaScript
, TypeScript
, PHP
or C
(see Supported Formats).

Simply select any data source and run the command List Tools: Convert multiple columns to object list
to convert between formats.
Features
- Extract list data from data sources, such as
JSON
, CSV
, YAML
or XML
- Extract simple or object list data from programming languages, such as
JavaScript
, TypeScript
, PHP
or C
- Convert simple or object lists between data sources and programming languages
- Extract single or multiple columns from object lists
Input Formats |
|
Output Formats |
 |
⇄ |
 |
 |
⇄ |
 |
 |
⇄ |
 |
 |
⇄ |
 |
|
⇄ |
 |
|
⇄ |
 |
|
⇄ |
 |
 |
⇄ |
 |
 |
⇄ |
|
 |
⇄ |
 |
 |
⇄ |
 |
 |
⇄ |
 |
 |
⇄ |
 |
Commands
List Tools: Convert single column to simple list
- Extract a single column from your current selection
- Convert them into a simple list in the target language
List Tools: Convert multiple columns to object list
- Extract multiple columns from your current selection
- Convert them into an object list in the target language
List Tools: Convert single column to simple list (pretty print)
- Same as
List Tools: Convert single column to simple list
with pretty printing enabled
List Tools: Convert multiple columns to object list (pretty print)
- Same as
List Tools: Convert multiple columns to object list
with pretty printing enabled
List Tools: Convert single column to simple list (without pretty print)
- Same as
List Tools: Convert single column to simple list
with pretty printing disabled
List Tools: Convert multiple columns to object list (without pretty print)
- Same as
List Tools: Convert multiple columns to object list
with pretty printing disabled
List Tools: Extract columns from object list
- Extract a single column from your current selection
- Keep the current language and remove deselected columns from list
List Tools: Repeat last action
- Repeat the last action (Must be the same language as the previous action)
Settings
The pretty printing level can be set on a per-language basis by using vscode's language-specific selector:
"[json]": {
"list-tools.prettyPrint": 1
}
The level matches the indentation level for most languages, specifying -1
equates to an infinite depth:
// "list-tools.prettyPrint": -1
// equivalent to "list-tools.prettyPrint": 2
[
{
"city": "Tokyo",
"country": "Japan",
"population": 37732000,
}
]
// "list-tools.prettyPrint": 1
[
{ "city": "Tokyo", "country": "Japan", "population": 37732000 }
]
// "list-tools.prettyPrint": 0
[{"city":"Tokyo","country":"Japan","population":37732000}]
It is possible to add your own formats using the internal descriptors used to generate the shipped output languages. You can either create the format from scratch or use an existing format as a base. For example, output in XML using properties instead of elements could look like this:
{
"list-tools.additionalFormats": {
"xml-attributes": {
"name": "XML with Attributes",
"objectList": {
"base": "xml",
"delimiter": " ", // Override the delimiter to separaten items
"itemFormat": {
"assignmentOperator": "=", // Attribute assignment
"assignmentOperatorSpaced": "=", // There is no spaced version in XML
"enclosure": {
"start": "<item ", // Override `<item></item>` enclosure
"end": "/>",
},
"keyEnclosure": [
{
"id": "bracket-keys", // Disable enclosing keys in `<{key}></{key}>`
"disabled": true
}
],
"valueEnclosure": "\"", // Quote all values
},
}
}
}
}
Known Limitations
- data sources and programming languages must be in a valid format
- extraction from programming languages only works in cases with simple key-value pairs
- converting may lead to invalid syntax when special characters are involved
Contributing
Feel free to open pull request or issues with additional formats.
Have a look through src/providers/formats
for some examples.
This extension also supports localization through vscodes l10n, so l10n bundles are always welcome.
All bundles included in l10n/
will always be complete, so any of them can be used as a template.