Skip to content

feat(amazonq): fetch filePatterns from initializeResponse for workspace messages #5457

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

Merged
merged 21 commits into from
May 8, 2025

Conversation

samgst-amazon
Copy link
Contributor

Grab the file patterns programmatically from the server's response to initialize().

Types of changes

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

Description

Utilize InitializeResponse's ServerCapabilities object to get the accepted file patterns for each supported message our workspaceService is handling.

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.

@samgst-amazon samgst-amazon changed the base branch from main to feature/q-lsp March 7, 2025 23:56
Copy link

github-actions bot commented Mar 8, 2025

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@samgst-amazon samgst-amazon marked this pull request as ready for review March 10, 2025 16:39
@samgst-amazon samgst-amazon requested a review from a team as a code owner March 10, 2025 16:39
@@ -318,7 +318,7 @@ private class AmazonQServerInstance(private val project: Project, private val cs

DefaultAuthCredentialsService(project, encryptionManager, this)
TextDocumentServiceHandler(project, this)
WorkspaceServiceHandler(project, this)
WorkspaceServiceHandler(project, initializeResult, this)
Copy link
Contributor

Choose a reason for hiding this comment

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

if you rebase, you should have access to the server initialize result directly instead of needing to resolve the deferred value

# Conflicts:
#	plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/workspace/WorkspaceServiceHandler.kt
@samgst-amazon
Copy link
Contributor Author

still not supported by the live server, probably should wait a bit before merging

@rli rli deleted the branch feature/q-lsp-chat April 18, 2025 19:44
@rli rli closed this Apr 18, 2025
@rli rli reopened this Apr 18, 2025
@rli rli changed the base branch from feature/q-lsp to main April 18, 2025 19:49
import java.nio.file.Paths

class WorkspaceServiceHandler(
private val project: Project,
initializeResult: InitializeResult,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: do we need to send the whole result or can we send the operations?

@rli rli changed the base branch from main to feature/q-lsp-chat May 8, 2025 20:23
@rli rli merged commit 20c045b into feature/q-lsp-chat May 8, 2025
14 of 16 checks passed
@rli rli deleted the samgst/q-lsp-supported-filetypes branch May 8, 2025 20:23
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