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

Error when use gr to rename #1306

Closed
3 tasks done
ayamir opened this issue Jun 24, 2024 · 8 comments
Closed
3 tasks done

Error when use gr to rename #1306

ayamir opened this issue Jun 24, 2024 · 8 comments
Labels
bug Something isn't working cmp Nvim-cmp related issues has:repro This issue contains reproducing steps

Comments

@ayamir
Copy link
Owner

ayamir commented Jun 24, 2024

Version confirmation

  • Confirm

Following prerequisites

  • Confirm

Not a user config issue

  • Confirm

Neovim version

NVIM v0.10.0

Operating system/version

macOS 14.5 (23F79)

Terminal name/version

kitty

$TERM environment variable

No response

Branch info

0.10 (Nightly)

Fetch Preferences

SSH (use_ssh = true)

How to reproduce the issue

Trying to rename a function that appears in different files.

Expected behavior

No error

Actual behavior

image

Additional information

No response

@ayamir ayamir added the bug Something isn't working label Jun 24, 2024
@ayamir
Copy link
Owner Author

ayamir commented Jun 24, 2024

It has to do with ghost_text introduced in #733.

@Jint-lzxy Jint-lzxy added needs:repro We need more details to reproduce this problem cmp Nvim-cmp related issues labels Jun 24, 2024
@Jint-lzxy
Copy link
Collaborator

@ayamir Did u mean gr or gR (uppercase)? Tho I can't seem to reproduce this using either of them on my end, maybe u could upload the document in question so that things could be easier to understand?

@ayamir
Copy link
Owner Author

ayamir commented Jun 24, 2024

I'm coding for my company so the files are business secrets. But I can also reproduce this error on other files.

2024-06-24-22-02-07.mp4
package main

import (
	"fmt"
	"net"
	"sync"
	"time"
)

const (
	MAX_CONN = 10
)

func main() {
	var wg sync.WaitGroup
	wg.Add(1)
	for i := 0; i < MAX_CONN; i++ {
		go Conn("127.0.0.1:8089", i)
		time.Sleep(time.Millisecond * 100)
	}
	wg.Wait()
}

func Conn(addr string, id int) {
	conn, err := net.Dial("tcp", addr)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println("connect ", id)
	go func() {
		buf := make([]byte, 1024)
		for {
			n, err := conn.Read(buf)
			if err != nil {
				break
			}
			fmt.Println(id, "read: ", string(buf[:n]))
		}
	}()
	time.Sleep(time.Second * 1)
	for {
		_, err := conn.Write([]byte("hello"))
		if err != nil {
			break
		}
		time.Sleep(time.Second * 10)
	}
}

@Jint-lzxy
Copy link
Collaborator

At first glance it seems like there's something odd happening with lspsaga (not cmp iiuc)... I'm not entirely sure about it, but it could be a good starting point tho.

@ayamir
Copy link
Owner Author

ayamir commented Jun 25, 2024

This issue can be stably reproduced for the above file. The only method to eliminate the errors is quitting nvim completely. Currently my workaround is just disable ghost_text.

@ayamir
Copy link
Owner Author

ayamir commented Jun 25, 2024

Maybe we can use https://github.com/smjonas/inc-rename.nvim to do rename. I prefer this style and has used it for my own config.

@Jint-lzxy Jint-lzxy added has:repro This issue contains reproducing steps and removed needs:repro We need more details to reproduce this problem labels Jun 26, 2024
@Jint-lzxy
Copy link
Collaborator

This issue can be stably reproduced for the above file. The only method to eliminate the errors is quitting nvim completely. Currently my workaround is just disable ghost_text.

@ayamir I think I saw the cmp popup being visible in the Rename window, right? If this is true then this issue should be expected if u didn't use <C-w> to abort cmp. Shall we disable cmp in the Rename window, or report it upstream?

@Jint-lzxy
Copy link
Collaborator

I think this issue is resolved with the changes made in this commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmp Nvim-cmp related issues has:repro This issue contains reproducing steps
Projects
None yet
Development

No branches or pull requests

2 participants