Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/NECompletion-Preferences/NECPreferences.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ NECPreferences class >> settingsOn: aBuilder [
label: 'Case Sensitive';
default: true;
description: 'Decide if you want eCompletion to be case sensitive or not.'.
(aBuilder setting: #expandPrefixes)
label: 'Expand inferred package prefixes';
default: true;
description: 'Allow suffix-only matching such as Pre -> SpPresenter when a package prefix is implied.'.
(aBuilder setting: #smartCharacters)
label: 'Smart Characters';
default: true;
Expand Down
6 changes: 6 additions & 0 deletions src/NECompletion/NECEntry.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ NECEntry >> browse [
self subclassResponsibility
]

{ #category : 'matching' }
NECEntry >> completionMatchText [

^ self contents
]

{ #category : 'accessing' }
NECEntry >> contents [
^ contents
Expand Down
44 changes: 44 additions & 0 deletions src/NECompletion/NECPrefixExpandableGlobalEntry.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Class {
#name : 'NECPrefixExpandableGlobalEntry',
#superclass : 'NECGlobalEntry',
#instVars : [
'implicitPrefix'
],
#category : 'NECompletion-Model',
#package : 'NECompletion',
#tag : 'Model'
}

{ #category : 'as yet unclassified' }
NECPrefixExpandableGlobalEntry class >> contents: aString node: aNode implicitPrefix: aPrefix [

^ self new
contents: aString node: aNode;
implicitPrefix: aPrefix;
yourself
]

{ #category : 'matching' }
NECPrefixExpandableGlobalEntry >> completionMatchText [

(NECPreferences expandPrefixes
and: [ implicitPrefix isNotNil
and: [ implicitPrefix notEmpty
and: [ self contents size > implicitPrefix size
and: [ self contents beginsWith: implicitPrefix ] ] ] ])
ifTrue: [ ^ self contents allButFirst: implicitPrefix size ].

^ super completionMatchText
]

{ #category : 'matching' }
NECPrefixExpandableGlobalEntry >> implicitPrefix [

^ implicitPrefix
]

{ #category : 'matching' }
NECPrefixExpandableGlobalEntry >> implicitPrefix: aString [

implicitPrefix := aString
]