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

feat(amazonq): expose lsp server capabilities to consumers of AmazonQLspService #5417

Open
wants to merge 2 commits into
base: feature/q-lsp
Choose a base branch
from

Conversation

rli
Copy link
Contributor

@rli rli commented Feb 27, 2025

For certain capabilities, the client implementation needs to be aware of what resources the server is interested in. In the case of WorkspaceEdit, we need to expose the filters returned by the server in the initialization handshake.

      "fileOperations": {
        "didCreate": {
          "filters": [
            {
              "pattern": {
                "glob": "**/*.{ts,js,py,java}",
                "matches": "file"
              }
            },
            {
              "pattern": {
                "glob": "**/*",
                "matches": "folder"
              }
            }
          ]
        },
        "didRename": {
          "filters": [
            {
              "pattern": {
                "glob": "**/*.{ts,js,py,java}",
                "matches": "file"
              }
            },
            {
              "pattern": {
                "glob": "**/*",
                "matches": "folder"
              }
            }
          ]
        },
        "didDelete": {
          "filters": [
            {
              "pattern": {
                "glob": "**/*.{ts,js,py,java}",
                "matches": "file"
              }
            },
            {
              "pattern": {
                "glob": "**/*",
                "matches": "folder"
              }
            }
          ]
        }
      }

License

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

…LspService

For certain capabilities, the client implementation needs to be aware of what resources the server is interested in.
In the case of `WorkspaceEdit`, we need to expose the filters returned by the server in the initialization handshake.

```json
      "fileOperations": {
        "didCreate": {
          "filters": [
            {
              "pattern": {
                "glob": "**/*.{ts,js,py,java}",
                "matches": "file"
              }
            },
            {
              "pattern": {
                "glob": "**/*",
                "matches": "folder"
              }
            }
          ]
        },
        "didRename": {
          "filters": [
            {
              "pattern": {
                "glob": "**/*.{ts,js,py,java}",
                "matches": "file"
              }
            },
            {
              "pattern": {
                "glob": "**/*",
                "matches": "folder"
              }
            }
          ]
        },
        "didDelete": {
          "filters": [
            {
              "pattern": {
                "glob": "**/*.{ts,js,py,java}",
                "matches": "file"
              }
            },
            {
              "pattern": {
                "glob": "**/*",
                "matches": "folder"
              }
            }
          ]
        }
      }
```
@rli rli requested a review from a team as a code owner February 27, 2025 21:59
@rli rli force-pushed the rli/expose-capabilities branch from c8a3ee2 to 712dbcb Compare February 27, 2025 22:01
Copy link

Qodana Community for JVM

2 new problems were found

Inspection name Severity Problems
Unused symbol 🔶 Warning 1
Function or property has platform type ◽️ Notice 1

💡 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]

@@ -95,6 +94,8 @@
@Service(Service.Level.PROJECT)
class AmazonQLspService(private val project: Project, private val cs: CoroutineScope) : Disposable {
private var instance: Deferred<AmazonQServerInstance>
val capabilities

Check notice

Code scanning / QDJVMC

Function or property has platform type Note

Declaration has type inferred from a platform call, which can lead to unchecked nullability issues. Specify type explicitly as nullable or non-nullable.
@@ -95,6 +94,8 @@
@Service(Service.Level.PROJECT)
class AmazonQLspService(private val project: Project, private val cs: CoroutineScope) : Disposable {
private var instance: Deferred<AmazonQServerInstance>
val capabilities

Check warning

Code scanning / QDJVMC

Unused symbol Warning

Property "capabilities" is never used
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.

2 participants