Skip to content

Commit e428e11

Browse files
committed
append example declarations
1 parent 257df80 commit e428e11

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

Tests/ACLibDeclarationDict/DeclarationDictTestCodemodule.cls

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ Option Explicit
1414

1515
Dim AccUnitX As Long
1616
Private m_AccUnitInfo As String
17+
Public Field As String
1718

18-
Private Enum TestEnum
19-
TestEnum_P1 = 2
20-
End Enum
19+
Private Enum TestEnum: TestEnum_P1 = 2: End Enum
2120
Private Type TestType1
2221
FldA As Long
2322
FldB As String
@@ -37,8 +36,12 @@ End Type
3736

3837
Public Event RaiseSomething(ByVal EventParam1 As Variant)
3938

39+
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr)
40+
41+
Public Event RaiseSomething2(ByVal EventParam1 As Variant, ByVal EventParam2 As Variant)
42+
4043
Private Sub Class_Initialize()
41-
'
44+
' Dim Class_Initialize_Xyz as String ... ignored!
4245
End Sub
4346

4447
Public Function AccUnitTestFunct(ByVal FuncParam1 As Variant, FuncParam2() As String) As Variant
@@ -47,6 +50,8 @@ Public Function AccUnitTestFunct(ByVal FuncParam1 As Variant, FuncParam2() As St
4750
Dim FuncVar3()
4851

4952
Dim FuncVar4 As Long: FuncVar4 = 5
53+
54+
Dim Dim1 As Long: Dim Dim2 As Long
5055

5156
End Function
5257

@@ -57,7 +62,12 @@ Friend Property Let Name2(ByVal NewValue As String)
5762
'
5863
End Property
5964

60-
Friend Property Set Formatter(ByVal ObjRef As Object)
65+
Friend Property Set PropertySet(ByVal ObjRef As Object)
6166
'
6267
End Property
6368

69+
Private Sub TestMe() ' _
70+
Private Sub ThisIsOnlyAComment(
71+
72+
End Sub
73+

Tests/ACLibDeclarationDict/DeclarationDictTests.cls

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,25 @@ Public Sub ImportCodeModule_CheckKeys()
119119
Dim ActualDict As Scripting.Dictionary
120120

121121
Dim ExpectedKeys() As Variant
122-
ExpectedKeys = Array("AccUnitX", "m_AccUnitInfo", _
122+
ExpectedKeys = Array("AccUnitX", "m_AccUnitInfo", "Field", _
123123
"TestEnum", "TestEnum_P1", _
124124
"TestType1", "FldA", "FldB", "FldC", _
125125
"TestEnum2", "TestEnum2_P1", "TestEnum2_P2", _
126126
"TestType2", "Fld2A", "Fld2B", _
127127
"RaiseSomething", "EventParam1", _
128+
"Sleep", "dwMilliseconds", _
129+
"RaiseSomething2", "EventParam2", _
128130
"Class_Initialize", _
129-
"AccUnitTestFunct", "FuncParam1", "FuncParam2", "FuncVar1", "FuncVar2", "FuncVar3", "FuncVar4", _
131+
"AccUnitTestFunct", "FuncParam1", "FuncParam2", "FuncVar1", "FuncVar2", "FuncVar3", "FuncVar4", "Dim1", "Dim2", _
130132
"Name1", "Name2", "NewValue", _
131-
"Formatter", "ObjRef")
133+
"PropertySet", "ObjRef", _
134+
"TestMe")
132135

133136
'
134137
m_DeclDict.ImportVBComponent CurrentVbProject.VBComponents("DeclarationDictTestCodemodule")
135138

136139
Set ActualDict = m_DeclDict.Dict
137140

138-
' Dim k As Long
139-
' For k = 0 To m_DeclDict.Count - 1
140-
' Debug.Print m_DeclDict.Dict.Keys(k)
141-
' Next
142-
143141
Assert.That ActualDict.Count, Iz.EqualTo(UBound(ExpectedKeys) + 1), "Count of items"
144142

145143

source/dbs-properties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"Type": 4
102102
},
103103
"NavPane Width": {
104-
"Value": 633,
104+
"Value": 335,
105105
"Type": 4
106106
},
107107
"Never Cache": {

source/modules/DeclarationDict.cls

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ Private Sub AddFromCode(ByVal Code As String, ByVal RegEx As RegExp, ByVal IsPro
218218
Dim i As Long
219219

220220
For Each Match In RegEx.Execute(Code)
221-
If IsProcedure Then Debug.Print Match.Value
222221
For i = 0 To Match.SubMatches.Count - 1
223222
AddWordFromDeclaration Match.SubMatches(i), IsProcedure, IsEnumTypeBlock
224223
Next

0 commit comments

Comments
 (0)