Tasking Project to VSCode
A VSCode extension that converts Tasking project configurations to VSCode settings, making it easier to work with Tasking projects in Visual Studio Code.
Features
- Automatically detects and converts Tasking project configurations (.cproject files)
- Extracts and converts:
- Predefined macros
- Include paths
- Excluding paths
- Forced include files
- Supports multiple Tasking configurations with configuration selector
- Generates VSCode configuration files:
- c_cpp_properties.json for C/C++ configuration
- settings.json for file exclusion rules
- compile_commands.json for clangd integration
- Integrates with GNU Global for enhanced code navigation
- Enhanced clangd support with optimized settings for better code intelligence
Requirements
- Visual Studio Code version 1.80.0 or higher
- C/C++ extension for VSCode (recommended)
- GNU Global (optional, required for code navigation features)
Installation
- Download the extension package
- Install it in VSCode using the Extensions view
- Reload VSCode
Usage
- Open your Tasking project folder in VSCode
- Press
Ctrl+Shift+P
(Windows/Linux) or Cmd+Shift+P
(macOS) to open the Command Palette
- Type "Convert Tasking Project" and select the command
- Choose the configuration you want to convert when prompted
- The extension will create/update the necessary VSCode configuration files
Extension Settings
This extension contributes the following settings:
tasking-to-vscode.enableGNUGlobal
: Enable GNU Global Support for code navigation. When enabled, a gtags.conf file will be generated with proper exclude paths configuration. Default is false.
tasking-to-vscode.enableCompileCommands
: Enable generation of compile_commands.json file for clangd integration. When enabled, the extension will generate a compile_commands.json file based on your Tasking project configuration, providing enhanced code intelligence features through clangd. Default is true.
tasking-to-vscode.clangdDiagnosticsSuppressOptions
: Configure the Diagnostics.Suppress options in the .clangd file to suppress specific diagnostic warnings. Multiple values can be specified as an array. Default is ["attributes_not_allowed"].
GNU Global Configuration
When GNU Global support is enabled, the extension automatically generates a gtags.conf
file in your project directory. This file is configured to:
- Convert exclude paths from your Tasking project to GNU Global format
- Handle both directory and file exclusions
- Support wildcards and pattern matching
- Maintain consistency with VSCode's file exclusion settings
The generated configuration ensures that GNU Global indexes only the relevant source files, improving performance and search accuracy.
Clangd Integration
The extension generates a compile_commands.json
file in the .vscode directory, which enables advanced code intelligence features through clangd:
- Accurate code completion and diagnostics
- Smart header file inclusion
- Cross-file symbol renaming
- Background indexing for better performance
- Detailed completion suggestions
Known Issues
- Path conversion limitations: Some complex path configurations in the Tasking project may not be correctly converted to VSCode format
- Performance considerations: Projects with extremely large numbers of exclude paths (>100) may experience slower initial configuration generation
Troubleshooting
If you encounter a spawn ENAMETOOLONG
error when using the extension, this is typically caused by:
- Too many exclude paths in your
.cproject
file (the main cause)
- Each exclude path being converted to complex glob patterns
- The combined exclude pattern string exceeding system command line argument limits
Root Cause: When your Tasking project has dozens or hundreds of exclude paths in the .cproject
file, the extension converts each path to a glob pattern and combines them into a single string for vscode.workspace.findFiles
. This can result in command line arguments that exceed system limits (typically around 8000 characters).
Solution: The extension automatically handles this in version 1.0.9 and later by:
- Limiting the maximum number of exclude patterns to 50
- Limiting the total exclude string length to 8000 characters
- Using a fallback strategy when limits are exceeded:
- Priority given to hidden directory exclusions (
.git
, .vscode
, etc.)
- Important exclude patterns are preserved up to the length limit
- Warning messages are logged when patterns are limited
Manual Workarounds (if needed):
- Reduce the number of exclude paths in your
.cproject
file
- Combine similar exclude patterns where possible
- Check the VSCode output console for warning messages about pattern limiting
Release Notes
1.0.9
- Fixed critical spawn ENAMETOOLONG error caused by too many exclude paths in
.cproject
files
- Added intelligent exclude pattern limiting (max 50 patterns, max 8000 characters)
- Implemented fallback strategy to preserve most important exclude patterns when limits are exceeded
- Enhanced error handling with detailed warning messages for pattern limitation
- Improved performance for projects with large numbers of exclude configurations
1.0.8
- Fixed spawn ENAMETOOLONG error in Git-managed projects by automatically excluding hidden directories (starting with
.
) from file searches
- Improved performance in projects with large numbers of files by filtering out
.git
, .vscode
, and other hidden directories
- Enhanced file search efficiency and reduced memory usage during configuration generation
1.0.7
- Optimized user experience for single configuration scenarios: Automatically use the configuration without displaying the selection dialog when the project has only one configuration
1.0.6
- Added clangdDiagnosticsSuppressOptions configuration for customizing clangd diagnostic warnings
- Enhanced clangd integration with configurable warning suppression
1.0.5
- restart clangd server after configuration changes
1.0.4
- Add arguments -ferror-limit=0 for clangd
1.0.3
1.0.2
- Added support for Tasking compiler-specific identifiers
- Improved macro handling and compiler compatibility
- Enhanced configuration parsing for better Tasking integration
1.0.1
- Added compile_commands.json generation for clangd integration
- Enhanced clangd configuration with optimized settings
- Added support for forced include files
- Improved path processing for better compatibility
- Enhanced exclude path handling for both files and directories
1.0.0
Initial release of Tasking Project to VSCode converter with the following features:
- Basic Tasking project configuration conversion
- GNU Global integration for code navigation
- Multiple configuration support