Skip to content
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

[Swift APIView] Create intermediate models and SwiftAPIViewTests package #3069

Merged
merged 11 commits into from Apr 21, 2022

Conversation

tjprescott
Copy link
Member

@tjprescott tjprescott commented Apr 5, 2022

This refactor extracts tests out to a SwiftAPIViewTests package a la Python, adds a number of new tests from Apple's own documentation, and adds an internal intermediate model that will allow us to manipulate objects in support of fixing the issues we see with extensions. Fixes #3091.

This PR does not attempt to fix the issue with extensions. It just lays that groundwork.

APIView: https://apiviewstaging.azurewebsites.net/Assemblies/Review/a0490ca69cf740cea3ce6fabad9c3c67/2b0384fd32894ecfa24edfcd73a11cff

@tjprescott tjprescott marked this pull request as ready for review April 6, 2022 19:31
@tjprescott tjprescott force-pushed the swift/ModelOverhaul branch 3 times, most recently from 568e0c5 to f4ef41f Compare April 7, 2022 16:37
checkIndent()
let item = Token(definitionId: definitionId, navigateToId: nil, value: text, kind: .text)
// TODO: Add cross-language definition ID
// if add_cross_language_id:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just for Swift or across languages?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just left comment here so I know where to add it. Right now only Python has this implemented.

}

// TODO: Add support for diagnostics
// func diagnostic(self, text, line_id):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are diagnostics disabled across the board?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They've never been implemented in Swift APIView, so I added this to come to later.

decl.members.forEach { member in
switch member {
case let .declaration(decl):
// TODO: We need to push these into the relevant object definitions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? Push the extension declaration into the proper Extended class?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was more me thinking out loud. Part of: #2536

I'm not yet sure what the best way would be.

Copy link

@mpodwysocki mpodwysocki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tjprescott tjprescott merged commit fe55757 into main Apr 21, 2022
@tjprescott tjprescott deleted the swift/ModelOverhaul branch April 21, 2022 17:25
benbp pushed a commit to benbp/azure-sdk-tools that referenced this pull request May 6, 2022
…age (Azure#3069)

* Initial work.

* Refactoring progress.

* Refactoring progress.

* More refactoring.

* Fixes and extract tests to new test project.

* Address fixes.

* More updates. Add operator and precedence group tests.

* Fix navigation. Add attribute tests.

* Fix issues with enums. Add enum test file.

* TypeModel improvements.

* Add FunctionsTestFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Swift APIView] Improve TypeModel implementation
2 participants