--- a/Make.proto Wed Nov 26 09:34:04 2014 +0000
+++ b/Make.proto Sat Dec 06 22:27:37 2014 +0000
@@ -179,8 +179,6 @@
$(OUTDIR)SmallSense__SettingsAppl.$(O) SmallSense__SettingsAppl.$(H): SmallSense__SettingsAppl.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libtool/AbstractSettingsApplication.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkChecker.$(O) SmallSense__SmalltalkChecker.$(H): SmallSense__SmalltalkChecker.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/SmalllintChecker.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkInferencerParameters.$(O) SmallSense__SmalltalkInferencerParameters.$(H): SmallSense__SmalltalkInferencerParameters.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/SharedPool.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__SmalltalkLintAnnotation.$(O) SmallSense__SmalltalkLintAnnotation.$(H): SmallSense__SmalltalkLintAnnotation.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__SmalltalkLintHighlighter.$(O) SmallSense__SmalltalkLintHighlighter.$(H): SmallSense__SmalltalkLintHighlighter.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkLintService.$(O) SmallSense__SmalltalkLintService.$(H): SmallSense__SmalltalkLintService.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkParseNodeVisitor.$(O) SmallSense__SmalltalkParseNodeVisitor.$(H): SmallSense__SmalltalkParseNodeVisitor.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkParser.$(O) SmallSense__SmalltalkParser.$(H): SmallSense__SmalltalkParser.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libcomp/AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libcomp/SyntaxHighlighter.$(H) $(STCHDR)
@@ -227,7 +225,7 @@
$(OUTDIR)SmallSense__PackageSearchDialog.$(O) SmallSense__PackageSearchDialog.$(H): SmallSense__PackageSearchDialog.st $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__AbstractSearchDialog.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
$(OUTDIR)SmallSense__JavaCompletionEngineSimple.$(O) SmallSense__JavaCompletionEngineSimple.$(H): SmallSense__JavaCompletionEngineSimple.st $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__AbstractJavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__GroovyCompletionEngineSimple.$(O) SmallSense__GroovyCompletionEngineSimple.$(H): SmallSense__GroovyCompletionEngineSimple.st $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__AbstractJavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)/stx/goodies/smallsense/SmallSense__JavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBBasicLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBBlockLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBContainsSmalltalkXEOLCommentRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBTransformationRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBBlockNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBMethodNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBStatementNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBValueNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/CompiledCode.$(H) $(INCLUDE_TOP)/stx/libbasic/ConfigurableFeatures.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/ExecutableFunction.$(H) $(INCLUDE_TOP)/stx/libbasic/IdentityDictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Method.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/UserPreferences.$(H) $(INCLUDE_TOP)/stx/libcomp/AssignmentNode.$(H) $(INCLUDE_TOP)/stx/libcomp/BlockNode.$(H) $(INCLUDE_TOP)/stx/libcomp/MessageNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseErrorNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/PrimaryNode.$(H) $(INCLUDE_TOP)/stx/libcomp/PrimitiveNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ReturnNode.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libcomp/StatementNode.$(H) $(INCLUDE_TOP)/stx/libcomp/VariableNode.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentFrame.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentView.$(H) $(INCLUDE_TOP)/stx/libtool/SystemBrowser.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NavigationState.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/ModalBox.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/StandardSystemView.$(H) $(INCLUDE_TOP)/stx/libview/TopView.$(H) $(INCLUDE_TOP)/stx/libview/View.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libwidg/DialogBox.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextView.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextViewCompletionSupport.$(H) $(INCLUDE_TOP)/stx/libwidg/ListView.$(H) $(INCLUDE_TOP)/stx/libwidg/TextCollector.$(H) $(INCLUDE_TOP)/stx/libwidg/TextView.$(H) $(INCLUDE_TOP)/stx/libwidg/Workspace.$(H) $(INCLUDE_TOP)/stx/libwidg2/DoWhatIMeanSupport.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBBasicLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBBlockLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBContainsSmalltalkXEOLCommentRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBLintRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/lint/RBTransformationRule.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBBlockNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBMethodNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBProgramNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBStatementNode.$(H) $(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser/RBValueNode.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/CompiledCode.$(H) $(INCLUDE_TOP)/stx/libbasic/ConfigurableFeatures.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/ExecutableFunction.$(H) $(INCLUDE_TOP)/stx/libbasic/IdentityDictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Method.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/UserPreferences.$(H) $(INCLUDE_TOP)/stx/libcomp/AssignmentNode.$(H) $(INCLUDE_TOP)/stx/libcomp/BlockNode.$(H) $(INCLUDE_TOP)/stx/libcomp/MessageNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseErrorNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ParseNode.$(H) $(INCLUDE_TOP)/stx/libcomp/Parser.$(H) $(INCLUDE_TOP)/stx/libcomp/PrimaryNode.$(H) $(INCLUDE_TOP)/stx/libcomp/PrimitiveNode.$(H) $(INCLUDE_TOP)/stx/libcomp/ReturnNode.$(H) $(INCLUDE_TOP)/stx/libcomp/Scanner.$(H) $(INCLUDE_TOP)/stx/libcomp/StatementNode.$(H) $(INCLUDE_TOP)/stx/libcomp/VariableNode.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentFrame.$(H) $(INCLUDE_TOP)/stx/libhtml/HTMLDocumentView.$(H) $(INCLUDE_TOP)/stx/libtool/SystemBrowser.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__LintService.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NavigationState.$(H) $(INCLUDE_TOP)/stx/libtool/Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/View.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextView.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextViewCompletionSupport.$(H) $(INCLUDE_TOP)/stx/libwidg/ListView.$(H) $(INCLUDE_TOP)/stx/libwidg/TextView.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
--- a/Make.spec Wed Nov 26 09:34:04 2014 +0000
+++ b/Make.spec Sat Dec 06 22:27:37 2014 +0000
@@ -72,8 +72,6 @@
SmallSense::SettingsAppl \
SmallSense::SmalltalkChecker \
SmallSense::SmalltalkInferencerParameters \
- SmallSense::SmalltalkLintAnnotation \
- SmallSense::SmalltalkLintHighlighter \
SmallSense::SmalltalkLintService \
SmallSense::SmalltalkParseNodeVisitor \
SmallSense::SmalltalkParser \
@@ -146,8 +144,6 @@
$(OUTDIR_SLASH)SmallSense__SettingsAppl.$(O) \
$(OUTDIR_SLASH)SmallSense__SmalltalkChecker.$(O) \
$(OUTDIR_SLASH)SmallSense__SmalltalkInferencerParameters.$(O) \
- $(OUTDIR_SLASH)SmallSense__SmalltalkLintAnnotation.$(O) \
- $(OUTDIR_SLASH)SmallSense__SmalltalkLintHighlighter.$(O) \
$(OUTDIR_SLASH)SmallSense__SmalltalkLintService.$(O) \
$(OUTDIR_SLASH)SmallSense__SmalltalkParseNodeVisitor.$(O) \
$(OUTDIR_SLASH)SmallSense__SmalltalkParser.$(O) \
--- a/SmallSense__CriticsWindow.st Wed Nov 26 09:34:04 2014 +0000
+++ b/SmallSense__CriticsWindow.st Sat Dec 06 22:27:37 2014 +0000
@@ -16,6 +16,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"
+'From Smalltalk/X, Version:6.2.5.0 on 03-12-2014 at 23:46:57' !
+
"{ Package: 'stx:goodies/smallsense' }"
"{ NameSpace: SmallSense }"
@@ -69,7 +71,7 @@
^ super flyByHelpSpec addPairsFrom:#(
#disableRule
-'Disable this rule in the future'
+'Disable this rule in the future\(for the rest of this session, unless you save the ruleset)'
#browseRule
'Open a browser on the rule'
@@ -92,21 +94,21 @@
SmallSense::CriticsWindow open
"
-
+ <resource: #canvas>
- ^
+ ^
#(FullSpec
name: windowSpec
- window:
+ window:
(WindowSpec
label: 'SmalllintRuleDetail'
name: 'SmalllintRuleDetail'
min: (Point 10 10)
- bounds: (Rectangle 0 0 472 308)
+ bounds: (Rectangle 0 0 563 384)
backgroundColor: (Color 100.0 100.0 75.0)
forceRecursiveBackgroundOfDefaultBackground: true
)
- component:
+ component:
(SpecCollection
collection: (
(ActionButtonSpec
@@ -120,17 +122,31 @@
)
(HTMLViewSpec
name: 'Rationale'
- layout: (LayoutFrame 0 0 20 0 -20 1 -60 1)
+ layout: (LayoutFrame 0 0 20 0 0 1 -65 1)
level: 0
visibilityChannel: rationaleVisibleHolder
hasHorizontalScrollBar: true
hasVerticalScrollBar: true
+ miniScrollerHorizontal: true
+ miniScrollerVertical: true
htmlText: ruleRationaleAndFixesHTMLHolder
postBuildCallback: setupHTMLView:
)
(LinkButtonSpec
+ label: 'Disable this Rule'
+ name: 'Button3'
+ layout: (LayoutFrame -1 0 -59 1 -16 1 -30 1)
+ activeHelpKey: disableRule
+ level: 0
+ translateLabel: true
+ labelChannel: disableRuleString
+ adjust: left
+ model: disableLintRule
+ keepSpaceForOSXResizeHandleH: true
+ )
+ (LinkButtonSpec
name: 'Button1'
- layout: (LayoutFrame -1 0 -59 1 -31 1 -30 1)
+ layout: (LayoutFrame 0 0 -29 1 -16 1 0 1)
activeHelpKey: browseRule
level: 0
translateLabel: true
@@ -139,20 +155,8 @@
model: browseLintRule
keepSpaceForOSXResizeHandleH: true
)
- (LinkButtonSpec
- label: 'Disable this Rule'
- name: 'Button3'
- layout: (LayoutFrame 0 0 -29 1 -30 1 0 1)
- activeHelpKey: disableRule
- level: 0
- translateLabel: true
- labelChannel: disableRuleString
- adjust: left
- model: disableLintRule
- keepSpaceForOSXResizeHandleH: true
- )
)
-
+
)
)
! !
@@ -223,17 +227,14 @@
!CriticsWindow methodsFor:'actions'!
browseLintRule
- |rule ruleClass sel|
+ |rule ruleClass|
rule := self ruleHolder value.
rule isNil ifTrue:[^ self].
ruleClass := rule class.
- (ruleClass implements:#rationale) ifTrue:[
- sel := #rationale.
- ].
self close.
UserPreferences current systemBrowserClass
- openInClass:ruleClass selector:sel.
+ openInClass:ruleClass selector:#rationale
"Created: / 07-09-2011 / 04:09:38 / cg"
"Modified: / 31-01-2012 / 11:30:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -250,9 +251,9 @@
!
doQuickFix: quickFixNo
-
self closeDownViews.
- [ fixer performFix: quickFixNo ] fork.
+ "/ cg: why fork here?
+ "[" fixer performFix: quickFixNo "] fork".
"Created: / 16-02-2012 / 14:19:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
@@ -266,8 +267,8 @@
disableRuleString
- ^ 'Disable this Rule'
- colorizeAllWith: Color blue;
+ ^ ('Disable this Rule'
+ colorizeAllWith: Color blue)
actionForAll:[ self disableLintRule]
!
@@ -310,8 +311,8 @@
holder := BlockValue
with:[:h |
"/ h displayString , ' ' , (('[browse]' actionForAll:[ self browseLintRule]) colorizeAllWith:Color blue)
- ('Browse "',h name,'"-Rule (',h class name,')' "displayString")
- colorizeAllWith: Color blue;
+ (('Browse Rule Class (',h class name,')' "displayString")
+ colorizeAllWith: Color blue)
actionForAll:[ self browseLintRule]
]
argument: self ruleHolder.
@@ -336,6 +337,30 @@
!CriticsWindow methodsFor:'change & update'!
+printHTMLForFixesOn:aStream
+ "/ fixer printHtmlOn: s.
+
+ |fixes|
+
+ (fixes := fixer fixes) isEmptyOrNil ifTrue:[ ^ self ].
+
+ aStream nextPutAll: '<p>'.
+ fixes size > 1 ifTrue:[
+ aStream nextPutAll: '<br>'.
+ aStream nextPutLine: 'Possible fixes:'.
+ ].
+ aStream nextPutLine:'<ul indent="0">'.
+ fixes withIndexDo:[:fix :index|
+ aStream
+ nextPutAll:'<li><a action="doit: self doQuickFix:';
+ nextPutAll: index printString;
+ nextPutAll:'">';
+ nextPutAll: fix label;
+ nextPutAll:'</a></li>'.
+ ].
+ aStream nextPutLine:'</ul>'.
+!
+
update:something with:aParameter from:changedObject
"Invoked when an object that I depend upon sends a change notification."
@@ -362,7 +387,8 @@
nextPutAll: rule name;
nextPutAll:'<P>';
nextPutLine: rule rationale.
- fixer printHtmlOn: s.
+ self printHTMLForFixesOn:s.
+ "/ fixer printHtmlOn: s.
]
].
@@ -409,10 +435,7 @@
entered := false.
self updateRationaleAndFixes.
- aBuilder window
- "windowGroup: codeView windowGroup;"
- bePopUpView;
- beSlave.
+ aBuilder window beSlave.
"Created: / 03-04-2011 / 10:45:10 / Jan Vrany "
"Modified: / 16-02-2012 / 14:14:07 / Jan Vrany "
--- a/SmallSense__EditService.st Wed Nov 26 09:34:04 2014 +0000
+++ b/SmallSense__EditService.st Sat Dec 06 22:27:37 2014 +0000
@@ -84,16 +84,23 @@
"Created: / 27-07-2013 / 22:35:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
-!EditService class methodsFor:'queries'!
+!EditService class methodsFor:'testing'!
+
+isAvailable
+
+ ^false
+
+ "Created: / 28-11-2014 / 15:41:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
-isUsefulFor:aCodeView
- "this filters useful services.
- must be redefined to return true in subclasses (but each class must do it only
- for itself - not for subclasses"
+isAvailableFor: applicationClass
- ^ self == EditService
+ "Returns true if given service may be used in
+ given application class."
- "Created: / 27-07-2013 / 22:35:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ ^false
+
+ "Created: / 28-11-2014 / 15:41:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!EditService methodsFor:'accessing'!
--- a/SmallSense__SmalltalkInferencer.st Wed Nov 26 09:34:04 2014 +0000
+++ b/SmallSense__SmalltalkInferencer.st Sat Dec 06 22:27:37 2014 +0000
@@ -522,15 +522,16 @@
!
visitSuperNode:anObject
- | type |
+ | superclass type |
super visitSuperNode:anObject.
- type := Type withClass: class superclass.
+ superclass := class superclass.
+ type := superclass notNil ifTrue:[ Type withClass: class superclass ] ifFalse:[ Type unknown ].
type trustfullness: 100.
anObject inferedType:type
"Created: / 26-11-2011 / 14:44:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 18-09-2013 / 01:26:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 24-11-2014 / 22:17:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
visitVariableNode:anObject
@@ -543,19 +544,22 @@
anObject inferedType: t.
anObject isGlobalVariable ifTrue:[
- | global class |
+ | globalName global globalClass |
- global := Smalltalk at: anObject name asSymbol.
- "/ Special hack for JAVA - its actually a JavaPackage...
+ globalName := anObject name asSymbolIfInterned.
+ globalName notNil ifTrue:[
+ global := Smalltalk at: globalName.
- global == (Smalltalk at: #JAVA) ifTrue:[
- global := JavaPackage
- ].
- class := global class.
+ "/ Special hack for JAVA - its actually a JavaPackage...
+ global == (Smalltalk at: #JAVA) ifTrue:[
+ global := JavaPackage
+ ].
+ globalClass := global class.
- global notNil ifTrue:[
- t addClass: class.
- t trustfullness: 100.
+ global notNil ifTrue:[
+ t addClass: globalClass.
+ t trustfullness: 100.
+ ].
].
^self.
].
@@ -566,7 +570,7 @@
].
"Created: / 26-11-2011 / 13:31:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 26-10-2013 / 10:08:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-12-2014 / 22:06:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!SmalltalkInferencer::Phase2 class methodsFor:'documentation'!
--- a/SmallSense__SmalltalkLintAnnotation.st Wed Nov 26 09:34:04 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-"
- COPYRIGHT (c) 2006 by eXept Software AG
- All Rights Reserved
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice. This software may not
- be provided or otherwise made available to, or used by, any
- other person. No title to or ownership of the software is
- hereby transferred.
-"
-"{ Package: 'stx:goodies/smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-Object subclass:#SmalltalkLintAnnotation
- instanceVariableNames:'startPosition endPosition line rule'
- classVariableNames:''
- poolDictionaries:''
- category:'SmallSense-Smalltalk-Lint'
-!
-
-!SmalltalkLintAnnotation class methodsFor:'documentation'!
-
-copyright
-"
- COPYRIGHT (c) 2006 by eXept Software AG
- All Rights Reserved
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice. This software may not
- be provided or otherwise made available to, or used by, any
- other person. No title to or ownership of the software is
- hereby transferred.
-"
-! !
-
-!SmalltalkLintAnnotation class methodsFor:'instance creation'!
-
-from: start to: end rule: rule
-
- ^self new
- startPosition: start;
- endPosition: end;
- rule: rule;
- yourself.
-
- "Created: / 30-01-2012 / 15:23:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkLintAnnotation methodsFor:'accessing'!
-
-endPosition
- ^ endPosition
-!
-
-endPosition:anInteger
- endPosition := anInteger.
-!
-
-line
- ^ line
-!
-
-line:anInteger
- line := anInteger.
-!
-
-rule
- ^ rule
-!
-
-rule:anRBLintRule
- self assert: anRBLintRule isComposite not.
- rule := anRBLintRule.
-
- "Modified: / 30-01-2012 / 15:22:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-startPosition
- ^ startPosition
-!
-
-startPosition:anInteger
- startPosition := anInteger.
-! !
-
-!SmalltalkLintAnnotation methodsFor:'comparing'!
-
-< anObject
-
- anObject isNumber ifTrue:[^startPosition < anObject].
- anObject class == self class ifFalse:[^false].
-
- ^endPosition < anObject startPosition
-
- "Created: / 14-02-2010 / 13:39:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-<= aMagnitude
- "return true, if the argument is greater or equal than the receiver"
-
- ^ (aMagnitude < self) not
-!
-
-= anObject
-
- anObject class == self class ifFalse:[^false].
-
- ^startPosition == (anObject startPosition) and:
- [endPosition == (anObject endPosition) and:
- [rule = anObject rule]]
-
- "Created: / 14-02-2010 / 13:33:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-> aMagnitude
- "return true, if the argument is less than the receiver"
-
- ^ aMagnitude < self
-!
-
->= aMagnitude
- "return true, if the argument is less or equal than the receiver"
-
- ^ (self < aMagnitude) not
-! !
-
-!SmalltalkLintAnnotation class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-! !
-
--- a/SmallSense__SmalltalkLintHighlighter.st Wed Nov 26 09:34:04 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-"
- COPYRIGHT (c) 2006 by eXept Software AG
- All Rights Reserved
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice. This software may not
- be provided or otherwise made available to, or used by, any
- other person. No title to or ownership of the software is
- hereby transferred.
-"
-"{ Package: 'stx:goodies/smallsense' }"
-
-"{ NameSpace: SmallSense }"
-
-Object subclass:#SmalltalkLintHighlighter
- instanceVariableNames:'rules annotations formattingMethod emphasisError
- emphasisInformation emphasisWarning'
- classVariableNames:''
- poolDictionaries:''
- category:'SmallSense-Smalltalk-Lint'
-!
-
-!SmalltalkLintHighlighter class methodsFor:'documentation'!
-
-copyright
-"
- COPYRIGHT (c) 2006 by eXept Software AG
- All Rights Reserved
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice. This software may not
- be provided or otherwise made available to, or used by, any
- other person. No title to or ownership of the software is
- hereby transferred.
-"
-! !
-
-!SmalltalkLintHighlighter methodsFor:'accessing'!
-
-annotations
- ^ annotations
-!
-
-rules
- ^ rules
-!
-
-rules:aCollectionOfRules
- rules := aCollectionOfRules.
-
- "Modified (format): / 07-03-2012 / 17:24:02 / cg"
-! !
-
-!SmalltalkLintHighlighter methodsFor:'accessing-emphasis'!
-
-emphasisForError
- |warnColor|
-
- emphasisError isNil ifTrue:[
- warnColor := Color red.
- emphasisError := Array
- "/with: #backgroundColor -> warnColor lightened lightened
- with: #underwave
- with: #underlineColor -> warnColor
- ].
- ^emphasisError
-
- "Created: / 05-08-2011 / 09:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 08-03-2012 / 03:00:51 / cg"
- "Modified: / 20-04-2012 / 18:29:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-emphasisForInformation
- |warnColor|
-
- emphasisInformation isNil ifTrue:[
- warnColor := Color blue lighter.
- emphasisInformation := Array
- "/with: #backgroundColor -> warnColor lightened lightened
- with: #underwave
- with: #underlineColor -> warnColor
- ].
- ^emphasisInformation
-
- "Created: / 05-08-2011 / 09:31:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 08-03-2012 / 03:01:22 / cg"
- "Modified: / 20-04-2012 / 18:29:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-emphasisForSeverity: severity
-
- severity == #error ifTrue:[^self emphasisForError].
- severity == #information ifTrue:[^self emphasisForInformation].
-
- ^self emphasisForWarning
-
- "Created: / 05-08-2011 / 09:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-emphasisForWarning
- |warnColor|
-
- emphasisWarning isNil ifTrue:[
- warnColor := (Color redByte: 224 greenByte: 200 blueByte: 45).
- emphasisWarning := Array
- "/with: #backgroundColor -> warnColor lightened lightened
- with: #underwave
- with: #underlineColor -> warnColor
- ].
- ^emphasisWarning
-
- "Created: / 05-08-2011 / 09:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 08-03-2012 / 03:00:19 / cg"
- "Modified: / 20-04-2012 / 18:29:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkLintHighlighter methodsFor:'formatting'!
-
-formatClassDefinition:source in:class
-
- formattingMethod := false.
- ^ self format: source
-
- "Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatClassDefinition:source in:class elementsInto: elements
-
- formattingMethod := false.
- ^ self format: source
-
- "Created: / 04-08-2011 / 23:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatExpression:source in:class
-
- formattingMethod := false.
- ^ self format: source
-
- "Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatExpression:source in:class elementsInto: elements
-
- formattingMethod := false.
- ^ self format: source
-
- "Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mth source:source in:class using: preferences
-
- formattingMethod := true.
- ^ self format: source
-
- "Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-formatMethod:mth source:source in:class using: preferences elementsInto: elements
-
- formattingMethod := true.
- ^ self format: source
-
- "Created: / 04-08-2011 / 23:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkLintHighlighter methodsFor:'formatting-private'!
-
-format: text
-
- | tree |
- tree := RBParser parseMethod: text string onError:[:error :pos| ^ text ].
- self format: text tree: tree.
- ^text
-
- "Created: / 04-08-2011 / 23:51:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-format: text tree: tree
-
- annotations := SortedCollection new.
- rules ? #() do:[:rule|
- self format: text tree: tree rule: rule
- ].
- ^text
-
- "Created: / 02-02-2012 / 23:32:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-format: text tree: tree rule: rule
-
- | string |
-
- string := text string.
-
- formattingMethod ifTrue:[
- rule resultSelectionIntervalsForSource: string tree: tree do: [:interval|
- interval notEmptyOrNil ifTrue:[
- (interval first == 1 and:[interval last == text size]) ifTrue:[
- (OperatingSystem getLoginName = 'jv') ifTrue:[
- Transcript showCR:'>> no meaningful selection interval for ' , rule printString.
- ].
- ] ifFalse:[
- self mark: text from: interval first to: interval last for: rule.
- ]
- ]
- ].
- ] ifFalse: [
- | searches |
-
- searches := rule result searchStrings asSet.
-
- searches do:[:search|
- | i |
- i := 1.
- [
- i := string findString: search startingAt: i.
- i ~~ 0
- ] whileTrue:[
- self mark: text from: i to: (i + search size - 1) for: rule.
- i := i + search size + 1.
- ]
- ]
- ]
-
- "Created: / 03-02-2012 / 10:39:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 16-10-2014 / 15:20:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkLintHighlighter methodsFor:'initialization'!
-
-reset
- annotations := OrderedCollection new.
-
- "Created: / 18-02-2012 / 22:54:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 15-08-2013 / 12:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkLintHighlighter methodsFor:'markup'!
-
-mark: text from: start to: end for: rule
- | emphasis |
-
- emphasis := self emphasisForSeverity: rule severity.
- text emphasisFrom: start to: end add: emphasis.
- annotations add:
- (SmalltalkLintAnnotation from: start to: end rule: rule)
-
- "Created: / 30-01-2012 / 15:30:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 17-09-2013 / 15:24:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!SmalltalkLintHighlighter class methodsFor:'documentation'!
-
-version_HG
-
- ^ '$Changeset: <not expanded> $'
-! !
-
--- a/SmallSense__SmalltalkLintService.st Wed Nov 26 09:34:04 2014 +0000
+++ b/SmallSense__SmalltalkLintService.st Sat Dec 06 22:27:37 2014 +0000
@@ -9,6 +9,8 @@
other person. No title to or ownership of the software is
hereby transferred.
"
+'From Smalltalk/X, Version:6.2.5.0 on 03-12-2014 at 16:00:02' !
+
"{ Package: 'stx:goodies/smallsense' }"
"{ NameSpace: SmallSense }"
@@ -211,16 +213,17 @@
"Modified: / 28-02-2013 / 22:43:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+
!SmalltalkLintService methodsFor:'initialization'!
initialize
super initialize.
- highlighter := SmalltalkLintHighlighter new.
+ highlighter := Tools::LintHighlighter new.
"Created: / 05-08-2011 / 11:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 17-09-2013 / 15:22:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 03-12-2014 / 09:38:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!SmalltalkLintService methodsFor:'private'!
@@ -346,11 +349,14 @@
ann := self annotationAtLine: lineNo.
ann isNil ifTrue:[ ^ false ].
+ codeView topView beMaster.
+
CriticsWindow new
rule: ann rule;
codeView: codeView;
allButOpen;
- openWindowAt: (Screen current pointerPosition - (20@20)).
+ "/ openWindowAt: (Screen current pointerPosition - (20@20)).
+ openWindowAs:#popUp at: (Screen current pointerPosition - (20@20)).
^true
@@ -367,7 +373,7 @@
| lang annotation |
- ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ].
+ "/ ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ].
annotation := self annotationAtLine: lineNo.
annotation notNil ifTrue:[
--- a/SmallSense__SmalltalkQuickFixer.st Wed Nov 26 09:34:04 2014 +0000
+++ b/SmallSense__SmalltalkQuickFixer.st Sat Dec 06 22:27:37 2014 +0000
@@ -16,6 +16,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"
+'From Smalltalk/X, Version:6.2.5.0 on 03-12-2014 at 23:46:45' !
+
"{ Package: 'stx:goodies/smallsense' }"
"{ NameSpace: SmallSense }"
@@ -73,6 +75,12 @@
"Created: / 17-02-2012 / 00:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!SmalltalkQuickFixer methodsFor:'accessing'!
+
+fixes
+ ^ fixes
+! !
+
!SmalltalkQuickFixer methodsFor:'adding'!
fix
@@ -113,29 +121,6 @@
"Created: / 16-02-2012 / 14:48:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
-!SmalltalkQuickFixer methodsFor:'printing & storing'!
-
-printHtmlOn: html
-
- fixes isEmptyOrNil ifTrue:[ ^ self ].
- fixes size > 1 ifTrue:[
- html nextPutAll: '<br>'.
- html nextPutLine: 'Possible fixes'.
- ].
- html nextPutLine:'<ul>'.
- fixes withIndexDo:[:fix :index|
- html
- nextPutAll:'<li><a action="doit: self doQuickFix:';
- nextPutAll: index printString;
- nextPutAll:'">';
- nextPutAll: fix label;
- nextPutAll:'</a></li>'.
- ].
- html nextPutLine:'</ul>'.
-
- "Created: / 01-02-2012 / 12:13:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
!SmalltalkQuickFixer methodsFor:'utilities'!
apply: changes
--- a/abbrev.stc Wed Nov 26 09:34:04 2014 +0000
+++ b/abbrev.stc Sat Dec 06 22:27:37 2014 +0000
@@ -22,8 +22,6 @@
SmallSense::SettingsAppl SmallSense__SettingsAppl stx:goodies/smallsense 'SmallSense-Core-Interface' 1
SmallSense::SmalltalkChecker SmallSense__SmalltalkChecker stx:goodies/smallsense 'SmallSense-Smalltalk-Lint' 0
SmallSense::SmalltalkInferencerParameters SmallSense__SmalltalkInferencerParameters stx:goodies/smallsense 'SmallSense-Smalltalk-Types-Inference' 0
-SmallSense::SmalltalkLintAnnotation SmallSense__SmalltalkLintAnnotation stx:goodies/smallsense 'SmallSense-Smalltalk-Lint' 0
-SmallSense::SmalltalkLintHighlighter SmallSense__SmalltalkLintHighlighter stx:goodies/smallsense 'SmallSense-Smalltalk-Lint' 0
SmallSense::SmalltalkLintService SmallSense__SmalltalkLintService stx:goodies/smallsense 'SmallSense-Smalltalk-Lint' 0
SmallSense::SmalltalkParseNodeVisitor SmallSense__SmalltalkParseNodeVisitor stx:goodies/smallsense 'SmallSense-Smalltalk' 0
SmallSense::SmalltalkParser SmallSense__SmalltalkParser stx:goodies/smallsense 'SmallSense-Smalltalk' 3
--- a/bc.mak Wed Nov 26 09:34:04 2014 +0000
+++ b/bc.mak Sat Dec 06 22:27:37 2014 +0000
@@ -104,8 +104,6 @@
$(OUTDIR)SmallSense__SettingsAppl.$(O) SmallSense__SettingsAppl.$(H): SmallSense__SettingsAppl.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libtool\AbstractSettingsApplication.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkChecker.$(O) SmallSense__SmalltalkChecker.$(H): SmallSense__SmalltalkChecker.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\SmalllintChecker.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkInferencerParameters.$(O) SmallSense__SmalltalkInferencerParameters.$(H): SmallSense__SmalltalkInferencerParameters.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\SharedPool.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__SmalltalkLintAnnotation.$(O) SmallSense__SmalltalkLintAnnotation.$(H): SmallSense__SmalltalkLintAnnotation.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SmallSense__SmalltalkLintHighlighter.$(O) SmallSense__SmalltalkLintHighlighter.$(H): SmallSense__SmalltalkLintHighlighter.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkLintService.$(O) SmallSense__SmalltalkLintService.$(H): SmallSense__SmalltalkLintService.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkParseNodeVisitor.$(O) SmallSense__SmalltalkParseNodeVisitor.$(H): SmallSense__SmalltalkParseNodeVisitor.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__SmalltalkParser.$(O) SmallSense__SmalltalkParser.$(H): SmallSense__SmalltalkParser.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libcomp\AbstractSyntaxHighlighter.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libcomp\SyntaxHighlighter.$(H) $(STCHDR)
@@ -152,7 +150,7 @@
$(OUTDIR)SmallSense__PackageSearchDialog.$(O) SmallSense__PackageSearchDialog.$(H): SmallSense__PackageSearchDialog.st $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__AbstractDIalog.$(H) $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__AbstractSearchDialog.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(STCHDR)
$(OUTDIR)SmallSense__JavaCompletionEngineSimple.$(O) SmallSense__JavaCompletionEngineSimple.$(H): SmallSense__JavaCompletionEngineSimple.st $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__AbstractJavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)SmallSense__GroovyCompletionEngineSimple.$(O) SmallSense__GroovyCompletionEngineSimple.$(H): SmallSense__GroovyCompletionEngineSimple.st $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__AbstractJavaCompletionEngine.$(H) $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__AbstractJavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__CompletionEngine.$(H) $(INCLUDE_TOP)\stx\goodies\smallsense\SmallSense__JavaCompletionEngineSimple.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBBasicLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBBlockLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBContainsSmalltalkXEOLCommentRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBTransformationRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBBlockNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBMethodNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBStatementNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBValueNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(INCLUDE_TOP)\stx\libbasic\IdentityDictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Method.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\UserPreferences.$(H) $(INCLUDE_TOP)\stx\libcomp\AssignmentNode.$(H) $(INCLUDE_TOP)\stx\libcomp\BlockNode.$(H) $(INCLUDE_TOP)\stx\libcomp\MessageNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseErrorNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimaryNode.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimitiveNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ReturnNode.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libcomp\StatementNode.$(H) $(INCLUDE_TOP)\stx\libcomp\VariableNode.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentFrame.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentView.$(H) $(INCLUDE_TOP)\stx\libtool\SystemBrowser.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NavigationState.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\ModalBox.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\StandardSystemView.$(H) $(INCLUDE_TOP)\stx\libview\TopView.$(H) $(INCLUDE_TOP)\stx\libview\View.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libwidg\DialogBox.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextView.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextViewCompletionSupport.$(H) $(INCLUDE_TOP)\stx\libwidg\ListView.$(H) $(INCLUDE_TOP)\stx\libwidg\TextCollector.$(H) $(INCLUDE_TOP)\stx\libwidg\TextView.$(H) $(INCLUDE_TOP)\stx\libwidg\Workspace.$(H) $(INCLUDE_TOP)\stx\libwidg2\DoWhatIMeanSupport.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBBasicLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBBlockLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBContainsSmalltalkXEOLCommentRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBLintRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\lint\RBTransformationRule.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBBlockNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBMethodNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBProgramNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBStatementNode.$(H) $(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser\RBValueNode.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ConfigurableFeatures.$(H) $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(INCLUDE_TOP)\stx\libbasic\IdentityDictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Method.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\UserPreferences.$(H) $(INCLUDE_TOP)\stx\libcomp\AssignmentNode.$(H) $(INCLUDE_TOP)\stx\libcomp\BlockNode.$(H) $(INCLUDE_TOP)\stx\libcomp\MessageNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseErrorNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ParseNode.$(H) $(INCLUDE_TOP)\stx\libcomp\Parser.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimaryNode.$(H) $(INCLUDE_TOP)\stx\libcomp\PrimitiveNode.$(H) $(INCLUDE_TOP)\stx\libcomp\ReturnNode.$(H) $(INCLUDE_TOP)\stx\libcomp\Scanner.$(H) $(INCLUDE_TOP)\stx\libcomp\StatementNode.$(H) $(INCLUDE_TOP)\stx\libcomp\VariableNode.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentFrame.$(H) $(INCLUDE_TOP)\stx\libhtml\HTMLDocumentView.$(H) $(INCLUDE_TOP)\stx\libtool\SystemBrowser.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__BackgroundSourceProcessingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeCompletionService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeHighlightingService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeNavigationService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__LintService.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NavigationState.$(H) $(INCLUDE_TOP)\stx\libtool\Tools__NewSystemBrowser.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\View.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextView.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextViewCompletionSupport.$(H) $(INCLUDE_TOP)\stx\libwidg\ListView.$(H) $(INCLUDE_TOP)\stx\libwidg\TextView.$(H) $(STCHDR)
# ENDMAKEDEPEND --- do not remove this line
--- a/extensions.st Wed Nov 26 09:34:04 2014 +0000
+++ b/extensions.st Sat Dec 06 22:27:37 2014 +0000
@@ -84,60 +84,6 @@
"Created: / 25-11-2014 / 13:20:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
-!DoWhatIMeanSupport methodsFor:'code completion - smallsense'!
-
-stx_goodies_smallsense_codeCompletionForClass:classOrNilArg context:contextOrNil codeView:codeViewArg
- <swizzle: #codeCompletionForClass:context:codeView:>
- "SmallSense version of #codeCompletionForClass:context:codeView:.
-
- When SmallSense is loaded, this method is swizzled as #codeCompletionForClass:context:codeView:.
- into DoWhatIMeanSupport."
-
- | p node text items mode |
-
- UserPreferences current smallSenseCompletionEnabled ifFalse:[
- ^ self stx_libwidg2_codeCompletionForClass:classOrNilArg context:contextOrNil codeView:codeViewArg
- ].
-
- codeView := codeViewArg.
-
- "/ The respondsTo: hack is because CVS CodeView2 has no #mode method.
-
- mode := (codeView respondsTo:#mode) ifTrue:[
- codeView mode
- ] ifFalse:[ #method ].
- contextOrNil notNil ifTrue:[
- mode := #method.
- ].
- items := SmallSense::SmalltalkCompletion
- resultSetFor:mode
- source:codeView contents
- class:classOrNilArg
- line:codeView cursorLine
- column:codeView cursorCol.
- items notEmptyOrNil ifTrue:[
- (p := items position) notNil ifTrue:[
- node := p node.
- node notNil ifTrue:[
- (node isVariable and:[ p isInNode ]) ifTrue:[
- text := node name
- ] ifFalse:[
- node isMessage ifTrue:[
- text := node selector
- ]
- ].
- ].
- ].
- ].
- SmallSense::CompletionWindow
- openForView:codeView
- text:text
- items:items.
-
- "Created: / 19-08-2013 / 15:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 25-11-2014 / 13:11:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
!EditTextView methodsFor:'accessing-behavior'!
autoIndent
@@ -530,12 +476,15 @@
"Created: / 26-11-2011 / 12:37:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
-!Tools::CodeCompletionService class methodsFor:'testing'!
+!Tools::CodeCompletionService class methodsFor:'instance creation'!
+
+new
+ "return an initialized instance"
-stx_goodies_smallsense_isUsefulFor: arg1
- <swizzle: #isUsefulFor:>
+ ^ (SmallSense::EditService ? self) basicNew initialize.
- ^ false
+ "Created: / 27-07-2013 / 22:47:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 28-11-2014 / 15:40:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!Tools::CodeHighlightingService class methodsFor:'instance creation'!
@@ -560,6 +509,46 @@
"Modified: / 23-09-2013 / 14:32:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!Tools::LintService methodsFor:'event handling'!
+
+buttonPress:button x:x y:y in:view
+ |lineNr|
+
+ view == gutterView ifTrue:[
+ button == 1 ifTrue:[
+ lineNr := textView yVisibleToLineNr:y.
+ lineNr notNil ifTrue:[
+ ^ self showInfoWindowForLine: lineNr
+ ].
+ ^ false.
+ ].
+ ].
+ ^ false
+
+ "Created: / 30-01-2012 / 21:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 03-12-2014 / 10:01:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Tools::LintService methodsFor:'private'!
+
+showInfoWindowForLine: lineNo
+ | ann |
+
+ ann := self annotationAtLine: lineNo.
+ ann isNil ifTrue:[ ^ false ].
+
+ SmallSense::CriticsWindow new
+ rule: ann rule;
+ codeView: codeView;
+ allButOpen;
+ openWindowAt: (Screen current pointerPosition - (20@20)).
+
+ ^true
+
+ "Created: / 30-01-2012 / 21:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 03-12-2014 / 10:00:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!Tools::NavigationState methodsFor:'aspects - SmallSense'!
stx_goodies_smallsense_selectedClasses
@@ -973,15 +962,6 @@
"Created: / 24-09-2013 / 10:04:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
-!Workspace class methodsFor:'defaults - smallsense'!
-
-stx_goodies_smallsense_codeCompletionServiceClass
- <swizzle: #codeCompletionServiceClass>
- ^ SmallSense::CodeCompletionService
-
- "Created: / 24-09-2013 / 00:29:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
!stx_goodies_smallsense class methodsFor:'documentation'!
extensionsVersion_HG
--- a/libInit.cc Wed Nov 26 09:34:04 2014 +0000
+++ b/libInit.cc Sat Dec 06 22:27:37 2014 +0000
@@ -48,8 +48,6 @@
_SmallSense__SettingsAppl_Init(pass,__pRT__,snd);
_SmallSense__SmalltalkChecker_Init(pass,__pRT__,snd);
_SmallSense__SmalltalkInferencerParameters_Init(pass,__pRT__,snd);
-_SmallSense__SmalltalkLintAnnotation_Init(pass,__pRT__,snd);
-_SmallSense__SmalltalkLintHighlighter_Init(pass,__pRT__,snd);
_SmallSense__SmalltalkLintService_Init(pass,__pRT__,snd);
_SmallSense__SmalltalkParseNodeVisitor_Init(pass,__pRT__,snd);
_SmallSense__SmalltalkParser_Init(pass,__pRT__,snd);
--- a/smallsense.rc Wed Nov 26 09:34:04 2014 +0000
+++ b/smallsense.rc Sat Dec 06 22:27:37 2014 +0000
@@ -25,7 +25,7 @@
VALUE "LegalCopyright", "Copyright Jan Vrany 2013-2014\0"
VALUE "ProductName", "SmallSense\0"
VALUE "ProductVersion", "6.2.5.0\0"
- VALUE "ProductDate", "Tue, 25 Nov 2014 14:03:04 GMT\0"
+ VALUE "ProductDate", "Wed, 03 Dec 2014 10:29:19 GMT\0"
END
END
--- a/stx_goodies_smallsense.st Wed Nov 26 09:34:04 2014 +0000
+++ b/stx_goodies_smallsense.st Sat Dec 06 22:27:37 2014 +0000
@@ -46,28 +46,6 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"
-!
-
-extensionsVersion_HG
-
- ^ '$Changeset: <not expanded> $'
-! !
-
-!stx_goodies_smallsense class methodsFor:'initialization'!
-
-initialize
-
- "This should be logically done in postload, but postload
- is not called when classlibrary is built-in (i.e., not loaded
- by Smalltalk loadPackage: ...). This is indeed a bug. "
-
- Swizzled := false.
- self hasAllExtensionsLoaded ifTrue:[
- self swizzle
- ].
-
- "Created: / 19-08-2013 / 15:24:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 02-09-2013 / 12:29:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!stx_goodies_smallsense class methodsFor:'accessing - tests'!
@@ -117,7 +95,7 @@
#'stx:libview' "DisplaySurface - extended"
#'stx:libview2' "ApplicationModel - extended"
#'stx:libwidg' "DialogBox - extended"
- #'stx:libwidg2' "DoWhatIMeanSupport - extended"
+ #'stx:libwidg2' "HierarchicalItem - superclass of SmallSense::ClassPO"
)
!
@@ -146,21 +124,6 @@
)
! !
-!stx_goodies_smallsense class methodsFor:'description - actions'!
-
-postLoadAction
-
- "/ Setup SmallSense completion
- UserPreferences current at: #searchCompletionBlock put: #SmallSense.
-
- "/ Swizzle methods. Note, that if they are already swizzled,
- "/ self swizzle is noop.
- self swizzle.
-
- "Created: / 02-09-2013 / 12:30:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified (comment): / 25-11-2013 / 12:31:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
!stx_goodies_smallsense class methodsFor:'description - contents'!
classNamesAndAttributes
@@ -192,8 +155,6 @@
#'SmallSense::SettingsAppl'
#'SmallSense::SmalltalkChecker'
#'SmallSense::SmalltalkInferencerParameters'
- #'SmallSense::SmalltalkLintAnnotation'
- #'SmallSense::SmalltalkLintHighlighter'
#'SmallSense::SmalltalkLintService'
#'SmallSense::SmalltalkParseNodeVisitor'
#'SmallSense::SmalltalkParser'
@@ -312,10 +273,7 @@
UserPreferences smallSenseSmalltalkIndentOnPasteEnabled
UserPreferences smallSenseSmalltalkIndentOnPasteEnabled:
EditTextViewCompletionSupport isCompletionViewShown
- DoWhatIMeanSupport #'stx_goodies_smallsense_codeCompletionForClass:context:codeView:'
#'Tools::NavigationState' #'stx_goodies_smallsense_selectedClasses'
- 'Tools::CodeCompletionService class' #'stx_goodies_smallsense_isUsefulFor:'
- 'Workspace class' #'stx_goodies_smallsense_codeCompletionServiceClass'
Method inspector2TabSTXParseTreeInspector
ParseNode inspector2TabSTXParseTreeInspector
Parser inspector2TabSTXParseTreeInspector
@@ -327,6 +285,9 @@
RBProgramNode startPosition
RBContainsSmalltalkXEOLCommentRule fixes:
'DialogBox class' #'stx_goodies_smallsense_requestProject:from:initialAnswer:suggestions:'
+ 'Tools::CodeCompletionService class' new
+ #'Tools::LintService' buttonPress:x:y:in:
+ #'Tools::LintService' showInfoWindowForLine:
)
! !
@@ -401,7 +362,7 @@
self swizzle: m.
] on: Error do:[:ex |
Logger error: 'Cannot swizzle %1: %2' with: m selector with: ex description.
- "/ Debugger enter.
+ Debugger enter.
].
].
Swizzled := true.
@@ -410,10 +371,12 @@
"
stx_goodies_smallsense swizzle
Swizzled := false.
+
+ self extensionMethods select:[:m | m notNil and:[ (m annotationAt: #swizzle:) notNil or:[(m annotationAt: #swizzle:checksum:) notNil ] ] ]
"
"Created: / 19-08-2013 / 14:54:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified (comment): / 07-10-2014 / 15:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 28-11-2014 / 15:31:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
swizzle: method
@@ -551,5 +514,3 @@
^ '$Id: stx_goodies_smallsense.st,v 1.2 2014/02/12 14:49:29 sr Exp $'
! !
-
-stx_goodies_smallsense initialize!