SmallSense__CompletionContext.st
changeset 108 71471dc81e77
child 132 7c23c51d2cfd
equal deleted inserted replaced
107:abe4dc4fe5ca 108:71471dc81e77
       
     1 "{ Package: 'jv:smallsense' }"
       
     2 
       
     3 "{ NameSpace: SmallSense }"
       
     4 
       
     5 Object subclass:#CompletionContext
       
     6 	instanceVariableNames:'node position position1'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'SmallSense-Core'
       
    10 !
       
    11 
       
    12 
       
    13 !CompletionContext class methodsFor:'instance creation'!
       
    14 
       
    15 node: node position: position
       
    16 
       
    17     ^self new node: node position: position
       
    18 
       
    19     "Created: / 26-11-2011 / 16:22:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    20 ! !
       
    21 
       
    22 !CompletionContext methodsFor:'accessing'!
       
    23 
       
    24 node
       
    25     ^ node
       
    26 !
       
    27 
       
    28 position
       
    29     ^ position
       
    30 ! !
       
    31 
       
    32 !CompletionContext methodsFor:'initialization'!
       
    33 
       
    34 node:nd position: pos
       
    35 
       
    36     node := nd.
       
    37     position := pos.
       
    38     position1 := pos - 1
       
    39 
       
    40     "Created: / 26-11-2011 / 16:22:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    41 ! !
       
    42 
       
    43 !CompletionContext methodsFor:'queries'!
       
    44 
       
    45 isAfterNode
       
    46     ^ node notNil and:[node endPosition < position1]
       
    47 
       
    48     "Created: / 26-11-2011 / 16:24:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    49     "Modified: / 24-09-2013 / 13:11:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    50 !
       
    51 
       
    52 isBeforeNode
       
    53     ^node notNil and:[position < node startPosition]
       
    54 
       
    55     "Created: / 26-11-2011 / 16:24:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    56     "Modified: / 24-09-2013 / 13:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    57 !
       
    58 
       
    59 isInNode
       
    60     ^ node notNil and:[position1 between:node startPosition and:node endPosition]
       
    61 
       
    62     "Created: / 26-11-2011 / 16:24:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    63     "Modified: / 24-09-2013 / 13:12:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    64 ! !
       
    65 
       
    66 !CompletionContext class methodsFor:'documentation'!
       
    67 
       
    68 version_HG
       
    69 
       
    70     ^ '$Changeset: <not expanded> $'
       
    71 !
       
    72 
       
    73 version_SVN
       
    74     ^ '$Id: SmallSensePosition.st 7823 2011-11-26 16:55:59Z vranyj1 $'
       
    75 ! !
       
    76