-
Hammer 3 beta
Hi,
Here's the first zip of the beta, as before you can download from:
[URL]http://projects.vdf-guidance.com/projects/hammer/files[/URL]
A note on what the hammer is and some highlights on its features can be found in the alpha thread here:
[URL]https://support.dataaccess.com/Forums/showthread.php?61274-Hammer3-in-alpha[/URL]
Addressed has been the following:
[U]Hammer beta 20170827[/U]
[LIST][*]Make the file tab in the code explorer aware about folders added via Configure Hammer Workspace. Also open "Open File Under" to use those additional paths.[*]New parser.dll, version 3.0.251 with the following features:
[*=1]The parser addresses an issue with finding in files that have parenthesis as part of the filename. Search results from those files would trigger error 54 from the output pane as formerly parenthesis had been used to pass line numbers. Now we use <> characters instead and those are illegal characters in file names and as such they no longer have the issue with the error.
[*=1]File Find now also includes the manually added paths from the Workspace configure dialog.
[*=1]File Find no longer searches in .svn and .git folders, which makes it faster on projects which have those metadata folders.[/LIST]
[U]Hammer beta 20170830[/U]
[LIST][*]Bob Worsley ran his unused variables app on -at least part of- the hammer and the unused vars have been removed.[*]Remove DosBox.src as functionality is nowadays part of Hammer itself.[*]Added MatchBrace support, works on ([]) and fold point key words (eg. begin/end/procedure/end_proc etc.), so this is about using Ctrl+][*]Text type now also uses the proper color scheme[*]Pressing enter on a line when the cursor is less then indentation point still inserted an indent, that is fixed.[*].lng file type default set to ini filetype[*]Parser.dll version 3.0.0.252, adds exclude in find in files for .hg folders (Mercurial)[/LIST]
[U]Hammer beta 20170901[/U]
[LIST][*]Added menu "Code Refactoring Tools" under Source menu.[*]Introducing "Drop Self" refactor option, attached to keyboard shortcut Ctrl+Shift+S (See screenshot in post below for an idea what this is)[*]Tweaked dependency scanner option a bit so that it is more forgiving on user input.[*]Fix for bug 85, code collapse is executed when the user clicks anywhere between the [-][*]Add Performance counter for building code explorer[/LIST]
[U]Hammer beta 20170910[/U]
[LIST][*]Add {} to bracematch support as per request Dave R.[*]Rewritten the cArray2D logic from the time of yore into structs and arrays and removed the cArray2D pkg from the project.[*]For VDF7+ objects will no longer attach/display their whole object neighborhood for that object in the object prompt list, if multiple objects with the same name exist, then display an extra level of the object path.[*]Fix parens issue with multiple objects where it would not add the outermost parens after selecting from the object prompt list.[*]Add Refactor Object Neighborhood logic[*]Close outputpanel with escape when it has the focus.[*]No "brace bad" highlight on braces in comments.[*]Tooltip parameter highlighting did not take byref into account.[*]Add "ByRef" as keyword in the DataFlex keyword list.[/LIST]
[U]Hammer beta 20170912[/U]
[LIST][*]Function autocomplete on return type would move the line with "Function_Return" to the first column in the line. This has been addressed. In addition the undo sequence has been improved (less steps needed to undo).[*]Refactored a bunch of code, added missing use statements for a less noisy Problem Resolution Panel in the Studio.[*]Testing Object Neighborhood refactor option on cEditorElementsView.pkg, found that tab characters caused detection to fail, fixed that.[/LIST]
[U]Hammer beta 20170913[/U]
[LIST][*]Tested object neighborhood refactoring on cEditorEdit.pkg ;)[*]New sciLexer.dll to include support for folding on cd_popup_object and cd_end_object[*]New Refactor option "re-indent".[*]No more autocomplete lists when editing a comment.[*]Object autocomplete list sometimes still displayed methods because it added back a level and added a method.[*]Brace matching now no longer happens at all in a comment.[*]Removed cd_popup_object and cd_end_object from the keyword list as it prevented to see them as scope list items.[/LIST]
[U]Hammer beta 20170914[/U]
[LIST][*]Added messagebox2 feature from Matt Davidian.[*]Extended Drop self/Object Neighborhood refactoring options to have a checkbox that gives you the option to pad the replace value with spaces (keep same width) or not.[*]Object Neighborhood refactor also works if the line starts with "if" or "else" (bug # 88)[*]Find.dg, Replace.dg, changes the search/replace forms into comboforms that remember the most recent searches and replaces.[*]Added GotoFirstIndentationMismatch as requested by Marco[*]Matching braces logic did not work when typing, nor when moving the cursor past the end of line character. Both these cases have been addressed making the matching braces feature working much more as expected.[/LIST]
[U]Hammer beta 20170915[/U]
[LIST][*]Prevent the "unable to find current workspace" error when there was no current workspace. The error was in this case very unhelpful.[*]MessageBox2.dg, some changes from Matt for dynamic widths and added MBR_CHECKED2[*]cEditorEdit.pkg, added "remember for this object" option for refactoring, donated by Matt Davidian. The DropSelf refactoring now also works when in an if/else statement.[*]ReIndent on DataFlex images and comments no longer happens.[*]SciLexer.dll, added code folding for begin_row/end_row, item_list/end_item_list, begin_constraints/end_constraints, begin_transaction/end_transaction[/LIST]
[U]Hammer beta 20170915a[/U]
[LIST][*]Extra fix for DataFlex images where it first still did a ltrim before re-inserting the indent. As DataFlex images can have lines starting with spaces that was not wanted. Fixed[/LIST]
[U]Hammer beta 20170920[/U]
[LIST][*]No longer present brace bad highlights when your cursor is at the last character (you already know it is an unclosed brace, no need to distract)[*]When a codetip was showing you could not get any autocomplete, this has been addressed. After the autocomplete is finished you get your codetip back as well.[*]The method autocomplete would not show if the line would begin with DataFlex keywords "if" or "else", this has been addressed[*]A bit of code cleanup[/LIST]
This 0922 release is a STABILITY UPDATE, read below for the details
[U]Hammer beta 20170922[/U]
[LIST][*]oObjectsMethods.SL, invoking this could trigger a file not open error.[*]cEditorEdit.pkg, simplify code tooltip code a bit, add fix for flashing old non active tooltip after closing autocomplete[*]cSciLexer.pkg, file exist test on openfile, so can present normal warning instead of DF error. Under certain circumstances tooltip highlight calculation could end up in a loop. Fixed and added extra safe guard. Cleaned up codetip before autocomplete logic a bit. Renamed GetCodeTipProperties to CodeTipParameterHighlight[/LIST]
[U]Hammer beta 20171008[/U]
[LIST][*]Help wasn't working well for Visual DataFlex 9.1, fixed.[*]dbExplorer didn't always select the correct workspace when started from the main menu. This was due to how the command line parameters logic works. Fixed.[*]There was still some conditions with if/else on the refactoring options that where not taken into account and caused the logic to not find refactoring candidates.[*]Find/Replace dialogs would always start searching at begin of the document, now it starts by default from your caret position. Added checkbox option to start from begin of document.[/LIST]
[U]Hammer beta 20171010[/U]
[LIST][*]Changing your workspace home folder would break workspace tree tools pane, not displaying files anymore. That has been fixed, code will verify if your home folder exists and if not replace it in the .hws file with the current one.[*]Added "On_Key" as another compound statement to take into account for autocomplete lists and refactoring rules[*]If Find in Files with "Show all results" is unchecked it would display the search in a raw format, this has been patched up so that it looks more consistent.[*]There's a new autocomplete list for if you type "use" or "include" it will display all the source files from your workspace.[*]Changed global variables gtTHWorkspace and gtTHCompiler to be properties.[*]Fixed any use of psBufferDataPath, psBufferAppSrcPath etc.. into what it had been meant to be eg. CurrentDataPath, PrimaryDataPath etc.. (thereby preventing strange errors to happen)[/LIST]
[U]Hammer beta 20171012[/U]
[LIST][*]Contains the fix for the memory leak I introduced in the previous build[*]New Refactor method Method Extraction, not finished![*]Fix saving newly created file did not save, but instead tried to print (weird)[/LIST]
[U]Hammer beta 20171013[/U]
[LIST][*]Fix Df19 cConnectionManager compile issue.[*]MethodExtract.dg, now also has a method for creating the call invoke, insert a bit better indentation and location of the new method. Pass parameters passed in outer method to extracted method if used.[/LIST]
[U]Hammer beta 20171027[/U]
[LIST][*]Method Extract: Fix selection test for if end position of selection on end line and not on position 0 of next line.
Code analysis for variable isolation logic to determine IN/OUT needs the line breakup logic for compound statements to work for every DataFlex keyword, not just when followed by a set/get/send statement.[*]cEditorEdit.pkg, add first rev. variable analysis feature for code extract.[*]MethodExtract.dg, use selected fonts etc. Do not include variables into the variable declaration and parameters that have been found during code analysis.
cRefactorMethodExtract.pkg, Introduced KeywordParamTemplate for defining how to analyze DataFlex commands.[*]cSciLexer.pkg, changed preparsedLine to use non common characters for the string replacement.[*]Raveen added a new cCJToolPanel class that the studio can visually model and all reference to the toolpanel uses the DF object rather than the parent cCJDialogBar.
Eases working with toolpanels as the studio visually models it.
He also reworked the ToolsPane & OutputPane to use this new class.[*]Bug 94: as reported by Marco, DoChangedCurrentFolder method throws error 4509, Referenced Array Index Out of Bounds. This only happens when the startup folder in the codemaxedit<username>.ini is set to a now not existing folder. The reason you get error 4509 is because the translation array is not yet populated this early on startup. I commented out the translation and personally it is OK that this one info/error is not translated.[*]cEditorEdit.pkg, still an error on creating new files, now on not being able to read "Untitled" D'oh[*]cSourcesList.pkg, extended to be able to exclude standard folders such as .svn/.git/.hg from searching and added ability to use the exclude folders from the workspace. This speeds things up a bit.[*]cWorkspaceHandlerBase.pkg, add support for CurrentWSFile, moved logic from cWorkSpaceHandlerEx.pkg if duplicate code.
cWorkSpaceHandlerEx.pkg, removed duplicate code that was already in cWorkspaceHandlerBase.pkg[*]scilexer.dll, Scope words in DataFlex can be used as table column names (file.field) and as such they should not be characterized as a scope word. So test for that.
For ex. somebody using procedure for field name should not change that into a fold point.[*]MethodExtract.dg, extending the method extracting logic, it now no longer declares variables local if the var is declared as a parameter at the extracted method. The analyze line method on get/set no longer declares a function name as a variable. When using the Update button (or click OK) the list with declared variables is re-evaluated.
The code in the parent method is scanned for if the variable for extracted method was used. If that's the case and the variable is tagged as "write" then that means the variable has to be a byref parameter.[/LIST]
[U]Hammer beta 20171112[/U]
[LIST][*] Method Extract: lines out a bit better, reindents the text on first display. Somehow however reindenting only works correctly 1 time. Very weird.
Moved most of the reindent logic down to cSciLexer.pkg[*]ToolPane, database context menu did not always work for opening dbExplorer, database builder. Clear on Filter form now is shortcut key F5 instead of F4.[*]Replace.dg, start from beginning did not work. Also fixed a problem where replace all would hang. (bug #96)[*]Method Extract: analysis on "input/output" of variable was not correct if the first operation on a variable was "output", in that situation it can't be input anymore as the output has overwritten the input. The analysis also did not recognize file.field type of variables as a single variable.
Updated embedded vWin32fh package to latest version.[/LIST]
[U]Hammer beta 20180405[/U]
[LIST][*]VDF7 support was completely broken as in that it did not understand your workspaces, this update adds support for VDF4 to VDF7 back in. For VDF7 it would also not compile with debug symbols and as such you could not run the debugger. That is also addressed.[*]THAbout.dg, cEditorProperties.pkg, update text "last updated" with today and copyright set to 2018[*]THParameters.dg, added option for multi row file tabs and the ability to enable/disable creating .bak files.[*]cEditorEdit.pkg, fixed bug 98, statusbar linenumber is not updated when using line up/down during text selection[*]cEditorEditView.pkg, implemented feature 102, add a way to disable creating .bak files (WARNING: disabled by default, you might want to adjust that if you depend on this)[*]cEditorElementsView.pkg, if you double clicked in the treeview on the left in an area without treeview items it would popup "unable to open file". That is fixed.[*]cSciLexer.pkg, fixed bug 99, search dialog "Start at first line" checkbox setting wasn't remembered over multiple invocations. New function CurrentColumn[*]THCommandBars.pkg, suggestion 104, add option for multi row file tabs[/LIST]
[U]Hammer beta 20180613[/U]
[LIST][*]Compiles and runs in DataFlex 19.1[*]Find in Files dialog now has an option to filter out the results which are in comments. See also feature request 111[*]Fixes an issue with the connection dialog where it would only popup the auto-login dialog the first time when changing workspaces. On subsequential changes between workspaces it would not popup the auto login dialog, but instead abort with a unable to login error.[*]Addresses a rare crash. If you manage to get the parser to crash, then the treeview in the code explorer is no longer displayed and as such trying to use setdata on a treeview that is not on screen will trigger a GPF.[*]Running any custom option from the source menu will pause the hammer. Eg. Open current file in Studio stops your ability to edit in the Hammer at the same time. We now only use runprogram wait if a transfer file is passed.[/LIST]
[LEFT][COLOR=#222222][FONT=Verdana][/FONT][/COLOR][/LEFT][U]Hammer beta 20180711[/U]
[LIST=|INDENT=1][*]Moved vWin32fh packages to a library under the Libraries subfolder.[*]Code cleanup for DF19.1 warnings as well as using Starzen's code explorer - work in progress[*]Ran Cleanmarkers, Trim line endings, Remove public/private, Remove local keyword, Remove Studio markers[*]Exclude comments feature in Find in Files sometimes did not filter the results correctly.[*]Connection error to an external database now no longer is fatal.[/LIST]
--
Wil
-
Re: Hammer 3 beta
As there may be a few people using Mercurial, you may as well add .hg to the list of folders to exclude in the search also.
-
Re: Hammer 3 beta
Hi Todd,
Sure, added .hg folders and everything under that folder to the exclude list as well.
Fix is in parser.dll 3.0.0.252 (yes it was quick to do :) )
Thanks for the tip!
--
Wil
-
Re: Hammer 3 beta
Update.
Sorry very late here but wanted to finish up the brace match feature today, so will keep it brief.
Bob Worsley ran his unused variables app on -at least part of- the hammer and the unused vars have been removed.
Remove DosBox.src as functionality is nowadays part of Hammer itself.
Added MatchBrace support, works on ([]) and fold point key words (eg. begin/end/procedure/end_proc etc.), so this is about using Ctrl+] :)
Text type now also uses the proper color scheme
Pressing enter on a line when the cursor is less then indentation point still inserted an indent, that is fixed.
.lng file type default set to ini filetype
Parser.dll version 3.0.0.252, adds exclude in find in files for .hg folders (Mercurial)
--
Wil
edit: Noticed the project server was struggling have just added more RAM hopefully that keeps it fast
-
1 Attachment(s)
Re: Hammer 3 beta
OK, figured it was time to play a bit with a first code refactor option.
I believe some people want to refactor code :cool: not sure why.
So yesterday evening and a bit of today I've decided to create a refactoring option into the hammer that I named "Drop Self".
It sits under the Source Menu in a new sub menu called "Code Refactoring", currently it only has "Drop Self" as menu option.
It works like this:
[ATTACH=CONFIG]11300[/ATTACH]
(If you are upgrading -remove/rename codemaxedit<username>.ini from the hammer data folder to get the new keyboard shortcut)
This functionality sits behind keyboard shortcut Ctrl+Shift+S
It starts on the line your cursor is at, so it is easy to break/restart if needed.
At the moment it only does this for non nested objects. So if your code has nested objects then that's not suggested for a clean up. I've got ideas to take care of that as well, but lets first see how this one fares.
Other changes:
Tweaked dependency scanner option a bit so that it is more forgiving on user input.
Fix for bug 85, code collapse is executed when the user clicks anywhere between the [-]
Add Performance counter for building code explorer
--
Wil
-
Re: Hammer 3 beta
Wil, could matchbrace also do {} for charmode sources?
-
Re: Hammer 3 beta
Hi Dave,
[QUOTE=DaveR;326135]Wil, could matchbrace also do {} for charmode sources?[/QUOTE]
I think so. Can you email me an example source file I can run tests with?
It has been almost 20 years since I've written anything in char mode, so don't really have much code laying around to test with.
--
Wil
-
1 Attachment(s)
Re: Hammer 3 beta
Today's update has this list of changes:
[U]Hammer beta 20170910[/U]
[LIST][*]Add {} to bracematch support as per request Dave R. [*]Rewritten the cArray2D logic from the time of yore into structs and arrays and removed the cArray2D pkg from the project. [*]For VDF7+ objects will no longer attach/display their whole object neighborhood for that object in the object prompt list, if multiple objects with the same name exist, then display an extra level of the object path. [*]Fix parens issue with multiple objects where it would not add the outermost parens after selecting from the object prompt list. [*]Add Refactor Object Neighborhood logic [*]Close outputpanel with escape when it has the focus. [*]No "brace bad" highlight on braces in comments. [*]Tooltip parameter highlighting did not take byref into account. [*]Add "ByRef" as keyword in the DataFlex keyword list. [/LIST]
Now I think that the most exciting new feature in there is the object neighborhood refactor option.
Do you remember that before object neighborhoods got introduced in IIRC DataFlex 7.2 that you would have to put the full object reference in any method notation in order to make sure the method ended up at the correct object?
It has been a long time since that was needed, yet I see a LOT of code that still has those full object references and it is a pain to fix that.
eg.
[code]
Send Hello of oFooForm
[/code]
is a lot easier to read as
[code]
Send Hello of (oFooForm(oBar(oAt(oTheSea(Self)))))
[/code]
yet for the compiler both lines are equal.
It also does not help for readability, but fixing it is usually just too painful to actually spent time on. Reason being that you have to make sure that there's not an identically named object in the same file or otherwise you end up breaking things instead of improving code.
Say "Hi" to the object neighborhood refactor feature.
What it does is scan the file that you are currently editing and list all the objects in there and stores that in an array.
Then it searches all the lines of your currently editing file and tests to see if it can find an object reference that could be written in a shorter way. It does that by verifying against that array of objects. If the object is unique then it is quite simple and the logic strips off the object path of your object and suggests to replace that.
If OTOH the object is not unique (eg. you have multiple objects with the same name in your current file) then it will calculate the object reference of the current line and tries to suggest a shorter way to write it. If the name it is going to suggest is not shorter then it will not offer to change it.
As this also will remove the "self" parts on object references, one might wonder if the "drop self" refactor option I wrote last week should not be replaced by this? The answer is no as that option rewrites it even if the object does not exist in the current file.
The object neighborhood refactoring only matches objects it can find in the current file.
The refactoring option looks like this:
[ATTACH=CONFIG]11309[/ATTACH]
--
Wil
-
Re: Hammer 3 beta
-
Re: Hammer 3 beta
FYI, from yesterday and today merged in one post (aside from the update in the top post)
[U]Hammer beta 20170912[/U]
[LIST][*]Function autocomplete on return type would move the line with "Function_Return" to the first column in the line. This has been addressed. In addition the undo sequence has been improved (less steps needed to undo). [*]Refactored a bunch of code, added missing use statements for a less noisy Problem Resolution Panel in the Studio. [*]Testing Object Neighborhood refactor option on cEditorElementsView.pkg, found that tab characters caused detection to fail, fixed that. [/LIST]
[U]Hammer beta 20170913[/U]
[LIST][*]Tested object neighborhood refactoring on cEditorEdit.pkg ;) [*]New sciLexer.dll to include support for folding on cd_popup_object and cd_end_object [*]New Refactor option "re-indent". [*]No more autocomplete lists when editing a comment. [*]Object autocomplete list sometimes still displayed methods because it added back a level and added a method. [*]Brace matching now no longer happens at all in a comment. [*]Removed cd_popup_object and cd_end_object from the keyword list in CODEMAXEDIT.INI as it prevented to see them as scope list items. [/LIST]
The main new feature here is the new refactor option "Re-Indent".
What it does is for the current document to remove ALL of the current indentation.
Then it processes the whole document and inserts your own preferred indentation. The settings for that are taken from your preferences on how many spaces you like for indentation and if you want tabs or spaces.
This is especially useful if you have code that multiple developers have worked on with each their own preferences on how-to indent code.
By applying the re-indent you can make one file look all the same with one quick "re-indent" call.
Note that I exclude some things from the re-indentation logic.
This might be due to my opinion on how code should look like, for now it is not configurable and I'm not sure I should make it configurable (too many choices is not good either)
The following is excluded from re-indent and will be moved to the first character on the line:
A "Use" statement
The following compiler directives: #include, #IF, #IFDEF, #ENDIF
cheers!
--
Wil