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

Code completion will intermingle code completion with following, non-selected characters if no blank #16796

Open
ericwinger opened this issue Jun 21, 2024 · 2 comments

Comments

@ericwinger
Copy link

Bug description
Code completion will complete with completion characters intermixed with following, non-selected characters if there is no blank before the existing characters.

To Reproduce
Steps to reproduce the behavior:

  1. In a virgin image, open a source editor or a playground, highlight some text with a non-blank character immediately trailing the selection.
    image

  2. Start typing new characters replacing the old characters until a code completion pop-up appears.
    image

  3. Choose the first code completion option.

  4. Result is intermingled text
    image

Expected behavior
Code completion behavior should not intermingle the code completion and the existing characters.

Screenshots
See above

Version information:

Pharo 11.0.0
Build information: Pharo-11.0.0+build.714.sha.0ead11d0b8573ff685db8a39fceeca2a8d528d3e (64 Bit)

Expected development cost

  • It may be worth searching open code completion issues for a duplicate. I searched but couldn't find an exact match.
  • Costs include duplicated effort retyping code often for the user.
  • Other costs unknown.

Additional context
Code completion is pretty handy, but this bug slows down development.
NECPreferences spaceAfterCompletion = true in the above example
There seem to be some problems in this method: CompletionEngine>>#replaceTokenInEditorWith: such as:

  • self editor selectInvisiblyFrom: wordStart to: wordEnd - 1. does make a visible selection
  • which appears to impact the following statement: old := self editor selection.

I didn't investigate further.

@jecisc
Copy link
Member

jecisc commented Jun 21, 2024

Hi,
Pharo code completion has been improved in Pharo 12. I think what you reported has been fixed. Could you check if everything work right in P12 or 13?

@ericwinger
Copy link
Author

Thanks for responding so quickly!

The behavior is different in Pharo 12, but it is still not correct. Now the following character(s?) are replaced. Here's an example.

  1. Select text up to colon
    image
  2. Type until auto complete. See snazzy new behavior dialog. Choose selection.
    image
  3. Replaces following colon
    image
Pharo 12.0.0
Build information: Pharo-12.0.0+SNAPSHOT.build.1516.sha.25ecf718d4a363b275862b4a093b1a240ec7e8d2 (64 Bit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants