Closed ngtrunghuan closed 9 months ago
@ngtrunghuan You can set folder b to use the same interpreter as folder A. Just set the black-formatter.interpreter
to the one used by folder A. you can use this to refer to folder A ${workspaceFolder}:A
where A
is the name of the folder A.
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off.
While the workaround with ${workspaceFolder:A}
works, what if I have a multi-root workspace where the black formatter does not make sense for every folder (not every folder is a python project). Then I will have to define a python interpreter for every folder that is part of the multi-root workspace, just to make black formatter work for the one folder where I want to use it.
Could black formatter not only be available for those folders inside a multi-root workspace that provide all the necessary configuration?
@stefanhige You only need to do this if you have different python versions for each workspace root. I general if you have a "Entire Workspace" python, that will be used. You only ever deal with this problem if you explicitly have different pythons per workspace root.
When formatting a file in a folder with a valid interpreter, the extension failed due to the server not starting up. This seemed to be due to one of the folder not having a valid interpreter. The old
black
functionality under thems-python.python
extension however could function well.Reproduction steps:
ms-python.black
ms-python.black
on a file in a folder that has a valid interpreterblack
server failed to startms-python.black
versionv2023.6.0
ms-python.python
versionv2023.21.13101009