Skip to content

Commit

Permalink
dc: add impl of Truediff diffing algo, dc/lsp: add hover
Browse files Browse the repository at this point in the history
  • Loading branch information
tom95 committed Nov 6, 2023
1 parent 3980ae1 commit 792874a
Show file tree
Hide file tree
Showing 28 changed files with 1,034 additions and 50 deletions.
3 changes: 2 additions & 1 deletion .squot
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ OrderedDictionary {
'packages/Sandblocks-Wing' : #SquotTonelSerializer,
'packages/DomainCode-Parser' : #SquotTonelSerializer,
'packages/DomainCode-Core' : #SquotTonelSerializer,
'packages/DomainCode-Diff' : #SquotTonelSerializer
'packages/DomainCode-Diff' : #SquotTonelSerializer,
'packages/DomainCode-Truediff' : #SquotTonelSerializer
}
27 changes: 26 additions & 1 deletion packages/DomainCode-Core/DCFileEditor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Class {
{ #category : #'as yet unclassified' }
DCFileEditor >> file [

^ self firstSubmorph firstSubmorph firstSubmorph
^ self childSandblocks first
]

{ #category : #'as yet unclassified' }
Expand Down Expand Up @@ -38,19 +38,44 @@ DCFileEditor >> file: aFile [
yourself)
]

{ #category : #'as yet unclassified' }
DCFileEditor >> filepath [

^ file asString
]

{ #category : #'as yet unclassified' }
DCFileEditor >> getSourceStringAndMark [
"for compatibility with lsp"

^ self file sourceString
]

{ #category : #'as yet unclassified' }
DCFileEditor >> isArtefact [

^ true
]

{ #category : #'as yet unclassified' }
DCFileEditor >> languageSemanticsFor: aBlock [

^ self owner languageSemanticsFor: aBlock
]

{ #category : #'as yet unclassified' }
DCFileEditor >> reloadArtefact [
<action>

self replaceBy: (DCFileEditor new file: file)
]

{ #category : #'as yet unclassified' }
DCFileEditor >> root [

^ self file
]

{ #category : #'as yet unclassified' }
DCFileEditor >> saveTryFixing: aFixBoolean quick: aQuickBoolean [

Expand Down
31 changes: 30 additions & 1 deletion packages/DomainCode-Core/DCProjectView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ Class {
#name : #DCProjectView,
#superclass : #SBBlock,
#instVars : [
'files'
'files',
'languageSemantics',
'project'
],
#category : #'DomainCode-Core'
}

{ #category : #'as yet unclassified' }
DCProjectView class >> on: aFilePathString [

^ self new project: (DCProject new directory: (FileDirectory on: aFilePathString))
]

{ #category : #'as yet unclassified' }
DCProjectView class >> queryOpenProject: aRoot [
<domainQuery>
Expand All @@ -17,6 +25,12 @@ DCProjectView class >> queryOpenProject: aRoot [
ifNone: []
]

{ #category : #'as yet unclassified' }
DCProjectView >> languageSemanticsFor: aBlock [

^ {#args. aBlock. languageSemantics}
]

{ #category : #'as yet unclassified' }
DCProjectView >> openFile: aFile [

Expand All @@ -27,6 +41,8 @@ DCProjectView >> openFile: aFile [
{ #category : #'as yet unclassified' }
DCProjectView >> project: aProject [

project := aProject.

self
changeTableLayout;
hResizing: #rigid;
Expand All @@ -43,3 +59,16 @@ DCProjectView >> project: aProject [
ifFound: [:rootFile | files addMorphBack: ((SBFileTree new on: rootFile) when: #open send: #openFile: to: self)]
ifNone: []
]

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

languageSemantics := SBTSLSPSemantics new
on: project directory
transport: (SBLSPStdioTransport new
command: (SBTSLanguageRuntime which: 'pylsp');
arguments: {};
workingDirectory: project directory asString)
onReady: []
]
6 changes: 6 additions & 0 deletions packages/DomainCode-Core/Morph.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ Morph >> isReplacement [
^ false
]

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

self childrenDo: [:c | c allChildrenDo: aBlock]
]

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

Expand Down
8 changes: 8 additions & 0 deletions packages/DomainCode-Core/SBBlock.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : #SBBlock }

{ #category : #'*DomainCode-Core' }
SBBlock >> languageSemanticsFor: aBlock [


^ nil
]
Loading

0 comments on commit 792874a

Please sign in to comment.