-
Notifications
You must be signed in to change notification settings - Fork 751
feat(amazonq): Auto update language servers when new versions are available #6310
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): Auto update language servers when new versions are available #6310
Conversation
…ilable Problem: - Only one version is installed right now Solution: - Automatically update when a new version is available in the manifest
|
| await fs.delete(tempFolder) | ||
| }) | ||
|
|
||
| describe('download', () => { |
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.
These tests can likely be made obsolete by testing the same scenarios in tests for AmazonQLSPInstaller.
Stubbing the http fetcher should be enough to test the entire flow, and then you could have complex tests where it first downloads from the remote, then a subsequent call should instead use the cache
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.
yeah now that the installer exists I can bring them up a level. I'll add that as a followup item
| } | ||
| } | ||
|
|
||
| export class RetryableResourceFetcher extends HttpResourceFetcher { |
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.
I think this should probably be done in a different way. Maybe the httpResourceFetcher can have retries in it? I think we can re-visit this after this PR
| } | ||
|
|
||
| export function getApplicationSupportFolder() { | ||
| switch (process.platform) { |
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.
TODO support more platforms and their fallback locations
| new Range(supportedLspServerVersions) | ||
| ).resolve() | ||
|
|
||
| // TODO Cleanup old versions of language servers |
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.
Calling this out explicitly so we don't forget
| } | ||
|
|
||
| const downloadTasks = contents.map(async (content) => { | ||
| // TODO This should be using the retryable http library but it doesn't seem to support zips right now |
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.
Calling this out as well, we should switch to something that has retries with backoffs
nkomonen-amazon
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.
Approved as this code does not impact prod and we can do fast follow ups
| @@ -0,0 +1,352 @@ | |||
| /*! | |||
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.
can these modules live in shared/lsp/ instead of shared/languageServer/ ? helps discovery.
| import * as semver from 'semver' | ||
| import * as path from 'path' | ||
| import { FileType } from 'vscode' | ||
| import AdmZip from 'adm-zip' |
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.
We have a zip.js-based ZipStream module now. We should avoid adm-zip , because we want to remove it.
Problem:
Solution:
TODO
feature/xbranches will not be squash-merged at release time.