The challenge
Our client’s initial development environment setup was fraught with inefficiencies significantly affecting development speed and productivity. The tools used by our client led to various challenges.
Struggles with CLion
- Import limitations: CLion’s inability to import the entire repository at once hindered codebase-wide refactorings.
- Performance issues: Developers faced slow indexing, refactorings, and generally low responsiveness.
- Navigation and error detection: Inaccurate highlighting and inadequate code navigation for many use cases presented significant challenges in error detection and code usage tracking.
Issues with VS Code
- Project import and indexing: VS Code provided better code highlighting but suffered from prolonged project import and indexing times.
- Integration with Bazel: The integration with Bazel was slow and cumbersome, impacting workflow efficiency.
Configuration distribution difficulties
CLion and VS Code lacked an effective method for synchronizing or distributing optimal Integrated Development Environments (IDE) configurations among users, further complicating the development environment setup.
The solution
After thoroughly examining and familiarizing our client’s technology environment, VirtusLab implemented a series of targeted strategies to improve optimization and efficiency and address the challenges faced with CLion and VS Code.
Enhancements to VS Code
VirtusLab developed a custom tool for VS Code to generate compile commands and reduce generation time. To integrate this functionality into VS Code, we created a dedicated extension.
CLI tool
- Reliable source/header file generation: Ensured accurate code highlighting by generating all necessary source and header files.
- Performance optimization: Allowed deactivation of some source code generators to enhance overall performance.
- Incremental synchronization: Offered faster feedback when modifying BUILD files through incremental synchronization.
- Multi-repository support: Enabled managing multiple dependent Bazel repositories within a single workspace.
VS Code Extension
- Development efficiency: Included a dedicated panel for frequent actions such as build, run, debug and project synchronization.
- Instant indexing: Streamlined the process to connect with a remote indexing server. This provides immediate, full access to the project’s indexed data, enabling fast comprehensive code navigation and analysis.
- Incremental indexing for local changes: Enabled incremental indexing to maintain accurate navigation and usage searches.
- Contextual file inspection: Allowed quick viewing of header files in the context of various targets that use them.
Additional enhancements
- Quality control: Integrated statistics and testing to monitor command quality and detect potential regressions, confirming most editor errors stem from incorrect build definitions.
- Client-specific customization: Tailored the tool to meet specific client requirements, including custom Bazel build definitions.
Optimization of CLion
We turned to CLion and enhanced its efficiency.
- Reduced the test indexing time by modifying the source code of CLion and the Bazel plugin.
- Optimized project configurations, reducing project import and synchronization times.
- Trained users on how to properly write project configurations.
- Integrated support for reverse dependencies, crucial for finding usages or performing codebase-wide refactorings without full imports. It enhanced the reliability and efficiency of the development process.
IDE Configuration efficiency
To bind it all together, we implemented a command-line tool to preconfigure CLion, IntelliJ, and VS Code. This ensured that developers could consistently and efficiently use their IDE setups automatically.
The results
The implementation of our solution greatly enhanced developer experience, development efficiency and productivity, and resource management within our client’s development environment. In detail, the financial services provider saw several benefits.
- Reduced project synchronization time in VS Code from over an hour to under a minute.
- Increased speed of test indexing in CLion by 4 times.
- Improved error detection accuracy and increased users' trust in their IDE.
- Ensured the reliability of newly developed tools through robust testing and error reporting.
- Enabled reliable refactoring and accurate symbol search, even across multiple repositories.
- Added precise code highlighting, leading to improved productivity and decreased coding errors.
- Enabled continuous refinement of the tools, leading to fewer disruptions and more stable development environments.
- Elevated adoption of new tools and setup, resulting in positive feedback from developers.
Tech stack
Programming Languages: C++, Python, TypeScript
IDEs and Tools: Visual Studio Code, CLion, IntelliJ IDEA, clangd
Build Systems and Continuous Integration: Bazel, TeamCity
The tech stack
Languages
![C++logo](https://cdn.virtuslab.com/C_6280a08832.png?format=webp)
![python-logo](https://cdn.virtuslab.com/Python_ed7eb12eaa.png?format=webp)
![Typescript-logo](https://cdn.virtuslab.com/Typescript_0e71ae6c1e.png?format=webp)
IDEs and Tools
Partner flexibly with VirtusLab
Use one or a combination of engagement models to suit your needs.