Skip to content

Commit

Permalink
get rid of the error msg (#8158)
Browse files Browse the repository at this point in the history
  • Loading branch information
StellaHuang95 authored Feb 5, 2025
1 parent 9e5040e commit 4a82328
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ string[] extraArgs
protected abstract string[] GetToolCommandArgs(string documentFilePath, Range range, string[] extraArgs);

protected virtual async Task<string> RunToolAsync(string interpreterExePath, string documentFilePath, Range range, string[] extraArgs) {
var args = GetToolCommandArgs(documentFilePath, range, extraArgs);

if (args == null) {
return "";
}

var output = ProcessOutput.RunHiddenAndCapture(
interpreterExePath,
System.Text.Encoding.UTF8,
GetToolCommandArgs(documentFilePath, range, extraArgs)
args
);

await output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public PythonFormatterBlack() : base("black", false) { }

protected override string[] GetToolCommandArgs(string documentFilePath, Range range, string[] extraArgs) {
if (range != null) {
throw new PythonFormatterRangeNotSupportedException("Black does not support the Format Selection command.");
return null;
// throw new PythonFormatterRangeNotSupportedException("Black does not support the Format Selection command.");
}

return new[] { "-m", Package, "--diff", documentFilePath };
Expand Down

0 comments on commit 4a82328

Please sign in to comment.