-
Notifications
You must be signed in to change notification settings - Fork 749
feat(amazonq): support customization through language server #6865
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
base: master
Are you sure you want to change the base?
Conversation
|
|
|
||
| // This command is only declared and registered in Amazon Q if Q exists | ||
|
|
||
| export const connectCustomizationHandler = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the only difference of this implementation is that it plumbs down the client into select customization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that's right
jpinkney-aws
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a thought experiment: instead of passing down the language client through everything, what if we passed through the available customization instead? Would that make the code easier to understand/break up separation of concerns between the lsp calls and what's currently in the code?
hmm what we can do is pass in those two functions to get customizations and send notification about the selected one. But I feel like passing client itself might be leaner. |
|
Zoe maybe we can take this chance to make custom related thing to a |
|
it would be easy to use to have a class |
|
i wonder is there any concern we don't do migration work in feature branch? @jpinkney-aws I feel doing these changes in feature branch will make us easier to make large surface refactring with out too much operational concerns. |
| } | ||
|
|
||
| export async function notifyNewCustomizations() { | ||
| export async function notifyNewCustomizations(client?: LanguageClient) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea let's wrap all these things into a class and have the client in one place instead of passing the client in all function calls
I think this refactor might be better after we deprecate the old code path. The current implementation might not be the prettiest but it should be pretty safe. |
|
i kinda prefer refactoring them in one shot when we're writing the new LSP path as they're not yet in use in PROD so that we don't have much concern but either one works for me. But to fit in the current project planing and timeline, it makes sense to do refactoring afterward |
created a new class refactored from the original utils and kept the original as is we can deprecate it later. Note with this approach the duplication linter fail is expected. |
|
You can actually suppress the duplicate code linter with: it might make sense in this case -- since the old implementation is just going to be dropped when we release this through flare. Maybe make an issue somewhere on github? (or internal?) to keep track that theres duplicate implementations, since if anyone wants to change customizations they need to change it in both places I'm also wondering if you can just export the function calls from the customizations in core and then call those functions in your class? that way if anyone changes the implementations for now, your class would still work? WDYT? |
|
thanks! I will create an issue internally to track that the deprecation of the old file, most of these haven't been changed for a long time I don't see a strong need to export them into the class as it's cleaner this way and it gives us more motivation to deprecate instead of having the implementation in two places. Let me know if you a strong preference.
|
Problem
customization support for inline through language server:
Solution
it won't be e2e functional until aws/language-servers#882 is released but it doesn't break the current inline
feature/xbranches will not be squash-merged at release time.