JSON Key Finder is a Visual Studio Code extension that allows you to search for keys in a JSON file and find the lines of code in your project where these keys are used. This extension is particularly useful for developers working with Translation JSON file.
Features
Search for a value in a JSON file and find the corresponding keys.
Locate files and specific lines of code that contain the identified keys.
Easy navigation to the line of code containing the key.
Hover over strings to see corresponding JSON values in a tooltip.
Installation
Install the extension from the Visual Studio Code Marketplace.
Set the path to your JSON file using the setting json path command.
Usage
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Run the setting json path command to specify the path to your JSON file. You only need to do this once.
Run the find contents based on json key command.
Enter the value you want to search for in the JSON file.
Select a search result to navigate to the corresponding line of code.
Commands
setting json path: Sets the path to your JSON file. This path will be stored and used for subsequent searches.
find contents based on json key: Searches for a specified value in the JSON file, finds the corresponding keys, and locates the usage of these keys in your project.
Example
Open the Command Palette and run setting json path.
Enter the path to your JSON file, for example, path/to/yourfile.json.
Open the Command Palette again and run find contents based on json key.
Enter the value you want to search for, such as exampleValue.
A list of keys corresponding to the value exampleValue will be displayed.
Select a key to see a list of files and lines where the key is used.
Click on a search result to open the file at the specific line containing the key.
Configuration
No additional configuration is required beyond setting the JSON file path.
License
This extension is licensed under the MIT License. See the LICENSE file for more information.
Release Notes
1.0.0
Initial release of JSON Key Finder.
Search for keys in a JSON file and locate their usage in your project.
1.0.1
Add Extension Icon
1.0.2
Optimize search speed
limit JSON value targets (only string, number, Array(string, number) value)
1.0.3
Validate json path
Show json path in search placeholder
1.0.4
Add step to select Key
1.0.5
Change search engine (to Ripgrep)
1.0.6
Bug fix
Provide json save per workspace
1.0.7
Provide Matching value Tooltip
1.0.8
Change package.json engines key (VSCode version)
Enjoy using JSON Key Finder! If you have any feedback or suggestions, please let us know.