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
{{ message }}
Repository navigation
Support stdin + stdout formatting with external formatters #15393
Possibly give {file_path} as an optional injection that the external command could use, like the user would set the command to be thing format --stdin-filepath {file_path}
Think about where the command is run from - the project directory or the file path directory? This is relevant for lookup of a configuration file. I think if --stdin-filepath {file_path} is provided then configuration file lookup would start from {file_path} and look upwards from there. But if just thing format - is provided then we'd start from the current directory that the formatter is launched from
Its possible that range formatting could "just work" with this stdin/stdout approach, where RStudio only streams a segment of the file over stdin (not sure if that would conflict with line length configuration settings though, its possible that the right way to do it is to provide both the entire file and a range within that file to format, so the formatter has access to everything)
Activity
DavisVaughan commentedon Nov 1, 2024
Few more thoughts:
{file_path}as an optional injection that the external command could use, like the user would set the command to bething format --stdin-filepath {file_path}--stdin-filepath {file_path}is provided then configuration file lookup would start from{file_path}and look upwards from there. But if justthing format -is provided then we'd start from the current directory that the formatter is launched fromZed has a nice section on external formatters to pull ideas like these from https://zed.dev/docs/configuring-zed#formatter