rust-lang / rust-lang/rust-analyzer

Auto action to remove uneccessary parenthesis on triple tuple does not work

Open
#17,005 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-cargo A-diagnostics C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: rust-analyzer 1.78.0-nightly (2d24fe5 2024-03-09)
rustc version: rustc 1.76.0 (07dca489a 2024-02-04)
editor or extension: Helix
relevant settings:
.bashrc:

#
# ~/.bashrc
#

[[ $- != *i* ]] && return

alias ls='ls --color=auto'
alias ivm='gvim -v'
alias vim='gvim -v'
alias clipboard='xclip -selection clipboard'
alias hx='helix'
alias less='less -f' 
PS1='[\u@\h \W]\$ '

function cd_up() {
  cd $(printf "%0.s../" $(seq 1 $1 ));
}
alias 'cd..'='cd_up'

#SFML stuff
SFML_INCLUDE_DIR=/usr/local/./include
SFML_LIBS_DIR=/usr/local/lib

# RUST stuff
alias cargo_small_check='cargo check --message-format short'
#export PATH=/home/dogunbound/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export PATH=/home/dogunbound/.rust-extras:$PATH

export EDITOR=vim

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

[ -f ~/.fzf.bash ] && source ~/.fzf.bash
bash $HOME/.cargo/env

# C stuff
export CPATH=/usr/include/SFML:$CPATH
export CPATH=/usr/local/include/SFML:$CPATH
export CPATH=/usr/local/include/:$CPATH
export CPATH=$HOME/SFML/CSFML/include/:$CPATH
export CPATH=$HOME/SFML/CSFML/src/:$CPATH
export CPATH=$HOME/SFML/SFML/include/:$CPATH
export CPATH=$HOME/SFML/SFML/src/:$CPATH

. "$HOME/.cargo/env"

.profile:

. "$HOME/.cargo/env"

Relevant link: Original ticket made on helix here
code snippet to reproduce:

fn helix_bug() -> ((i32), (i32), (i32)) {
    todo!()
}

fn main() {}

Video demonstrating incorrect behavior in helix:
https://github.com/rust-lang/rust-analyzer/assets/64436119/b3b8522a-dcde-421f-ba57-a60f5ad9079a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with the minimal Rust snippet and compare it with the Helix ticket linked in the issue. The work is done when the auto action correctly removes unnecessary parentheses in the triple-tuple return type without producing incorrect edits.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.