-
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.
- Loading branch information
1 parent
ae2e0f1
commit b62045b
Showing
14 changed files
with
61 additions
and
18 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
packages/Spellcheck-Core.package/SPCTextStyler.class/instance/highlightSyntaxIn..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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
styling | ||
highlightSyntaxIn: aText | ||
self workspace | ||
ifNotNil: [Workspace shouldStyle ifTrue: [super privateStyle: aText]] | ||
ifNil: [SHTextStylerST80 syntaxHighlightingAsYouType ifTrue: [super privateStyle: aText]] | ||
ifNotNil: [workspace shouldStyle ifTrue: [ super privateStyle: aText] ifFalse: [ self unstyle: aText ]] | ||
ifNil: [ super privateStyle: aText ] |
4 changes: 3 additions & 1 deletion
4
packages/Spellcheck-Core.package/SPCTextStyler.class/instance/privateStyle..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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
styling | ||
privateStyle: aText | ||
super privateStyle: aText. | ||
self class spellCheckingEnabled ifTrue:[ | ||
self unstyle: aText; | ||
highlightSyntaxIn: aText; | ||
highlightSpellingMistakesIn: aText | ||
] | ||
ifFalse: [ | ||
super privateStyle: aText. | ||
] |
2 changes: 1 addition & 1 deletion
2
packages/Spellcheck-Core.package/SPCTextStyler.class/instance/workspace.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessing | ||
workspace | ||
|
||
Transcript showln: workspace. | ||
^ workspace |
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
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
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
10 changes: 10 additions & 0 deletions
10
.../Spellcheck-Tests.package/SPCStylerTests.class/instance/testStylingInWorkspaceDisabled.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,10 @@ | ||
testing | ||
testStylingInWorkspaceDisabled | ||
|
||
| runArray workspace | | ||
workspace := Workspace new. | ||
workspace shouldStyle: false. | ||
spellingStyler workspace: workspace. | ||
spellingStyler privateStyle: textWithoutMistake. | ||
runArray := textWithoutMistake runs. | ||
self assert: (runArray values = #(#())) |
17 changes: 17 additions & 0 deletions
17
...s/Spellcheck-Tests.package/SPCStylerTests.class/instance/testStylingInWorkspaceEnabled.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 @@ | ||
testing | ||
testStylingInWorkspaceEnabled | ||
|
||
| runArray runArraySt80 workspace textWithoutMistakeUnstyled st80Styler | | ||
st80Styler := SHTextStylerST80 new. | ||
textWithoutMistakeUnstyled := 'a := 5.' asText. | ||
workspace := Workspace new. | ||
workspace shouldStyle: true. | ||
|
||
spellingStyler workspace: workspace. | ||
spellingStyler privateStyle: textWithoutMistake. | ||
runArray := textWithoutMistake runs. | ||
|
||
st80Styler workspace: workspace. | ||
st80Styler privateStyle: textWithoutMistakeUnstyled. | ||
runArraySt80 := textWithoutMistakeUnstyled runs. | ||
self assert: (runArray = runArraySt80). |
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
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
12 changes: 12 additions & 0 deletions
12
...ests.package/SPCTextParserTests.class/instance/testParsingStringsOnlySingleCorrectWord.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,12 @@ | ||
testing | ||
testParsingStringsOnlySingleCorrectWord | ||
|
||
| strings text| | ||
|
||
text := 'a := ''squeak'''. | ||
SPCTextParser parseStringsOnly: true. | ||
strings := parser parseText: text. | ||
"Will be spell-checked later, but should have parsed one word." | ||
self assert: (strings size = 1). | ||
|
||
SPCTextParser parseStringsOnly: false |
8 changes: 2 additions & 6 deletions
8
...-Tests.package/SPCTextParserTests.class/instance/testParsingStringsOnlySingleWrongWord.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 |
---|---|---|
@@ -1,15 +1,11 @@ | ||
testing | ||
testParsingStringsOnlySingleWrongWord | ||
|
||
| strings text firstWordInStringStart firstWordInStringEnd lastWordInStringStart lastWordInStringEnd| | ||
firstWordInStringStart := 22. | ||
firstWordInStringEnd := 25. | ||
lastWordInStringStart := 54. | ||
lastWordInStringEnd := 60. | ||
| strings text| | ||
|
||
text := 'a := ''sqeek'''. | ||
SPCTextParser parseStringsOnly: true. | ||
strings := parser parseText: text. | ||
self assert: (strings size >0). | ||
self assert: (strings size = 1). | ||
|
||
SPCTextParser parseStringsOnly: false |
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
Oops, something went wrong.