Christoph Thiede uploaded a new version of OcompletionSqueakCompatibility to project The Inbox: http://source.squeak.org/inbox/OcompletionSqueakCompatibility-ct.4.mcz
==================== Summary ====================
Name: OcompletionSqueakCompatibility-ct.4 Author: ct Time: 2 January 2024, 4:40:36.322236 pm UUID: e60e2311-1c14-4448-bc06-8966a8da2c36 Ancestors: OcompletionSqueakCompatibility-JohnMcKeon.3
Fixes unloading of OCompletion.
==================== Snapshot ====================
SystemOrganization addCategory: #OcompletionSqueakCompatibility!
StandardToolSet subclass: #ECToolSet instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OcompletionSqueakCompatibility'!
----- Method: ECToolSet class>>codeCompletionAround:textMorph:keyStroke: (in category 'completion') ----- codeCompletionAround: aBlock textMorph: aTextMorph keyStroke: evt | completionAllowed editor stringHolder | editor := aTextMorph editor. stringHolder := editor ifNotNil: [editor model].
completionAllowed := ECPreferences enabled and:[ ECController allowModel: stringHolder ]. completionAllowed ifTrue: [(stringHolder completionController handleKeystrokeBefore: evt editor: editor) ifTrue: [^ self]]. aBlock value. "sends to keyStroke event handler, if any" "Narrow the completion with any of the keys" completionAllowed ifTrue: [stringHolder completionController handleKeystrokeAfter: evt editor: editor]!
----- Method: ECToolSet class>>register (in category 'initialize-release') ----- register "Asks the system to use me when launching completion" ToolSet register: self!
----- Method: ECToolSet class>>unload (in category 'initialize-release') ----- unload
self unregister.!
----- Method: ECToolSet class>>unregister (in category 'initialize-release') ----- unregister ToolSet unregister: self!
----- Method: SmalltalkEditor>>isCaretBehindChar (in category '*OcompletionSqueakCompatibility') ----- isCaretBehindChar "Return true if the cursor position is after an alphanumeric character, otherwise false."
| cursorPosition | ^(cursorPosition := self startIndex) >= 2 and: [ (self text at: cursorPosition - 1) isAlphaNumeric ]!
----- Method: SmalltalkEditor>>selectionPosition: (in category '*OcompletionSqueakCompatibility') ----- selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. topLeft := self morph owner submorphBounds topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]!
----- Method: SmalltalkEditor>>wordAtCaret (in category '*OcompletionSqueakCompatibility') ----- wordAtCaret ^paragraph text asString wordBefore: self startIndex - 1 !
----- Method: ParagraphEditor>>isCaretBehindChar (in category '*OcompletionSqueakCompatibility') ----- isCaretBehindChar "Return true if the cursor position is after an alphanumeric character, otherwise false."
| cursorPosition | ^(cursorPosition := self startIndex) >= 2 and: [ (self text at: cursorPosition - 1) isAlphaNumeric ]!
----- Method: ParagraphEditor>>selectionPosition: (in category '*OcompletionSqueakCompatibility') ----- selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. topLeft := self morph owner submorphBounds topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]!
----- Method: ParagraphEditor>>wordAtCaret (in category '*OcompletionSqueakCompatibility') ----- wordAtCaret ^paragraph text asString wordBefore: self startIndex - 1 !
Fixes unloading of OCompletion.
How? What was the problem? What's you approach to fix it?
Best, Marcel
Am 02.01.2024 16:42:40 schrieb commits@source.squeak.org commits@source.squeak.org:
Christoph Thiede uploaded a new version of OcompletionSqueakCompatibility to project The Inbox: http://source.squeak.org/inbox/OcompletionSqueakCompatibility-ct.4.mcz
==================== Summary ====================
Name: OcompletionSqueakCompatibility-ct.4 Author: ct Time: 2 January 2024, 4:40:36.322236 pm UUID: e60e2311-1c14-4448-bc06-8966a8da2c36 Ancestors: OcompletionSqueakCompatibility-JohnMcKeon.3
Fixes unloading of OCompletion.
==================== Snapshot ====================
SystemOrganization addCategory: #OcompletionSqueakCompatibility!
StandardToolSet subclass: #ECToolSet instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OcompletionSqueakCompatibility'!
----- Method: ECToolSet class>>codeCompletionAround:textMorph:keyStroke: (in category 'completion') ----- codeCompletionAround: aBlock textMorph: aTextMorph keyStroke: evt | completionAllowed editor stringHolder |
editor := aTextMorph editor. stringHolder := editor ifNotNil: [editor model].
completionAllowed := ECPreferences enabled and:[ ECController allowModel: stringHolder ]. completionAllowed ifTrue: [(stringHolder completionController handleKeystrokeBefore: evt editor: editor) ifTrue: [^ self]]. aBlock value. "sends to keyStroke event handler, if any" "Narrow the completion with any of the keys" completionAllowed ifTrue: [stringHolder completionController handleKeystrokeAfter: evt editor: editor]!
----- Method: ECToolSet class>>register (in category 'initialize-release') ----- register "Asks the system to use me when launching completion" ToolSet register: self!
----- Method: ECToolSet class>>unload (in category 'initialize-release') ----- unload
self unregister.!
----- Method: ECToolSet class>>unregister (in category 'initialize-release') ----- unregister ToolSet unregister: self!
----- Method: SmalltalkEditor>>isCaretBehindChar (in category '*OcompletionSqueakCompatibility') ----- isCaretBehindChar "Return true if the cursor position is after an alphanumeric character, otherwise false."
| cursorPosition | ^(cursorPosition := self startIndex) >= 2 and: [ (self text at: cursorPosition - 1) isAlphaNumeric ]!
----- Method: SmalltalkEditor>>selectionPosition: (in category '*OcompletionSqueakCompatibility') ----- selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. topLeft := self morph owner submorphBounds topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]!
----- Method: SmalltalkEditor>>wordAtCaret (in category '*OcompletionSqueakCompatibility') ----- wordAtCaret ^paragraph text asString wordBefore: self startIndex - 1 !
----- Method: ParagraphEditor>>isCaretBehindChar (in category '*OcompletionSqueakCompatibility') ----- isCaretBehindChar "Return true if the cursor position is after an alphanumeric character, otherwise false."
| cursorPosition | ^(cursorPosition := self startIndex) >= 2 and: [ (self text at: cursorPosition - 1) isAlphaNumeric ]!
----- Method: ParagraphEditor>>selectionPosition: (in category '*OcompletionSqueakCompatibility') ----- selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. topLeft := self morph owner submorphBounds topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]!
----- Method: ParagraphEditor>>wordAtCaret (in category '*OcompletionSqueakCompatibility') ----- wordAtCaret ^paragraph text asString wordBefore: self startIndex - 1 !
squeak-dev@lists.squeakfoundation.org