Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Nov 22, 2024

Companion of swiftlang/swift-package-manager#8138


Currently, when there‘s a syntax error in a package manifest, we don’t get any build settings from it in SourceKit-LSP and thus loose almost all semantic functionality. If we can’t parse the package manifest, fall back to providing build settings by assuming it has the current Swift tools version.

Currently, when there‘s a syntax error in a package manifest, we don’t get any build settings from it in SourceKit-LSP and thus loose almost all semantic functionality. If we can’t parse the package manifest, fall back to providing build settings by assuming it has the current Swift tools version.

Fixes #1704
rdar://136423767

@ahoppen
Copy link
Member Author

ahoppen commented Nov 22, 2024

fallbackAfterTimeout: false
)
let compilerArgs = try XCTUnwrap(settings?.compilerArguments)
XCTAssert(compilerArgs.contains("-package-description-version"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth checking that we get the package version correct since that's still well-formed in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in #1885

Currently, when there‘s a syntax error in a package manifest, we don’t get any build settings from it in SourceKit-LSP and thus loose almost all semantic functionality. If we can’t parse the package manifest, fall back to providing build settings by assuming it has the current Swift tools version.

Currently, when there‘s a syntax error in a package manifest, we don’t get any build settings from it in SourceKit-LSP and thus loose almost all semantic functionality. If we can’t parse the package manifest, fall back to providing build settings by assuming it has the current Swift tools version.

Fixes swiftlang#1704
rdar://136423767
@ahoppen ahoppen force-pushed the invalid-manifest-build-settings branch from bb5bcb2 to a087692 Compare December 9, 2024 23:25
@ahoppen
Copy link
Member Author

ahoppen commented Dec 9, 2024

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge December 9, 2024 23:27
@ahoppen
Copy link
Member Author

ahoppen commented Dec 9, 2024

@swift-ci Please test Windows

@atrick atrick disabled auto-merge December 9, 2024 23:34
@atrick atrick merged commit e7f9530 into swiftlang:main Dec 9, 2024
0 of 3 checks passed
@ahoppen ahoppen deleted the invalid-manifest-build-settings branch December 10, 2024 18:31
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.

No such module PackagePlugin

3 participants