-
Notifications
You must be signed in to change notification settings - Fork 3
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
Auto suggest environment variables using l2 --env <path>
command
#10
Conversation
- Handling this case in catch block
- Using `l2 --env ${l2FilePath}` go lang binary command to fetch env. - Removed old searching envs in the frontend as performance was low. - Moved all the suggestions and replacing part to new file.
l2 --env
command
l2 --env
commandl2 --env <path>
command
In documentation, we should settle with a proper name - something like |
src/extension.ts
Outdated
|
||
// Level1 command pallette | ||
function isDefault(defaultClient: string, client: string) { |
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.
What is this function about? not able to infer from context.
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.
Maybe it should go into a group of functions in a different file. My best guess is it's related to the code generation library selection.
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 moved everything to new files.
src/extension.ts
Outdated
}, | ||
} | ||
); | ||
let suggestEnvVariables = suggestENVS(); |
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.
suggestENVs
src/suggestEnvironmentVars.ts
Outdated
|
||
} | ||
|
||
export function suggestENVS() { |
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.
ENVs
src/suggestEnvironmentVars.ts
Outdated
// const commandOutput = execSync(`./build/l2 --env ${l2FilePath}`, { cwd: "/home/lovestaco/repos/Lama2", }).toString(); // For local debugging | ||
const commandOutput = execSync(`l2 --env ${l2FilePath}`).toString(); | ||
|
||
const mapStartIndex = commandOutput.indexOf("{"); |
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.
Ideally, we don't want to rely on this. Say, if a logger has a {
character, this is going to break. So, if at all possible we have a full quiet mode in the command output itself, so that there's no need to find the map's starting point. We should simply be able to do JSON.parse
on incoming string.
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 made the change
What type of MR is this?
Description
Edit1:
Merging old
copygit
branch autosuggest env feature.Edit2:
This MR adds the feature of suggesting root and local variables.
l2 --env <l2FilePath>
.Important code file to start Code Review from
extention.ts
Related PR
Global variable support and Generate env JSON option
Added tests?