Skip to content

Commit

Permalink
Merge pull request #5307 from MarcusDenker/CompletionFallBackGlobals
Browse files Browse the repository at this point in the history
CompletionFallBackGlobals
  • Loading branch information
MarcusDenker committed Dec 5, 2019
2 parents 9d28af3 + ad3100a commit 6a7e3be
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/NECompletion/RBProgramNode.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ Extension { #name : #RBProgramNode }

{ #category : #'*NECompletion' }
RBProgramNode >> completionEntries: offset [
"for now we give all selectors as a fallback, maybe we should add variables, too"
^Symbol selectorTable
"for now we give all selectors and gloabls as a fallback"
| selectors globals |

selectors := Symbol selectorTable
select: [ :each | each beginsWith: (self completionToken: offset)]
thenCollect: [ :each | NECSymbolEntry contents: each node: self ]
thenCollect: [ :each | NECSymbolEntry contents: each node: self ].

globals := Smalltalk globals keys
select: [ :each | each beginsWith: (self completionToken: offset)]
thenCollect: [ :each | NECGlobalEntry contents: each node: self ].

^ selectors , globals

]

Expand Down

0 comments on commit 6a7e3be

Please sign in to comment.