This extension provides comprehensive language support for the NonVisual Gaming Toolkit (NVGT) with enhanced import functionality and symbol indexing.
Features
Enhanced Import Functionality
Automatic resolution of #include statements
Indexing of imported files for symbol completion
Cross-file symbol navigation
Symbol Indexing
Document symbol provider for current file symbols
Workspace symbol provider for all project symbols
Real-time indexing of functions, classes, and variables
Code Completion
Context-aware suggestions for all NVGT constructs
Completion for user-defined symbols from imported files
Built-in NVGT keywords, types, functions, and classes
Local variable completion within functions and methods
Class member completion with dot notation support
Navigation
Go-to-definition for user-defined symbols
Document symbol outline view
Workspace symbol search
Fixed Issues
This extension fixes all the issues mentioned in the original task:
Import functionality now works properly - Files are resolved and indexed when included
Files are indexed when included - Automatic parsing and indexing of imported files
Suggestions show for user functions - Completion provider includes user-defined symbols
Symbols are suggested properly - All symbols from workspace files are available in completions
All indexing issues are resolved - Robust symbol indexing and tracking system
Local variable completion now works - Local variables within functions are properly indexed and suggested
Class member completion with dot notation - Class instance members are shown when using dot notation (object.member)
Improved class member parsing - Better detection of class methods and properties
Recent Improvements
Local Variable Completion
Local variables declared within functions and methods are now properly indexed
Both const and non-const local variables are supported
Variables are correctly scoped to their containing functions
Class Member Completion
Dot notation (object.method or object.property) completion now works correctly
Class methods and properties are properly shown when accessing class instances
Improved parsing of class definitions to track all members accurately
Enhanced Symbol Tracking
Better tracking of variable types for class instances
Improved context-aware completion suggestions
More accurate symbol indexing across the entire workspace
Usage
Simply open any .nvgt file in VS Code with this extension installed. The language server will automatically:
Parse and index all symbols in the current file
Resolve and index all imported files using #include statements
Provide completions for all available symbols
Enable navigation to symbol definitions
Example
When you create a file with:
#include "example.nvgt"
class TestClass {
void test_method() {}
int test_property;
}
void test_function() {
// Local variable completion
int local_var = 42; // local_var will be suggested when typing "loc"
// Class instance creation
TestClass obj; // TestClass will be suggested when typing "Test"
// Class member completion with dot notation
obj.test_method(); // test_method will be suggested when typing "obj."
obj.test_property; // test_property will be suggested when typing "obj."
// Completions will include functions from example.nvgt
initialize_game(); // This will be suggested
// Class completions will include classes from example.nvgt
Player p("Test"); // Player class will be suggested
// Function completions will include calculate_score from example.nvgt
int score = calculate_score(10, 1.5); // calculate_score will be suggested
}
The extension will provide full IntelliSense support for all imported symbols, local variables, and class members.