A better IDE
This commit is contained in:
@@ -21,6 +21,11 @@ CarpExpressionNode >> isDefinition [
|
|||||||
^ false
|
^ false
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
CarpExpressionNode >> isDefinitionPredicate [
|
||||||
|
^ false
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
CarpExpressionNode >> isQuoted [
|
CarpExpressionNode >> isQuoted [
|
||||||
^ parent ifNil: [ false ] ifNotNil: [ parent isQuoted ]
|
^ parent ifNil: [ false ] ifNotNil: [ parent isQuoted ]
|
||||||
|
@@ -51,8 +51,18 @@ CarpListNode >> initialize [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
CarpListNode >> intoModel [
|
CarpListNode >> intoModel [
|
||||||
^ CarpList
|
^ self isDefinition
|
||||||
contents: (expressions collect: #intoModel)
|
ifTrue: [ | binding |
|
||||||
|
binding := (CarpBinding perform: self expressions first value source asSymbol)
|
||||||
|
name: self definitionVariable intoModel.
|
||||||
|
self expressions size = 3
|
||||||
|
ifTrue: [ binding binding: self expressions third intoModel ].
|
||||||
|
self expressions size = 4
|
||||||
|
ifTrue: [ binding
|
||||||
|
arguments: self expressions third intoModel;
|
||||||
|
body: self expressions fourth intoModel ].
|
||||||
|
binding ]
|
||||||
|
ifFalse: [ CarpList contents: (expressions collect: #intoModel) ]
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
@@ -7,6 +7,31 @@ Class {
|
|||||||
#category : #'Carp-IDE'
|
#category : #'Carp-IDE'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ #category : #'instance creation' }
|
||||||
|
CarpBinding class >> def [
|
||||||
|
^ CarpStaticVariable new
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #'instance creation' }
|
||||||
|
CarpBinding class >> defdynamic [
|
||||||
|
^ CarpDynamicVariable new
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #'instance creation' }
|
||||||
|
CarpBinding class >> defmacro [
|
||||||
|
^ CarpMacro new
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #'instance creation' }
|
||||||
|
CarpBinding class >> defn [
|
||||||
|
^ CarpStaticFunction new
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #'instance creation' }
|
||||||
|
CarpBinding class >> defndynamic [
|
||||||
|
^ CarpDynamicFunction new
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
CarpBinding >> bindingName [
|
CarpBinding >> bindingName [
|
||||||
^ self subclassResponsibility
|
^ self subclassResponsibility
|
||||||
|
@@ -14,9 +14,13 @@ CarpExpression >> asElement [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
CarpExpression >> asElementWithModule: aModule [
|
CarpExpression >> asElementWithModule: aModule [
|
||||||
^ ((GtCarpIDECoderModel code: self toCarp)
|
| applicationStrategy |
|
||||||
module: aModule;
|
applicationStrategy := LeCarpApplicationStrategy new.
|
||||||
expression: self) asElement
|
^ (GtExpandableSourceCoderElement new
|
||||||
|
coderViewModel: ((GtCarpIDECoderModel code: self toCarp)
|
||||||
|
module: aModule;
|
||||||
|
carpLinkApplicationStrategy: applicationStrategy;
|
||||||
|
expression: self) asCoderViewModel) collapse
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
@@ -84,6 +84,7 @@ CarpModule >> carpCoderStreamingMethodsFor: aView context: aPhlowContext [
|
|||||||
ifNotNil: [ :aContents | aNewMethodCoderViewModel := aContents ]
|
ifNotNil: [ :aContents | aNewMethodCoderViewModel := aContents ]
|
||||||
ifNil: [ aNewMethodCoder := GtCarpNewFunctionCoderModel new
|
ifNil: [ aNewMethodCoder := GtCarpNewFunctionCoderModel new
|
||||||
module: self;
|
module: self;
|
||||||
|
carpLinkApplicationStrategy: LeCarpApplicationStrategy new;
|
||||||
onSave: [ aButton fireEvent: BrDropdownHideWish new.
|
onSave: [ aButton fireEvent: BrDropdownHideWish new.
|
||||||
coderElement initializeForModule ].
|
coderElement initializeForModule ].
|
||||||
|
|
||||||
|
@@ -12,6 +12,18 @@ Class {
|
|||||||
#category : #'Carp-Coder'
|
#category : #'Carp-Coder'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
CarpModuleCoderElement >> build [
|
||||||
|
| application commandFactory |
|
||||||
|
application := CarpApplication uniqueInstance.
|
||||||
|
application isRunning ifFalse: [ application start ].
|
||||||
|
commandFactory := application newCommandFactory.
|
||||||
|
|
||||||
|
^ commandFactory
|
||||||
|
<< self module toCarp;
|
||||||
|
sendAndWait
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
CarpModuleCoderElement >> buildContentPane [
|
CarpModuleCoderElement >> buildContentPane [
|
||||||
|
|
||||||
@@ -91,6 +103,13 @@ CarpModuleCoderElement >> buildModuleLabel [
|
|||||||
action: [ :aButton |
|
action: [ :aButton |
|
||||||
aButton phlow spawnObject: self module toCarp ]).
|
aButton phlow spawnObject: self module toCarp ]).
|
||||||
|
|
||||||
|
aContainer addChild: (BrButton new
|
||||||
|
aptitude: BrGlamorousButtonWithIconAptitude;
|
||||||
|
icon: BrGlamorousVectorIcons refresh;
|
||||||
|
beSmallSize;
|
||||||
|
label: 'Build';
|
||||||
|
action: [ self build ]).
|
||||||
|
|
||||||
^ aContainer
|
^ aContainer
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -133,7 +152,8 @@ CarpModuleCoderElement >> coderViewModel: aCarpCoderViewModel [
|
|||||||
|
|
||||||
container ifNotNil: #removeFromParent.
|
container ifNotNil: #removeFromParent.
|
||||||
container := self buildContentPane.
|
container := self buildContentPane.
|
||||||
self addChildFirst: container
|
self addChildFirst: container.
|
||||||
|
self build
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
@@ -23,6 +23,11 @@ CarpSequence >> contents: aCollection [
|
|||||||
contents := aCollection
|
contents := aCollection
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
CarpSequence >> do: aBlock [
|
||||||
|
contents do: aBlock
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
CarpSequence >> open [
|
CarpSequence >> open [
|
||||||
^ self subclassResponsibility
|
^ self subclassResponsibility
|
||||||
|
@@ -12,6 +12,11 @@ CarpSymbol class >> named: aString [
|
|||||||
^ self new name: aString
|
^ self new name: aString
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
CarpSymbol >> name [
|
||||||
|
^ name
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
CarpSymbol >> name: aString [
|
CarpSymbol >> name: aString [
|
||||||
name := aString
|
name := aString
|
||||||
|
@@ -7,6 +7,12 @@ Class {
|
|||||||
#category : #'Carp-Coder'
|
#category : #'Carp-Coder'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
GtCarpIDECoderModel >> collapsedTextPromise [
|
||||||
|
^ self expression name name , ' : '
|
||||||
|
, (self bindAndExecute: '(type ' , module name, '.', self expression name name , ')') value
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
GtCarpIDECoderModel >> expression [
|
GtCarpIDECoderModel >> expression [
|
||||||
^ expression
|
^ expression
|
||||||
@@ -30,7 +36,8 @@ GtCarpIDECoderModel >> initializeAddOns: addOns [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
GtCarpIDECoderModel >> remove [
|
GtCarpIDECoderModel >> remove [
|
||||||
^ module removeExpression: self expression
|
module removeExpression: self expression.
|
||||||
|
self bindAndExecute: module toCarp
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@@ -38,5 +45,6 @@ GtCarpIDECoderModel >> save [
|
|||||||
module removeExpression: expression.
|
module removeExpression: expression.
|
||||||
module
|
module
|
||||||
addExpression: (CarpParser parse: sourceCode availableSource text) intoModel.
|
addExpression: (CarpParser parse: sourceCode availableSource text) intoModel.
|
||||||
|
self bindAndExecute: module toCarp.
|
||||||
onSave ifNotNil: [ onSave value ]
|
onSave ifNotNil: [ onSave value ]
|
||||||
]
|
]
|
||||||
|
@@ -10,14 +10,11 @@ Class {
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
GtCarpNewFunctionCoderModel >> initializeAddOns: addOns [
|
GtCarpNewFunctionCoderModel >> initializeAddOns: addOns [
|
||||||
super initializeAddOns: addOns.
|
|
||||||
|
|
||||||
addOns
|
addOns
|
||||||
addMainAction: 'Save' translated
|
addMainAction: 'Save' translated
|
||||||
icon: BrGlamorousVectorIcons accept
|
icon: BrGlamorousVectorIcons accept
|
||||||
action: [ :aCoderUIModel :anElement |
|
action: [ :aCoderUIModel :anElement | self save ]
|
||||||
self save ]
|
id: GtMethodCoderSaveActionId
|
||||||
id: GtMethodCoderSaveActionId.
|
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #coders }
|
{ #category : #coders }
|
||||||
@@ -32,6 +29,9 @@ GtCarpNewFunctionCoderModel >> onSave: aBlock [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
GtCarpNewFunctionCoderModel >> save [
|
GtCarpNewFunctionCoderModel >> save [
|
||||||
module addExpression: (CarpParser parse: sourceCode currentSourceText value text) intoModel.
|
| expression |
|
||||||
|
expression := (CarpParser parse: sourceCode currentSourceText value text) intoModel.
|
||||||
|
module addExpression: expression.
|
||||||
|
self bindAndExecute: module toCarp.
|
||||||
onSave ifNotNil: [ onSave value ]
|
onSave ifNotNil: [ onSave value ]
|
||||||
]
|
]
|
||||||
|
@@ -13,9 +13,8 @@ LeCarpApplicationStrategy class >> strategyName [
|
|||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
LeCarpApplicationStrategy >> applicationServer [
|
LeCarpApplicationStrategy >> applicationServer [
|
||||||
|
|
||||||
content database isDatabase ifFalse: [ ^ nil ].
|
|
||||||
CarpApplication uniqueInstance ifNil:
|
CarpApplication uniqueInstance ifNil:
|
||||||
[ CarpApplication uniqueInstance: (self newCarpApplicationFor: content database) ].
|
[ CarpApplication uniqueInstance: self newCarpApplication ].
|
||||||
^ CarpApplication uniqueInstance
|
^ CarpApplication uniqueInstance
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -31,10 +30,10 @@ LeCarpApplicationStrategy >> applicationSettings [
|
|||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
LeCarpApplicationStrategy >> newCarpApplicationFor: aLeDatabase [
|
LeCarpApplicationStrategy >> newCarpApplication [
|
||||||
|
|
||||||
^ CarpApplication new initializeWith:
|
^ CarpApplication new initializeWith:
|
||||||
(self updatedSettings: LanguageLinkSettings carpDefaultSettings).
|
(self updatedSettings: LanguageLinkSettings carpDefaultSettings)
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user