Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Move closer to usage" refactor leaves a bit undone #3964

Closed
daFreeMan opened this issue Apr 24, 2018 · 1 comment
Closed

"Move closer to usage" refactor leaves a bit undone #3964

daFreeMan opened this issue Apr 24, 2018 · 1 comment
Labels
bug Identifies work items for known bugs difficulty-01-duckling Issue where no particularly involved knowledge of the internal API is needed. feature-refactorings up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

Comments

@daFreeMan
Copy link
Contributor

It does not trigger a reparse and it does not execute the indenter on the changed method.

Private Sub DeleteExtraLogFiles(ByVal filePath As String, ByVal fileNamePattern As String, ByVal maxLogsToKeep As Long)

'move this vvv
  Dim oldestFile As String
  
  On Error GoTo ErrorHandler
  
  Dim fileCount As Long
  
  Dim currentFile As String
  currentFile = Dir(filePath & fileNamePattern)
  
  Dim oldestFileDate As Date
  oldestFileDate = #12/31/3999#
  
  Dim currentFileDate As Date
  
  Do While Len(currentFile) > 0
    fileCount = fileCount + 1
    currentFileDate = FileDateTime(filePath & currentFile)
    If fileCount < maxLogsToKeep Then
      If currentFileDate < oldestFileDate Then
        oldestFile = currentFile
        oldestFileDate = currentFileDate
      End If
    Else
...

Yields this when moving Dim oldestFile As String

Private Sub DeleteExtraLogFiles(ByVal filePath As String, ByVal fileNamePattern As String, ByVal maxLogsToKeep As Long)

  On Error GoTo ErrorHandler
  
  Dim fileCount As Long
  
  Dim currentFile As String
  currentFile = Dir(filePath & fileNamePattern)
  
  Dim oldestFileDate As Date
  oldestFileDate = #12/31/3999#
  
  Dim currentFileDate As Date
  
  Do While Len(currentFile) > 0
    fileCount = fileCount + 1
    currentFileDate = FileDateTime(filePath & currentFile)
    If fileCount < maxLogsToKeep Then
      If currentFileDate < oldestFileDate Then
'get this vvv
        Dim oldestFile As String
oldestFile = currentFile
'and that ^^^
        oldestFileDate = currentFileDate
      End If
    Else
...

The lack of reparse:
rd move closer

It also somewhat inconveniently leaves the cursor at the top of the module instead of somewhere in the method that's being edited.

@daFreeMan daFreeMan changed the title "Move closer to usage" refactor leaves a bit to be desired "Move closer to usage" refactor leaves a bit undone Apr 24, 2018
@daFreeMan
Copy link
Contributor Author

Upon further usage, it appears that manually triggering the indenter causes a reparse, so as I see it, a simple call to the indenter for the affected method should take care of both stones with one bird.

@Vogel612 Vogel612 added bug Identifies work items for known bugs feature-refactorings up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky difficulty-01-duckling Issue where no particularly involved knowledge of the internal API is needed. labels Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs difficulty-01-duckling Issue where no particularly involved knowledge of the internal API is needed. feature-refactorings up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Projects
Development

No branches or pull requests

2 participants