-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix: convert makeProxyConfig to sync to allow proxy configs to be loa… #725
Conversation
@@ -140,7 +140,7 @@ export const makeProxyConfig = async (workspace: Workspace) => { | |||
if (proxyUrl) { | |||
const certs = isNodeJS | |||
? process.env.AWS_CA_BUNDLE | |||
? [await workspace.fs.readFile(process.env.AWS_CA_BUNDLE)] | |||
? [workspace.fs.readFileSync(process.env.AWS_CA_BUNDLE).toString()] |
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.
Do we need to have a separate method for synchronous file read? Have you tried solutions with using 'readFile' async in a factory create method instead of the constructor?
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 found this as a clean way to do it. Factory create instead of constructor is not required here and it would lead to a lot of refactoring, which might not be required.
f451fd3
to
bce11f5
Compare
#725) * fix: convert makeProxyConfig to sync to allow proxy configs to be loaded before use * fix: remove toString() as return type changed to string now --------- Co-authored-by: Paras <[email protected]>
convert makeProxyConfig function to sync as to allow proxy configurations to be loaded before being used. There has been an issue where proxy was not working for inline completions as the configurations were being loaded asyncronously and when the client was setting the configs, they were not set. The change aims to fix the issue and it has been tested on local environment to be working fine using Charles proxy for inline completions.
[[ THE CHANGE IS DEPENDENT ON THIS PR https://github.com/aws/language-server-runtimes/pull/299/files]
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.