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

fix(amazonq): Fix bug for @workspace cannot properly locate certain folders for certain project setup #4975

Merged
merged 7 commits into from
Oct 17, 2024

Conversation

leigaol
Copy link
Contributor

@leigaol leigaol commented Oct 16, 2024

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

When the project root is removed as the module but src folders are promoted to the modules level, the @workspace indexing cannot properly resolve the project root folder, causing indexing to only apply to a subset of the workspace.

The guessProjectDir function does not work as expected, it resolves to one of the src folders. We should use basePath or equavalent.

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@leigaol leigaol requested review from a team as code owners October 16, 2024 21:26
@leigaol leigaol marked this pull request as draft October 16, 2024 21:26
@rli rli changed the title fix(amazonq): Fix bug for @workspace cannot properly locate certain folders for certain project setup fix(amazonq): Fix bug for @workspace cannot properly locate certain folders for certain project setup Oct 16, 2024
@leigaol leigaol marked this pull request as ready for review October 16, 2024 23:24
@@ -275,7 +275,7 @@ class ProjectContextProvider(val project: Project, private val encoderServer: En
var currentTotalFileSize = 0L
val featureDevSessionContext = FeatureDevSessionContext(project)
val allFiles = mutableListOf<VirtualFile>()
project.guessProjectDir()?.let {
Copy link
Contributor

Choose a reason for hiding this comment

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

probably need tests

Copy link
Contributor Author

@leigaol leigaol Oct 17, 2024

Choose a reason for hiding this comment

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

We are making a new major LSP release in 1-2 weeks. Tests will be added as part of below PRs

#4970
#4971
#4972
#4978
#4976

@leigaol leigaol merged commit 9796f7e into aws:main Oct 17, 2024
12 of 13 checks passed
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.

3 participants