Skip to content

Commit

Permalink
dc: fix display, smalltalk lang
Browse files Browse the repository at this point in the history
  • Loading branch information
tom95 committed Sep 24, 2023
1 parent b6744fc commit 3dc00d8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
12 changes: 12 additions & 0 deletions packages/DomainCode-Parser/DCBlock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ DCBlock >> isBlockBody [
^ self language blockBodyTypes includes: self type
]

{ #category : #'as yet unclassified' }
DCBlock >> isPart [

^ self highlight notNil and: [self highlight endsWith: '.part']
]

{ #category : #'as yet unclassified' }
DCBlock >> isTSBlock [

Expand Down Expand Up @@ -423,6 +429,12 @@ DCBlock >> preferredColorIn: aColorPolicy [
^ self slot preferredColorIn: aColorPolicy for: self highlight
]

{ #category : #'as yet unclassified' }
DCBlock >> prefersNoBorder [

^ self isPart
]

{ #category : #'as yet unclassified' }
DCBlock >> printOn: aStream [

Expand Down
33 changes: 17 additions & 16 deletions packages/Sandblocks-TSSmalltalk/SBTSSmalltalk.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ SBTSSmalltalk class >> allSuggestionOptionsFor: aBlock [
ifNotNil: [Array streamContents: [:stream | guessedClass withAllSuperclassesDo: [:class | stream nextPutAll: class selectors]]]
]

{ #category : #'configuration - editing' }
SBTSSmalltalk class >> blockBodyTypes [

^ {#block. #method}
]

{ #category : #'configuration - declarations' }
SBTSSmalltalk class >> declarationsInScope: aScopeBlock do: aClosure [

Expand Down Expand Up @@ -82,13 +88,12 @@ SBTSSmalltalk class >> fileSuffix [
^ 'st'
]

{ #category : #configuration }
{ #category : #properties }
SBTSSmalltalk class >> grammarJson [
" https://github.com/tom95/tree-sitter-smalltalk/blob/main/src/grammar.json "

^ '{
" https://github.com/smalltalk/blob/master/src/grammar.json "
^ '{
"name": "smalltalk",
"word": "identifier_or_keyword",
"rules": {
"method": {
"type": "SEQ",
Expand Down Expand Up @@ -333,7 +338,7 @@ SBTSSmalltalk class >> grammarJson [
},
"assignment": {
"type": "PREC_LEFT",
"value": -10,
"value": -5,
"content": {
"type": "SEQ",
"members": [
Expand Down Expand Up @@ -1136,11 +1141,11 @@ SBTSSmalltalk class >> hardLineBreakBetween: aBlock and: anotherBlock [
^ false
]

{ #category : #configuration }
{ #category : #properties }
SBTSSmalltalk class >> highlightQuery [
" https://github.com/smalltalk/blob/master/src/queries/highlights.scm "

^ '[(self) (true) (false) (thisContext) (super) (nil)] @keyword
" https://github.com/smalltalk/blob/master/src/queries/highlights.scm "
^ '[(self) (true) (false) (thisContext) (super) (nil)] @keyword
(number) @number
Expand All @@ -1154,17 +1159,13 @@ SBTSSmalltalk class >> highlightQuery [
(unary_message (_) (unary_identifier) @variable.part)
(binary_operator) @variable.part
(keyword) @variable.part
(keyword_selector) @variable.part
(comment) @comment
["^" "[" "]" "{" "}"] @important
(keyword_selector (keyword) @major_declaration.part)
(binary_selector (binary_operator) @major_declaration.part)
(unary_selector (unary_identifier) @major_declaration.part)
(unary_selector) @.part
(method) @.part'
(keyword_selector (keyword) @major_declaration)
(binary_selector (binary_operator) @major_declaration)
(unary_selector (unary_identifier) @major_declaration)
'
]

{ #category : #configuration }
Expand Down

0 comments on commit 3dc00d8

Please sign in to comment.