Added (missing) UserPreferences>>smallSenseElectricEditSupportEnabled
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 02 May 2015 22:01:31 +0200
changeset 454 9ecaf7d56abe
parent 453 7f88db59ad3f
child 455 f1cd6e210528
Added (missing) UserPreferences>>smallSenseElectricEditSupportEnabled
SmallSense__SmalltalkEditSupportTests.st
extensions.st
stx_goodies_smallsense.st
--- a/SmallSense__SmalltalkEditSupportTests.st	Fri Apr 24 08:10:23 2015 +0100
+++ b/SmallSense__SmalltalkEditSupportTests.st	Sat May 02 22:01:31 2015 +0200
@@ -152,7 +152,7 @@
 
 test_electric_snippet_do_01
 
-    UserPreferences current smallSenseCompleteIfUnambiguous: true.  
+    UserPreferences current smallSenseElectricEditSupportEnabled: true.  
     codeView editedMethodOrClass: self class.
     codeView contents:'editService
     snippets do'.
@@ -168,11 +168,12 @@
     self assert: (codeView list at: 2) = '    snippets do:'.
 
     "Created: / 04-03-2015 / 05:54:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-05-2015 / 21:59:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 test_electric_snippet_do_02
 
-    UserPreferences current smallSenseCompleteIfUnambiguous: true.  
+    UserPreferences current smallSenseElectricEditSupportEnabled: true.  
     codeView editedMethodOrClass: self class.
     codeView contents:'editService
     snippets do'.
@@ -185,13 +186,12 @@
     self assert: (codeView list at: 2) = '    snippets do: aBlock'.
 
     "Created: / 04-03-2015 / 06:11:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-
-
+    "Modified: / 02-05-2015 / 21:59:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 test_electric_snippet_do_03
 
-    UserPreferences current smallSenseCompleteIfUnambiguous: true.  
+    UserPreferences current smallSenseElectricEditSupportEnabled: true.  
     UserPreferences current smallSenseSmalltalkIterationVariableNamePrefixWithEach: true.
     codeView editedMethodOrClass: self class.
     codeView contents:'editService
@@ -203,11 +203,12 @@
     self assert: (codeView list at: 2) = '    snippets do:[:eachSnippet |  ]'.
 
     "Created: / 04-03-2015 / 08:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-05-2015 / 21:59:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 test_electric_snippet_do_04
 
-    UserPreferences current smallSenseCompleteIfUnambiguous: true.  
+    UserPreferences current smallSenseElectricEditSupportEnabled: true.  
     UserPreferences current smallSenseSmalltalkIterationVariableNameMaxLength: 5.
     codeView editedMethodOrClass: self class.
     codeView contents:'editService
@@ -219,6 +220,27 @@
     self assert: (codeView list at: 2) = '    snippets do:[:each |  ]'.
 
     "Created: / 04-03-2015 / 08:14:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 02-05-2015 / 21:59:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_electric_snippet_do_05
+
+    UserPreferences current smallSenseElectricEditSupportEnabled: false.
+    codeView editedMethodOrClass: self class.
+    codeView contents:'editService
+    snippets do'.
+    codeView setCursorLine: 2; setCursorCol: 16.
+
+    codeViewInteractor type: ':'.
+    Delay waitForMilliseconds: 250.
+    self assert: (codeView list at: 2) = '    snippets do:'.
+    codeViewInteractor type: #(BackSpace).
+    self assert: (codeView list at: 2) = '    snippets do'.
+    codeViewInteractor type: ':'.
+    Delay waitForMilliseconds: 250.
+    self assert: (codeView list at: 2) = '    snippets do:'.
+
+    "Created: / 02-05-2015 / 21:58:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkEditSupportTests methodsFor:'tests - indent-on-paste'!
--- a/extensions.st	Fri Apr 24 08:10:23 2015 +0100
+++ b/extensions.st	Sat May 02 22:01:31 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:goodies/smallsense' }"!
 
 !AssignmentNode methodsFor:'enumeration'!
@@ -1018,6 +1020,23 @@
 
 !UserPreferences methodsFor:'accessing-SmallSense'!
 
+smallSenseElectricEditSupportEnabled
+    ^ self at:#smallSenseElectricEditSupportEnabled ifAbsent:[ false ].
+
+    "Created: / 02-05-2015 / 21:57:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!UserPreferences methodsFor:'accessing-SmallSense'!
+
+smallSenseElectricEditSupportEnabled: aBoolean
+
+    ^self at:#smallSenseElectricEditSupportEnabled put: aBoolean
+
+    "Created: / 02-05-2015 / 21:57:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!UserPreferences methodsFor:'accessing-SmallSense'!
+
 smallSenseEnabled
     "Return true if SmallSense is enabled"
 
--- a/stx_goodies_smallsense.st	Fri Apr 24 08:10:23 2015 +0100
+++ b/stx_goodies_smallsense.st	Sat May 02 22:01:31 2015 +0200
@@ -325,6 +325,8 @@
         UserPreferences smallSenseSmalltalkIterationVariableNameMaxLength:
         UserPreferences smallSenseSmalltalkIterationVariableNamePrefixWithEach
         UserPreferences smallSenseSmalltalkIterationVariableNamePrefixWithEach:
+        UserPreferences smallSenseElectricEditSupportEnabled
+        UserPreferences smallSenseElectricEditSupportEnabled:
     )
 ! !