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

[NETBEANS-5317] Autocomplete interferes with multicaret #8042

Open
czukowski opened this issue Dec 12, 2024 · 0 comments
Open

[NETBEANS-5317] Autocomplete interferes with multicaret #8042

czukowski opened this issue Dec 12, 2024 · 0 comments
Labels
Editor kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@czukowski
Copy link
Contributor

Apache NetBeans version

Apache NetBeans 23

What happened

Whenever code complete suggestions show up while multicaret is used, the edited code is broken, see examples below.

This issue was originally reported in Jira and, I guess, overlooked during the migration to Github Issues: https://issues.apache.org/jira/browse/NETBEANS-5317

Language / Project Type / NetBeans Component

Editor

How to reproduce

Example 1:

<?php
class Test
{
	FOO = 1
	BAR = 2
	BAZ = 3
//	🡤 place caret to each of the 3 lines directly above here. The intention here is to add 'const' keywords.
}

Type 'c', wait for the suggestions and then type 'o'. The result will be:

	cBAZo = 1
	coBAZ = 2
	coBAZ = 3

Undo, then type 'c', and then accept the 'const' suggestion:

	const BAZ = 1
	const BAZ = 2
	const BAZ = 3

Undo again and attempt to avoid the issue by avoiding the invocation of code completion: type space, then move cursor one character to the left and then type 'const'. If instead of entering 'const', a suggestion is accepted, the code gets some extra spaces, although the names remain intact:

	const  FOO = 1
	const  BAR = 2
	const BAZ = 3

Example 2 (provided by @junichi11):

In a java file, code is broken:

public final class Example {
    // ^ is caret
     ^test1;
     ^test2;
     ^test3;
}
  1. type p
  2. run code completion ([Ctrl] + [Space])
  3. select private
  4. the result is following
public final class Example {
    // ^ is caret
    private test3^;
    private test3^;
    private ^test3;
}

It seems that this occurs when code completion is run.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 11

JDK

OpenJDK 64-Bit Server VM 22+36-2370

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

There are many ways to reproduce the issue, including code completion for class properties, etc.

Are you willing to submit a pull request?

No

@czukowski czukowski added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Dec 12, 2024
@mbien mbien added the Editor label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Editor kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

2 participants