You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hard coding executable paths into settings.json makes the config completely unportable. People will have different operating systems, and even different folder structures depending how things are installed.
Defining a path variable would also be cumbersome.
It should be noted that different repos might even use different versions, further complicating this practice.
Then the linter provider could spawn a child process and get exec from there.
With poetry, you can dynamically fetch the path from this poetry run which sqlfluff.
const{ exec }=require('child_process');returnnewPromise((resolve,reject)=>{exec('poetry run which sqlfluff',(error,stdout,stderr)=>{if(error||stderr){reject(error||stderr);return;}resolve(stdout)});});
In addition, this extension could talk to the Microsoft Python extension and get the virtual environment.
It is defiantly more complex. However, it allows for easy changes to the environment.
There doesn't seem to any appetite by the maintainers for addressing these issues (totally fair).
For people struggling with this, I've noticed some over lap with Issue #18.
Likewise, there seems to be an alternative extension, vscode-dbt-power-user, that might better resolve these issues for the time being. However, it doesn't seem to be a true linter
Here are some discussions I found around the issue here:
Background
Hard coding executable paths into
settings.json
makes the config completely unportable. People will have different operating systems, and even different folder structures depending how things are installed.Defining a path variable would also be cumbersome.
It should be noted that different repos might even use different versions, further complicating this practice.
This all came from Issue 133.
Suggestion
It would be nice if the config could specify a
dependencyManager
and directory. The extension could load this.settings.json
Then the linter provider could spawn a child process and get exec from there.
With poetry, you can dynamically fetch the path from this
poetry run which sqlfluff
.In addition, this extension could talk to the Microsoft Python extension and get the virtual environment.
It is defiantly more complex. However, it allows for easy changes to the environment.
https://github.com/microsoft/vscode-python/blob/main/src/client/api.ts#L150C9-L150C21
https://stackoverflow.com/questions/50058517/how-to-communicate-between-vscode-extensions/50068416#50068416
The text was updated successfully, but these errors were encountered: