Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3ddd8a3
refactoring: split reader from dict to implement different readers + …
josef-poetzl Jun 29, 2025
2607f7f
Implemented: add members to dict (thanks to @hrschupp - see commit ht…
josef-poetzl Jun 29, 2025
49c6b68
upd. example file
josef-poetzl Jun 29, 2025
aa3bb78
minor code refactoring
josef-poetzl Jul 4, 2025
dc3ab7a
Fix ToString and GetWordVariations edge cases; adapt tests to reader
josef-poetzl Nov 21, 2026
42945f0
Update VCS add-in options, gitignore and add agent docs
josef-poetzl Nov 21, 2026
11b5eae
Switch VCS export to format 5.1.0
josef-poetzl Nov 21, 2026
6c6743c
Bump version to 0.6.0
josef-poetzl Nov 21, 2026
339a11e
Merge pull request #10 from AccessCodeLib/dev
josef-poetzl Nov 21, 2026
a0e35f0
Merge branch 'AccessCodeLib:main' into core
josef-poetzl Nov 21, 2026
6d0aad8
Document IncludeUsedMembers in RunVcsCheck API docs
josef-poetzl Nov 21, 2026
c26aef6
Merge pull request #11 from AccessCodeLib/dev
josef-poetzl Nov 21, 2026
e19c341
Update GitHub Actions to Node 24 versions
josef-poetzl Nov 21, 2026
0f03b9f
Merge pull request #12 from AccessCodeLib/update-actions-node24
josef-poetzl Nov 21, 2026
bb69886
Update README.md
josef-poetzl Apr 26, 2025
104d4dd
add add-in components, change license for add-in from MIT to GPL
josef-poetzl Apr 26, 2025
a9b74ae
clean up (remove Module1.bas)
josef-poetzl Apr 26, 2025
46b500b
Update README.md
josef-poetzl Apr 26, 2025
495b03e
Create build-for-release.yml
josef-poetzl May 30, 2025
af3b8d6
adapt: core => add-in file
josef-poetzl Jun 20, 2025
bc0ca04
fix core => add-in file
josef-poetzl Jun 20, 2025
dce12c0
fix: core -> add-in
josef-poetzl Jun 20, 2025
89405d0
fix rebase issue
josef-poetzl Jun 29, 2025
c565715
feat: switch VCS export to format 5.1
josef-poetzl Nov 21, 2026
aaaa7c2
Merge branch 'AccessCodeLib:main' into core
josef-poetzl Nov 21, 2026
53eb57d
chore: set VCS MCP options (allow RunVBA, deny ExecuteSQL)
josef-poetzl Nov 21, 2026
0578dce
chore: remove startup form from dev source (set by release build)
josef-poetzl Nov 21, 2026
8ae2736
build: set startup form via deployment/AddIn-Config.json (release only)
josef-poetzl Nov 21, 2026
4625201
Merge branch 'core' into add-in-dev
josef-poetzl Nov 21, 2026
d4eb71f
Merge branch 'main' into add-in-dev (keep add-in-dev content)
josef-poetzl Nov 21, 2026
a1591f5
docs: describe branch conventions in README
josef-poetzl Nov 21, 2026
e20068a
chore: bump add-in version to 0.6.0
josef-poetzl Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-accdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: "Checkout code for release tag"
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ github.event.release.tag_name }}

Expand Down Expand Up @@ -58,14 +58,14 @@ jobs:
timeout-minutes: 10

- name: "Upload Build Artifact"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
id: "upload"
with:
name: "Install files"
path: "./bin/*"
if-no-files-found: warn
- name: "Attestation"
uses: actions/attest-build-provenance@v2
uses: actions/attest-build-provenance@v4
with:
subject-name: "Install files"
subject-digest: sha256:${{ steps.upload.outputs.artifact-digest }}
7 changes: 4 additions & 3 deletions .github/workflows/build-release-zip-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: "Checkout code for release tag"
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ github.event.release.tag_name }}

Expand All @@ -26,6 +26,7 @@ jobs:
source-dir: "source"
target-dir: "bin"
file-name: "ACLibDeclarationDict.accda"
app-config: "deployment/AddIn-Config.json"
run-accunit-tests: true
timeout-minutes: 10

Expand All @@ -46,7 +47,7 @@ jobs:
echo "ZIP_NAME=$zipName" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: "Upload ZIP to GitHub Release"
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v3
with:
files: ${{ env.ZIP_NAME }}
env:
Expand All @@ -63,7 +64,7 @@ jobs:
echo "digest=$digest" >> $env:GITHUB_OUTPUT

- name: "Attestation"
uses: actions/attest-build-provenance@v2
uses: actions/attest-build-provenance@v4
id: attestation
with:
subject-name: "${{ env.ZIP_NAME }}"
Expand Down
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gitattributes template for Microsoft Access database source files
# gitattributes template for Microsoft Access database source files
# Website: https://github.com/joyfullservice/msaccess-vcs-addin
#

Expand All @@ -13,14 +13,22 @@

# The local VCS index file is paired with the binary database file
# and should not be comitted to version control.
vcs-index.json
vcs-index.*

# Ignore any dotenv files (used for external database connections)
*.env
logs/
test-results/
.env.*
!.env*.example

# Ignore log files generated by the VCS Add-in
# Comment out the following line if you wish to include log files in git.
*.log

#other files
# others
*.dll
*.zip

# don't commit dict files in this repository
*.accd[ab].DeclarationDict.txt
6 changes: 4 additions & 2 deletions Example_APIusage.accdb.src/modules/_LoadAddIn.bas
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ Option Explicit

Public Sub LoadAddIn()

'API: RunVcsCheck(Optional ByVal OpenDialogToFixLettercase As Boolean = False)
'API: Public Function RunVcsCheck(Optional ByVal OpenDialogToFixLettercase As Boolean = False, _
' Optional ByVal DeclDictFilePath As String = vbNullString, _
' Optional ByVal IncludeUsedMembers As Boolean = False) As Variant

Dim AddInCallPath As String
AddInCallPath = CurrentProject.Path & "\ACLibDeclarationDict.RunVcsCheck"

Dim Result As Variant
Result = Application.Run(AddInCallPath, True)
Result = Application.Run(AddInCallPath, True, vbNullString, True)
If Result = True Then
Debug.Print "No problems with letter case"
Else
Expand Down
2 changes: 1 addition & 1 deletion Example_APIusage.accdb.src/vcs-options.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Info": {
"AddinVersion": "4.1.2",
"AddinVersion": "4.1.3",
"AccessVersion": "16.0 64-bit"
},
"Options": {
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ACLib Declaration Dictionary

This Add-In lists all VBA declarations (variables, function names, constants, etc.) and ensures consistent letter case.

The idea was born from a discussion ([msaccess-vcs-add-in: issue 599](https://github.com/joyfullservice/msaccess-vcs-addin/issues/599)) about the behavior of the VBA editor, which adapts each existing declaration to the last written capitalization of the same word. This leads to many unnecessary changes in commits when using a version control system.
Expand All @@ -7,16 +8,29 @@ The idea was born from a discussion ([msaccess-vcs-add-in: issue 599](https://gi


# ACLibDeclarationDictionaryCore

Core components: https://github.com/AccessCodeLib/ACLibDeclarationDictionaryCore

## Branches

| Branch | Purpose |
|---|---|
| `main` | Release line of this add-in |
| `add-in-dev` | Development of the add-in |
| `core` | Mirror of the `main` branch of ACLibDeclarationDictionaryCore |

Core changes are developed in the Core repository and taken over 1:1 into this repository; add-in specific code is added on top.
Core updates are merged, not rebased: `core` is updated from Core `main`, then merged into `add-in-dev` (preferably via a `feature/core-<version>` branch and a pull request).

## API

### RunVcsCheck([OpenDialogToFixLettercase], [DeclDictFilePath]) As Variant
### RunVcsCheck([OpenDialogToFixLettercase], [DeclDictFilePath], [IncludeUsedMembers]) As Variant
Compare lettercase from CurrentVbProject with saved file dictionary items

#### Parameters
- OpenDialogToFixLettercase - (Boolean) - Open dialog to fix lettercase
- DeclDictFilePath - (String) - use alternative dictionary file path
- IncludeUsedMembers - (Boolean) - also add used members to the dictionary (default: False)

#### Returns
- Boolean (True) ... if DiffCount = 0
Expand All @@ -35,4 +49,4 @@ End If
```

### RunVcsCheckDialog()
Equal to RunVcsCheck(True)
Equal to RunVcsCheck(True, , True)
50 changes: 41 additions & 9 deletions Tests/ACLibDeclarationDict/DeclarationDictTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ Public Sub ImportCode_InsertCodeLine_CheckKeys(ByVal Code As String, ByVal Expec

Dim Actual As String

m_DeclDict.ImportCode Code
With New CodemoduleDeclarationReader
.ImportCode Code, m_DeclDict
End With
'm_DeclDict.ImportCode Code
Actual = Join(m_DeclDict.WordsDict.Keys, "|")

Assert.That Actual, Iz.EqualTo(Expected)
Expand All @@ -73,7 +76,9 @@ Public Sub ImportCode_Issue4_MultiDimArrayDeclaration(ByVal Code As String, ByVa

Dim Actual As String

m_DeclDict.ImportCode Code
With New CodemoduleDeclarationReader
.ImportCode Code, m_DeclDict
End With
Actual = Join(m_DeclDict.WordsDict.Keys, "|")

Assert.That Actual, Iz.EqualTo(Expected)
Expand All @@ -89,7 +94,9 @@ Public Sub ImportCode_InsertCodeLines_CheckKeys(ByVal Code As String, ByVal Expe

Dim Actual As String

m_DeclDict.ImportCode Code
With New CodemoduleDeclarationReader
.ImportCode Code, m_DeclDict
End With
Actual = Join(m_DeclDict.WordsDict.Keys, "|")

Assert.That Actual, Iz.EqualTo(Expected)
Expand All @@ -101,7 +108,9 @@ Public Sub ImportCode_Issue3_RemovingCommentCorruptsLineEndings(ByVal Code As St

Dim Actual As String

m_DeclDict.ImportCode Code
With New CodemoduleDeclarationReader
.ImportCode Code, m_DeclDict
End With
Actual = Join(m_DeclDict.WordsDict.Keys, "|")

Assert.That Actual, Iz.EqualTo(Expected)
Expand All @@ -114,7 +123,9 @@ Public Sub ImportCode_Pullrequest8_LineLabel(ByVal Code As String, ByVal Expecte

Dim Actual As String

m_DeclDict.ImportCode Code
With New CodemoduleDeclarationReader
.ImportCode Code, m_DeclDict
End With
Actual = Join(m_DeclDict.WordsDict.Keys, "|")

Assert.That Actual, Iz.EqualTo(Expected)
Expand All @@ -135,7 +146,9 @@ Public Sub ImportCode_API_CheckKeys(ByVal Code As String, ByVal Expected As Stri
' RegEx.Pattern = "(?:Declare)\s(Function|Sub)\s([^ ]*)[^(]*\("
' Actual = RegEx.Replace(Code, "$1 $2(")

m_DeclDict.ImportCode Code
With New CodemoduleDeclarationReader
.ImportCode Code, m_DeclDict
End With
Actual = Join(m_DeclDict.WordsDict.Keys, "|")

Assert.That Actual, Iz.EqualTo(Expected)
Expand All @@ -156,7 +169,9 @@ Public Sub ImportCode_EnumCode_CheckKeys()

Const Expected As String = "xyz|en1|en2|x|y"

m_DeclDict.ImportCode Code
With New CodemoduleDeclarationReader
.ImportCode Code, m_DeclDict
End With
Actual = Join(m_DeclDict.WordsDict.Keys, "|")

Assert.That Actual, Iz.EqualTo(Expected)
Expand All @@ -177,7 +192,9 @@ Public Sub ImportCode_TypeCode_CheckKeys()

Const Expected As String = "xyz|F1|F2|x|y"

m_DeclDict.ImportCode Code
With New CodemoduleDeclarationReader
.ImportCode Code, m_DeclDict
End With
Actual = Join(m_DeclDict.WordsDict.Keys, "|")

Assert.That Actual, Iz.EqualTo(Expected)
Expand Down Expand Up @@ -211,7 +228,9 @@ Public Sub ImportClassCodeModule_CheckKeysExists()
"TestPullrequest8_LineLabels", "ExitHere", "ErrHandler")


m_DeclDict.ImportVBComponent CurrentVbProject.VBComponents("DeclarationDictTestCodemodule")
With New CodemoduleDeclarationReader
.ImportVBComponent CurrentVbProject.VBComponents("DeclarationDictTestCodemodule"), m_DeclDict
End With

Set ActualDict = m_DeclDict.WordsDict

Expand All @@ -224,3 +243,16 @@ Public Sub ImportClassCodeModule_CheckKeysExists()

End Sub

Public Sub ToString_AddWords_OutputVariations()

m_DeclDict.AddWord "Test"
m_DeclDict.AddWord "test"
m_DeclDict.AddWord "xyz"
m_DeclDict.AddWord "xyz"

Dim Actual As String
Actual = m_DeclDict.ToString(False)

Assert.That Actual, Iz.EqualTo("Test:Test|test")

End Sub
9 changes: 9 additions & 0 deletions deployment/AddIn-Config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"DatabaseProperties": [
{
"Name": "StartUpForm",
"Type": 10,
"Value": "InstallAddInForm"
}
]
}
99 changes: 99 additions & 0 deletions source/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# AGENTS.md - Working With Exported Microsoft Access Source Files

This folder is a Microsoft Access database exported to text files by the MSAccess
VCS add-in. Editing these files is how you change the database, but edits only
take effect when the add-in imports them back in Access. You cannot run or test
this code directly, and the add-in is required to build a working database from it.

This file and everything under `vcs-agent-docs/` are generated by the add-in and
**rewritten on every export**. Keep your own project notes elsewhere.

## Non-negotiable rules

1. **Do not change file encoding.** Source files are UTF-8, and most are UTF-8
*with BOM* (bytes `EF BB BF`). Re-saving without the BOM makes import fail or
silently corrupt the object.
2. **Do not change line endings.** Access `LoadFromText` requires CRLF (`\r\n`).
3. **Do not edit** `vcs-index.idx` (binary change index), `.frx` files (binary OLE
data), or `.thmx` files (ZIP archives — edit the extracted contents instead).
4. **Do not rename a file** without changing the object name stored inside it.
File names must match object names exactly.
5. **Do not alter VBA scaffolding:** `Attribute VB_Name` lines, the
`VERSION`/`BEGIN`/`END` block at the top of a `.cls`, or module-level
`Attribute VB_*` lines. The code below them is yours to edit.

## Which file do I edit?

| To change | Edit | Read first |
|---|---|---|
| VBA in a standard module | `modules/<name>.bas` | `vcs-agent-docs/vba-modules.md` |
| VBA in a class module | `modules/<name>.cls` | `vcs-agent-docs/vba-modules.md` |
| Form or report code-behind | `forms/<name>.cls`, `reports/<name>.cls` | `vcs-agent-docs/vba-modules.md` |
| Form or report layout | `forms/<name>.form`, `reports/<name>.report` | `vcs-agent-docs/forms-reports.md` |
| Conditional formatting rules | the form's or report's companion `.json` | `vcs-agent-docs/forms-reports.md` |
| Query logic | `queries/<name>.sql` — the sole source of truth for SQL | `vcs-agent-docs/queries.md` |
| Query properties or design layout | `queries/<name>.json` | `vcs-agent-docs/queries.md` |
| A macro | `macros/<name>.macro` | — |
| A table definition | `tbldefs/<name>.xml` and `.json` | — |
| A connection string | `.env` at this folder's root (gitignored) | `vcs-agent-docs/troubleshooting.md` |
| Tests | a test module under `modules/` | `vcs-agent-docs/testing.md` |

Export format 5.0.0 renamed several object types from the overloaded `.bas`
extension: forms to `.form`, reports to `.report`, macros to `.macro`, and queries
to `.sql` plus `.json`. Older projects still use `.bas` for these, so check which
extensions are actually present. Import accepts both.

## File placement follows the `@Folder` annotation

The add-in reads Rubberduck-style `'@Folder("Category")` annotations and exports
components into matching subdirectories, with dots as path separators:
`'@Folder("Components.ADP")` lands in `modules/Components/ADP/`. Components with no
annotation stay at the root of `modules/`, `forms/`, or `reports/`. Import scans
subdirectories recursively.

**The annotation decides where the file belongs on disk, not the folder you happen
to be editing in.** This is the most common way agents corrupt a project:

- For modules, the annotation is in the `.bas` or `.cls` itself. For forms and
reports it lives in the `.cls` code-behind only — not in `.form`/`.report`,
`.json`, or `.svg`.
- Before creating or moving a component, search the **entire** `modules/`, `forms/`,
or `reports/` tree for an existing file with the same base name (for modules,
match on `Attribute VB_Name`). Edit that file in place rather than creating a
second copy elsewhere.
- If two copies exist, such as `modules/modFoo.bas` and `modules/Tests/modFoo.bas`,
build imports **both** and the last one silently wins. No error is shown.
- Build removes a misplaced duplicate automatically when exactly one copy sits in
its annotation-derived folder. Ambiguous cases are left alone with a warning.
Removing a duplicate form or report deletes its whole source group together
(`.form`/`.report` plus `.cls`, `.json`, and `.svg`).

To relocate a component, change its `'@Folder` annotation and let the next export
move the file.

## Where the details live

Each of these is short. Read the matching one before making that kind of change.

| File | Read it before |
|---|---|
| `vcs-agent-docs/vba-modules.md` | Editing any `.bas` or `.cls`, or adding a member attribute |
| `vcs-agent-docs/forms-reports.md` | Editing a `.form` or `.report` layout, or conditional formatting |
| `vcs-agent-docs/queries.md` | Editing anything in `queries/` |
| `vcs-agent-docs/testing.md` | Writing, running, or filtering tests |
| `vcs-agent-docs/troubleshooting.md` | An import, build, or compile failed, or you need the log files |

## How changes get back into Access

Ask the user to run a **merge build** from the add-in ribbon, which imports changed
source files into the existing database. A **full build** creates a new database
from source instead, and **export** goes the other way, writing database objects
out to these files. When a source file and its database object have both changed,
the add-in detects the conflict and prompts the user to choose which version wins.

## More information

- [MSAccess VCS Add-in](https://github.com/joyfullservice/msaccess-vcs-addin)
- [Wiki: Export-Import File Types](https://github.com/joyfullservice/msaccess-vcs-addin/wiki/Export-Import-File-Types)
- [Wiki: Supported Objects](https://github.com/joyfullservice/msaccess-vcs-addin/wiki/Supported-Objects)
- [Wiki: Options](https://github.com/joyfullservice/msaccess-vcs-addin/wiki/Options)
Loading