Feature Request
Summary
I love rust (and its formatting!). My single largest formatting pet peeve is the inability to have a blank line as the first line within a function contents. I often find this visually desirable to have that extra break when there are large function signatures with large comments.
More broadly this pattern seems to apply to most curly bracket situations (eg. if statements). Not allowing for this whitespace, to me, makes the code visually more cluttered/harder to read.
(Apologies if this is a dup issue, I couldn't find it directly in my review)
Example
Existing rustfmt only allows for:
/// Try to generate a suggestion using the data in the cache
/// Looks at the previous X characters to see if a completion is cached.
/// If one is found at (x,y) then it checks that the characters typed after (x,y)
/// match up with the cached completion result.
///
/// # Returns
/// - `Some(RenderedSuggestion)` - If a cached completion is found
/// - `None` - If no cached completion is found
pub fn fim_try_hint_inner(
state: Arc<PluginState>,
pos_x: usize,
pos_y: usize,
buffer_handle: u64,
lines: Vec<String>,
) -> LttwResult<()> {
// Get local context
let ctx = get_local_context(&lines, pos_x, pos_y, None, &state.config.read());
state.debug_manager.read().log("fim_try_hint_inner", "");
// Compute primary hash
let primary_hash = format!("{}{}{}{}", ctx.prefix, ctx.middle, "Î", ctx.suffix);
let hash = sha256(&primary_hash);
...
Whereas it would be very nice to allow for:
/// Try to generate a suggestion using the data in the cache
/// Looks at the previous X characters to see if a completion is cached.
/// If one is found at (x,y) then it checks that the characters typed after (x,y)
/// match up with the cached completion result.
///
/// # Returns
/// - `Some(RenderedSuggestion)` - If a cached completion is found
/// - `None` - If no cached completion is found
pub fn fim_try_hint_inner(
state: Arc<PluginState>,
pos_x: usize,
pos_y: usize,
buffer_handle: u64,
lines: Vec<String>,
) -> LttwResult<()> {
// Get local context
let ctx = get_local_context(&lines, pos_x, pos_y, None, &state.config.read());
state.debug_manager.read().log("fim_try_hint_inner", "");
// Compute primary hash
let primary_hash = format!("{}{}{}{}", ctx.prefix, ctx.middle, "Î", ctx.suffix);
let hash = sha256(&primary_hash);
...
Related configuration options
related #4930
Feature Request
Summary
I love rust (and its formatting!). My single largest formatting pet peeve is the inability to have a blank line as the first line within a function contents. I often find this visually desirable to have that extra break when there are large function signatures with large comments.
More broadly this pattern seems to apply to most curly bracket situations (eg. if statements). Not allowing for this whitespace, to me, makes the code visually more cluttered/harder to read.
(Apologies if this is a dup issue, I couldn't find it directly in my review)
Example
Existing rustfmt only allows for:
Whereas it would be very nice to allow for:
Related configuration options
related #4930