pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.17k stars 348 forks source link

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

Open ericwinger opened 1 week ago

ericwinger commented 1 week ago

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

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:

I didn't investigate further.

jecisc commented 1 week ago

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 commented 1 week ago

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)