-
Notifications
You must be signed in to change notification settings - Fork 0
WIP: prepare for LSP #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wudi
wants to merge
199
commits into
master
Choose a base branch
from
pls
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added `lsp_server.rs` to handle LSP requests and responses. - Implemented indexing of PHP symbols (classes, functions, methods, properties, etc.) using `DashMap`. - Introduced `IndexingVisitor` and `DocumentSymbolVisitor` for traversing the AST and collecting symbols. - Enhanced `Backend` struct to manage documents, symbol indexing, and diagnostics publishing. - Integrated file indexing on server initialization using `WalkDir`. - Added support for LSP features: document symbols, go to definition, references, hover, and completion. - Updated `lib.rs` to include `line_index` module. - Refactored `line_index.rs` for improved offset calculations. - Modified parser to handle doc comments for classes and functions. - Updated tests to cover new LSP features and ensure correct symbol indexing and retrieval.
- Created package.json for the PHP Parser RS LSP extension with necessary metadata and dependencies. - Implemented extension.ts to activate the language client, configure server path, and handle server execution. - Added tsconfig.json for TypeScript compilation settings.
…ing range support
…nd inlay hint visitors
…claration functionality
…gVisitor and add goto implementation functionality
…or and add goto type definition functionality
- Added CallFrame struct to manage execution context. - Introduced Stack struct for operand management. - Defined OpCode enum for bytecode instructions including stack operations, arithmetic, variable handling, control flow, and object manipulation. - Created initial VM module structure with engine, stack, opcode, and frame management. - Implemented basic tests for arrays, classes, constructors, and inheritance to validate functionality. - Established a comprehensive VM specification document outlining architecture, data structures, and implementation roadmap.
- Enhanced the VM to support passing variables by reference, including function parameters and array assignments. - Introduced new opcodes: AssignRef, MakeVarRef, and AssignDimRef to manage reference assignments and dereferencing. - Updated the VM's execution logic to handle references correctly during variable assignments, function calls, and returns. - Added tests for various scenarios involving references, including basic reference assignments, foreach loops with references, and function calls with reference parameters. - Improved error handling for invalid reference operations and ensured proper memory management for reference types.
- Added bitwise operations: AND, OR, XOR, NOT, left shift, and right shift. - Introduced spaceship operator for comparison. - Implemented logical operations: boolean NOT and XOR. - Added assignment operations with support for various arithmetic and bitwise operations. - Implemented increment and decrement operations (pre and post). - Added type casting functionality for various types. - Introduced new opcodes for array manipulation: unset dimension, check if key exists, and count elements. - Implemented object manipulation opcodes: unset object properties, instance checking, and class retrieval. - Added tests for new operations including bitwise operations, spaceship operator, ternary operator, increment/decrement, and type casting.
- Added FastCGI protocol implementation in `fcgi` module. - Created `Request` and `RequestBuilder` for handling FastCGI requests. - Implemented FastCGI record reading and writing functions. - Developed `FpmRequest` struct to map FastCGI parameters to PHP superglobals. - Introduced `init_superglobals` function to populate PHP superglobals from FastCGI request data. - Added integration tests for php-fpm FastCGI server, covering basic requests, GET parameters, PHP SAPI, headers, and concurrent requests. - Made `insert_builtin_constant` public in `RequestContext` for external access.
…guration examples, documentation, and an updated integration test.
- Added new hash algorithms: RIPEMD (128, 160, 256, 320), Tiger (128, 160, 192), and XXHash (32, 64, 3, 128). - Implemented HMAC support for multiple algorithms including MD5, SHA1, SHA2 variants, RIPEMD, Tiger, and Whirlpool. - Introduced PBKDF2 and HKDF key derivation functions. - Added hash_equals function for constant-time string comparison. - Implemented hash_update_file and hash_update_stream functions for updating hash contexts with file and stream data. - Created tests for HMAC, hash_equals, PBKDF2, and new hash algorithms to ensure correctness.
- Implemented Adler32, FNV-1, FNV-1a (32-bit and 64-bit), and Joaat hashing algorithms. - Updated HashRegistry to register new algorithms. - Added unit tests for new algorithms to ensure correctness. refactor(tests): create comprehensive hash algorithms test suite - Developed a test suite for various hash algorithms to validate output against expected values. - Included tests for existing algorithms to ensure backward compatibility.
- Added and struct wrappers implementing and . - Implemented function to support Tiger128/160 variants that require custom HMAC logic due to crate limitations. - Updated to include and . - Updated to list all supported algorithms including Tiger variants. - Resolved method ambiguity in macro and struct implementations.
- Moved code execution logic from individual test files into a common module. - Updated tests in `static_lsb.rs`, `static_properties.rs`, `static_self_parent.rs`, `static_var.rs`, `stdlib.rs`, `string_functions.rs`, `switch_match.rs`, `variable_variable.rs`, and `yield_from.rs` to utilize the new common functions for running PHP code. - Ensured all test cases are prefixed with `<?php` for proper PHP syntax. - Improved readability and maintainability of test code by reducing duplication.
…le initialization - Added support for setting a custom working directory in the PHP VM executor. - Introduced global variable initialization after VM creation, ensuring proper memory allocation. - Updated `ExecutionConfig` to include `working_dir` and `globals` fields. - Enhanced test coverage with 15 new tests for global variables and working directory features. feat(stderr): Complete stderr capture implementation - Implemented independent capture of stderr alongside stdout in the PHP VM executor. - Created `CapturingErrorHandler` for error reporting with formatted output. - Updated executor to handle stderr extraction and ensure proper formatting. - Added 5 new tests to validate stderr capture functionality.
…tput helper - Introduce common::run_code_capture_output for consistent output capturing in tests - Refactor test modules to use the new helper, removing duplicated output writer logic - Simplify test code for property array initialization, eval, isset/empty, echo escapes, string interpolation, finally, and globals superglobal - Minor improvements to test clarity and error assertions
- Updated all test files to replace direct instantiation of EngineContext with EngineBuilder. - Ensured that core extensions are included in the engine setup for all tests. - Improved consistency and maintainability of test setup code.
… for improved modularity
- Added comprehensive typed property validation to the Rust PHP VM, aligning with PHP 8.x behavior. - Introduced new data structures for property entries and static property entries. - Enhanced compilation process to emit property declarations with type hints. - Implemented runtime validation and type coercion logic for scalar and complex types. - Created extensive test cases for property type validation, including valid assignments, coercion scenarios, and error handling. - Added examples demonstrating property type validation, including inheritance and static properties. - Documented implementation details, type coercion rules, and future enhancements in PROPERTY_TYPE_VALIDATION.md.
- Introduced tests for strict types edge cases, including union types, nullable types, false and true types, mixed types, default parameters, multiple parameters, void return types, and complex coercion chains. - Implemented tests for strict types evaluation, ensuring that eval() inherits strictness correctly and handles return type checking. - Added tests for include/require behavior with strictness, verifying that included files maintain their own strictness modes and that strict callers enforce type checks on weak functions. - Created parameter validation tests to check strict and weak mode behaviors for various types, including int, float, string, bool, and nullable types. - Developed return validation tests to ensure correct handling of return types in both strict and weak modes, including coercion scenarios.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.