Skip to content

Commit

Permalink
Merge pull request #6460 from guillep/fix/6411
Browse files Browse the repository at this point in the history
Fix #6411
  • Loading branch information
Ducasse committed May 29, 2020
2 parents 5a7a9d8 + e4860c6 commit 5ce1230
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/HeuristicCompletion-Model/CoASTResultSetBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ CoASTResultSetBuilder >> visitSuperNode: aRBSuperNode [
^ self visitNode: aRBSuperNode
]

{ #category : #visiting }
CoASTResultSetBuilder >> visitThisContextNode: aRBThisContextNode [

^ self visitNode: aRBThisContextNode
]

{ #category : #visiting }
CoASTResultSetBuilder >> visitVariableNode: aRBVariableNode [

Expand Down
13 changes: 13 additions & 0 deletions src/HeuristicCompletion-Tests/CoASTResultSetBuilderTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@ CoASTResultSetBuilderTest >> testBuildSequenceHeuristic [
self assert: builder heuristic equals: #sequence
]

{ #category : #tests }
CoASTResultSetBuilderTest >> testBuildThisContextHeuristic [

| builder |
builder := CoMockASTResultSetBuilder new.
builder
completionContext: CoCompletionContext new;
node: RBThisContextNode new;
buildCompletion.

self assert: builder heuristic equals: #thisContext
]

{ #category : #tests }
CoASTResultSetBuilderTest >> testBuildVariableHeuristic [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ CoMockASTResultSetBuilder >> visitSequenceNode: aNode [
^ super visitSequenceNode: aNode
]

{ #category : #accessing }
CoMockASTResultSetBuilder >> visitThisContextNode: aNode [

heuristic := #thisContext.
^ super visitThisContextNode: aNode
]

{ #category : #accessing }
CoMockASTResultSetBuilder >> visitVariableNode: aNode [

Expand Down

0 comments on commit 5ce1230

Please sign in to comment.