-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JSDoc, VariableStatement, Accessor is[GS]etter:
- Loading branch information
1 parent
64d1393
commit 84c30f4
Showing
6 changed files
with
120 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Famix-TypeScript-Entities/FamixTypeScriptJSDoc.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
" | ||
I represent a TypeScript (JavaScript) Doc element. | ||
" | ||
Class { | ||
#name : #FamixTypeScriptJSDoc, | ||
#superclass : #FamixTypeScriptSourcedEntity, | ||
#category : #'Famix-TypeScript-Entities-Entities' | ||
} | ||
|
||
{ #category : #meta } | ||
FamixTypeScriptJSDoc class >> annotation [ | ||
|
||
<FMClass: #JSDoc super: #FamixTypeScriptSourcedEntity> | ||
<package: #FamixTypeScript> | ||
<generated> | ||
^ self | ||
] |
17 changes: 17 additions & 0 deletions
17
src/Famix-TypeScript-Entities/FamixTypeScriptVariableStatement.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
" | ||
I represent a TypeScript variable statement. | ||
" | ||
Class { | ||
#name : #FamixTypeScriptVariableStatement, | ||
#superclass : #FamixTypeScriptType, | ||
#category : #'Famix-TypeScript-Entities-Entities' | ||
} | ||
|
||
{ #category : #meta } | ||
FamixTypeScriptVariableStatement class >> annotation [ | ||
|
||
<FMClass: #VariableStatement super: #FamixTypeScriptType> | ||
<package: #FamixTypeScript> | ||
<generated> | ||
^ self | ||
] |
17 changes: 17 additions & 0 deletions
17
src/Famix-TypeScript-Extensions/FamixTHasKind.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Extension { #name : #FamixTHasKind } | ||
|
||
{ #category : #'*Famix-TypeScript-Extensions' } | ||
FamixTHasKind >> isGetter: aBoolean [ | ||
|
||
aBoolean | ||
ifTrue: [ self beGetter ] | ||
ifFalse: [ self isGetter ifTrue: [ self kind: nil ] ] | ||
] | ||
|
||
{ #category : #'*Famix-TypeScript-Extensions' } | ||
FamixTHasKind >> isSetter: aBoolean [ | ||
|
||
aBoolean | ||
ifTrue: [ self beSetter ] | ||
ifFalse: [ self isSetter ifTrue: [ self kind: nil ] ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/Famix-TypeScript-Tests/FamixTypeScriptAccessorTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Class { | ||
#name : #FamixTypeScriptAccessorTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'setterAccessor', | ||
'getterAccessor' | ||
], | ||
#category : #'Famix-TypeScript-Tests' | ||
} | ||
|
||
{ #category : #initialization } | ||
FamixTypeScriptAccessorTest >> setUp [ | ||
super setUp. | ||
setterAccessor := FamixTypeScriptMethod new. | ||
setterAccessor beSetter. | ||
getterAccessor := FamixTypeScriptMethod new. | ||
getterAccessor beGetter. | ||
|
||
] | ||
|
||
{ #category : #tests } | ||
FamixTypeScriptAccessorTest >> testIsGetter [ | ||
self assert: getterAccessor isGetter. | ||
self deny: setterAccessor isGetter. | ||
] | ||
|
||
{ #category : #tests } | ||
FamixTypeScriptAccessorTest >> testIsSetter [ | ||
self assert: setterAccessor isSetter. | ||
self deny: getterAccessor isSetter. | ||
] |