Skip to content
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

health - add formatter to display #7986

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion helix-term/src/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub fn languages_all() -> std::io::Result<()> {
}
};

let mut headings = vec!["Language", "LSP", "DAP"];
let mut headings = vec!["Language", "LSP", "DAP", "Formatter"];

for feat in TsFeature::all() {
headings.push(feat.short_title())
Expand Down Expand Up @@ -205,6 +205,12 @@ pub fn languages_all() -> std::io::Result<()> {
let dap = lang.debugger.as_ref().map(|dap| dap.command.to_string());
check_binary(dap);

let formatter = lang
.formatter
.as_ref()
.map(|formatter| formatter.command.to_string());
check_binary(formatter);

for ts_feat in TsFeature::all() {
match load_runtime_file(&lang.language_id, ts_feat.runtime_filename()).is_ok() {
true => column("✓", Color::Green),
Expand Down Expand Up @@ -279,6 +285,13 @@ pub fn language(lang_str: String) -> std::io::Result<()> {
}),
)?;

probe_protocol(
"formatter",
lang.formatter
.as_ref()
.map(|formatter| formatter.command.to_string()),
)?;
Comment on lines +294 to +299
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this after the debug adapter so the order matches the overall --health display

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing @the-mikedavis , just pushed to move this as you have suggested.

Configured language server: pylsp
Binary for language server: /opt/homebrew/bin/pylsp
Configured debug adapter: None
Configured formatter: black
Binary for formatter: /opt/homebrew/bin/black
Highlight queries: ✓
Textobject queries: ✓


probe_protocol(
"debug adapter",
lang.debugger.as_ref().map(|dap| dap.command.to_string()),
Expand Down
Loading