Skip to content

Commit

Permalink
dc: pending replacement refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tom95 committed Nov 18, 2023
1 parent 792874a commit c77efc6
Show file tree
Hide file tree
Showing 18 changed files with 643 additions and 62 deletions.
2 changes: 1 addition & 1 deletion packages/DomainCode-Core/CompiledMethod.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Extension { #name : #CompiledMethod }
{ #category : #'*DomainCode-Core' }
CompiledMethod >> openDC: convert [
<convert>
<convertPriority: 13>
<convertPriority: 11>

convert do: [DCSmalltalkMethod for: self]
]
2 changes: 2 additions & 0 deletions packages/DomainCode-Core/DCFileEditor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ DCFileEditor >> root [
{ #category : #'as yet unclassified' }
DCFileEditor >> saveTryFixing: aFixBoolean quick: aQuickBoolean [

(self languageSemanticsFor: self root) ifNotNil: [:l | l third formatDocumentOf: self root].

FileStream
forceNewFileNamed: file asString
do: [:stream | stream nextPutAll: self file sourceString withUnixLineEndings].
Expand Down
13 changes: 13 additions & 0 deletions packages/DomainCode-Core/DCProjectView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ DCProjectView >> project: aProject [
ifNone: []
]

{ #category : #'as yet unclassified' }
DCProjectView >> startHTMLLSP [
<action>

languageSemantics := SBTSLSPSemantics new
on: project directory
transport: (SBLSPStdioTransport new
command: (SBTSLanguageRuntime which: 'node');
arguments: {'/home/tom/Code/squeak/coc/node_modules/coc-html/lib/server.js'. '--stdio'};
workingDirectory: project directory asString)
onReady: []
]

{ #category : #'as yet unclassified' }
DCProjectView >> startPythonLSP [
<action>
Expand Down
39 changes: 39 additions & 0 deletions packages/DomainCode-Core/Morph.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,51 @@ Morph >> onlyChildrenDo: aBlock [
self childrenDo: [:c | c allChildrenDo: aBlock]
]

{ #category : #'*DomainCode-Core' }
Morph >> parent [

^ self replacedParent
ifNotNil: [:p | p parent ifNotNil: #source]
ifNil: [self parentSandblock]
]

{ #category : #'*DomainCode-Core' }
Morph >> parentMorph [

^ self replacedParent ifNotNil: [:p | p parentMorph] ifNil: [self parentSandblock]
]

{ #category : #'*DomainCode-Core' }
Morph >> purpose [

^ nil
]

{ #category : #'*DomainCode-Core' }
Morph >> replaceNodeBy: aMorph [

| currentOwner index target |
target := self parentMorph.
currentOwner := target owner.
self assert: currentOwner notNil.
index := currentOwner submorphIndexOf: target.
target delete.
currentOwner addMorph: aMorph asElementNumber: index.
^ aMorph
]

{ #category : #'*DomainCode-Core' }
Morph >> replacedParent [

^ self valueOfProperty: #replacedParent
]

{ #category : #'*DomainCode-Core' }
Morph >> replacedParent: aBlock [

self setProperty: #replacedParent toValue: aBlock
]

{ #category : #'*DomainCode-Core' }
Morph >> setBoundsDirect: aRectangle [

Expand Down
8 changes: 8 additions & 0 deletions packages/DomainCode-Core/SequenceableCollection.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ SequenceableCollection >> overlappingPairsLoopedDo: aBlock [
1 to: self size - 1 do: [:i | aBlock value: (self at: i) value: (self at: i + 1)].
self size >= 2 ifTrue: [aBlock value: self last value: self first]
]

{ #category : #'*DomainCode-Core' }
SequenceableCollection >> withOrNil: aCollection do: aBlock [

1
to: (self size max: aCollection size)
do: [:index | aBlock value: (self at: index ifAbsent: [nil]) value: (aCollection at: index ifAbsent: [nil])]
]
Loading

0 comments on commit c77efc6

Please sign in to comment.