This is a Visual Studio Code Extension (or plugin) for CodeQuery. The Visual Studio Code Extension Marketplace page for this extension is ruben2020.codequery4vscode. CodeQuery is a tool to index, then query or search C, C++, Java, Python, Ruby, Go and Javascript source code. It builds upon the databases of cscope and Exuberant ctags. It can also work with Universal ctags, which is a drop-in replacement for Exuberant ctags. The databases of cscope and ctags would be processed by the The CodeQuery database file can be queried on Visual Studio Code using this extension. This Visual Studio Code Extension makes use of Codequery CLI tool Latest version = 0.8.1Please read CHANGELOG to discover the latest changes in this release. What types of query can I make with this extension?
What does it cost? How is it licensed?This software is freeware and free open source software. It can be used in a commercial environment for free, for an unlimited period of time. The same applies to CodeQuery. This software is licensed under the MIT License. Please see the LICENSE file for more details. Which platforms are supported?It has been tested on Visual Studio Code in Linux 64-bit and Windows 10 64-bit. It should work on Mac without any problems, similar to how it works on Linux. What are the prerequisites or dependencies that I must install, before installing this extension?You need to install the following:
If you have installed CodeQuery correctly, How do I install this extension?The Visual Studio Code Extension Marketplace page for this extension is ruben2020.codequery4vscode. In Visual Studio Code, click on the Extension button on the left panel (or alternatively, press Ctrl+Shift+X) and then search for "codequery4vscode". After this, click on the Install button. Alternatively, in Visual Studio Code, press Ctrl+P, then enter How do I prepare my source code for use with this extension?Let's assume that the base folder of your source code is The extension will look for the CodeQuery database in The CodeQuery database can be rebuilt by the extension using either a Bash script in The Bash script or Windows batch file can be called manually or through the codequery4vscode Visual Studio Code extension. It's meant to be executed when the current working directory is Let me provide an example here on how to prepare the source code of CodeQuery itself. In Linux or Mac, follow these steps for C/C++ source code:
Here, Then create the script
And then make it executable:
You can test the script by calling:
In Windows, follow these steps for C/C++ source code:
Then create the Windows batch file
You can test the Windows batch file by calling the following on a command terminal window:
Please replace the wildcard expressions above with *.java, *.py, *.rb, *.go and *.js respectively for Java, Python, Ruby, Go and Javascript. Details can be found on the CodeQuery page. You may also want to add How do I build or rebuild the CodeQuery database using this extension on Visual Studio Code?First, open the Command Palette using Ctrl+Shift+P. Alternatively, click You will then see this: Next, type "CodeQuery" into the inputbox. It will narrow down the results. Select It could take a while to complete depending on the number of source code files to index. It will show a pop-up stating if the database rebuild was successful or failed. If How do I search or query my code using this extension on Visual Studio Code?First, open the base folder of your source code by clicking on There are 3 ways to search or query code using this extension:
The next sections show these. Method 1 for searching or querying codeFirst, open the Command Palette using Ctrl+Shift+P. Alternatively, click You will then see this: Next, type "CodeQuery" into the inputbox. It will narrow down the results. Select Next, it will show you a quickpick menu with a list of possible search types. In this example, we select Next, it will show you an inputbox, where you can type a search phrase. In this example, we typed For exact string search (including case sensitive), please enclose the search term in quotes like this: The path filter can be included in square brackets after the search term. To search for the term To search for the term After this, the search results will be shown. How to browse the search results will be explained below. Method 2 for searching or querying codeFirst, open a source file from the current project or folder in Visual Studio Code, then make a text selection using the mouse or keyboard, by highlighting some text. In this example, we highlighted "updateListHeaders" in listhandler.cpp, at line 51. After this, right-click and a dropdown menu will appear. Select Next, it will show you a quickpick menu with a list of possible search types. In this example, we select After this, the search results will be shown. How to browse the search results will be explained below. Method 3 for searching or querying codeFirst, click the CodeQuery icon on the leftmost panel. This will reveal the codequery4vscode treeview on the left side. After this, click on Next, it will show you a quickpick menu with a list of possible search types. In this example, we select Next, it will show you an inputbox, where you can type a search phrase. In this example, we typed For exact string search (including case sensitive), please enclose the search term in quotes like this: The path filter can be included in square brackets after the search term. To search for the term To search for the term After this, the search results will be shown. How to browse the search results will be explained below. How to browse the search results?The search results will be shown on the codequery4vscode treeview on the left side. A summary of the search results is shown on top. Below that, a list of files where the search results appear in, would be shown. Select a file on the list to expand it, then select a line which represents a result. In this example, we selected The above is based on the search type of Click on Next, it will show you a quickpick menu with a list of possible search types. In this example, we select Next, the results will be updated as follows. How do I contact the authors for support, issues, bug reports, fix patches, feature requests etc.?Please see the email address below, and also the Issues tab in GitHub. Email address: Website: codequery4vscode website How can I contribute?
List of Contributorsruben2020 |