Conversation
…mantic_information_about_type_when_more_than_libraries_are_imported
Refactored `AXSharpProject` to improve type handling and logging: - Changed `projectSources` type to `IEnumerable<(ISyntaxTree parseTree, SourceFileText source)>`. - Ensured distinct reference parse trees using `DistinctBy`. - Updated `compilationResult` creation and added error logging. - Cleaned output folder before compilation. Enhanced `CreateMetaType` method: - Added namespace check and pragma appending to `StringBuilder`. Updated `SemanticsHelpers`: - Added `FindTypeDeclaration` method. - Added methods for determining fully qualified names of declarations. - Replaced direct type checks with `FindTypeDeclaration`. Improved `CsOnlinerMemberBuilder`: - Added case for `UndefinedTypeDeclaration`. - Added workaround for ambiguous types using fully qualified names. Refined `CsOnlinerSourceBuilder`: - Replaced direct type checks with `FindTypeDeclaration`. - Added workaround for not fully qualified declarations. Modified `launchSettings.json`: - Changed `workingDirectory` for `ixc-simple-template` profile. - Added `--skip-deps` to `commandLineArgs` for `ixc-simple-template` profile.
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
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.
This pull request introduces several changes to improve the handling of type declarations and diagnostics in the AXSharp compiler. The key changes include enhancements to the
Generatemethod, the addition of helper methods for type declaration resolution, and workarounds for ambiguous types in field and variable declarations.Improvements to type declaration handling:
src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/SemanticsHelpers.cs: AddedFindTypeDeclaration,DetermineFullyQualifiedNamemethods to resolve fully qualified type names and determine the fully qualified name of field and variable declarations.src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/SemanticsHelpers.cs: UpdatedIsEligibleForTranspilemethods to use the newFindTypeDeclarationmethod for better type resolution. [1] [2] [3]Enhancements to diagnostics and logging:
src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs: Enhanced theGeneratemethod to log compilation diagnostics and ensure distinct reference parse trees.Workarounds for ambiguous types:
src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerMemberBuilder.cs: Added workarounds for handling ambiguous types inCreateFieldDeclarationandCreateVariableDeclarationmethods. [1] [2]src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs: Implemented a workaround for not fully qualified declarations inCreateClassDeclaration.Minor updates:
src/AXSharp.compiler/src/ixc/Properties/launchSettings.json: Updated the working directory and added command line arguments for theixc-simple-template.closes #159