Skip to content

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

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 7 commits into from
Mar 4, 2025

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

github-actions bot commented Feb 27, 2025

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
@rli rli enabled auto-merge (squash) March 3, 2025 22:36
@rli rli disabled auto-merge March 4, 2025 18:06
@rli rli merged commit 9574b42 into feature/q-lsp Mar 4, 2025
13 of 18 checks passed
@rli rli deleted the rli/expose-capabilities branch March 4, 2025 18:06
leigaol pushed a commit to leigaol/aws-toolkit-jetbrains that referenced this pull request Mar 20, 2025
…LspService (aws#5417)

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"
              }
            }
          ]
        }
      }
```
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