Repository navigation
feat(data): complete the SAS macro vocabulary - #7
Merged
Merged
Conversation
The macro groups were built from the extension's keyword files alone, which carry only part of the vocabulary - no `%INDEXC`, `%TRANWRD` or `%TRIMN`, and none of the `%BY`, `%TO` or `%INC` keywords. A consumer that needs to tell a SAS-provided macro from an undeclared one is left with a list that reports shipped macros as unknown. Two more sources close the gap: - the language server's `pubsdata` macro lists, which are the same upstream repo and a different shape, and carry the DBCS `%K*`/`%QK*` functions and `%COLORMAC`, `%HELPCLR` and `%VALIDCHS`; - `scripts/supplements.mjs`, a documented list of the names the SAS Macro Language Reference documents and neither upstream copy carries. An upstream row always wins, so the supplement shrinks as upstream fills in. The fetch now mirrors the upstream repo path under `.upstream/`, so a group can read a file from either directory, and the build reads the pubsdata shape alongside the keyword shape. `%QKLOWCASE` is added because upstream ships that name truncated to `%QKLOWCAS`.
allanbowe
approved these changes
Oct 1, 2026
|
🎉 This PR is included in version 0.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the SAS macro vocabulary in the published data.
macroStatementsgoes 32 -> 37 entries andmacroFunctions65 -> 89.Why
The macro groups were built from the extension's keyword files alone, and those carry only part of the vocabulary. Neither
SASMacroStatements.jsonnorSASMacroFunctions.jsonlists%INDEXC,%INDEXW,%QINDEX*,%TRANWRD,%TRANSLATE,%TRIMN,%QBQUOTEor%QDEQUOTE, and neither lists the%BY,%TOor%INCkeywords. A consumer that needs to tell a SAS-provided macro from an undeclared one - thenoUndeclaredMacrosrule in@sasjs/lint- is left with a list that reports shipped macros as unknown.What changed
A second upstream source. The language server ships the same vocabulary a second time under
server/pubsdata/, in a different shape. It is the same upstream repo, so it is fetched and merged rather than duplicated:server/pubsdata/Functions/en/macro.jsonadds%KCMPRES,%KINDEX,%KLEFT,%KLENGTH,%KSCAN,%KSUBSTR,%KUPCASE,%QKCMPRES,%QKLEFT,%QKSCAN,%QKSUBSTR,%QKUPCASEand%VALIDCHS;server/pubsdata/Statements/en/macro.jsonadds%COLORMACand%HELPCLR.scripts/fetch-upstream.mjsnow mirrors the upstream repo path under.upstream/, so a group can read a file from either directory, andscripts/build.mjsreads the pubsdata shape alongside the keyword shape. The pubsdata descriptions become hover text.A documented supplement.
scripts/supplements.mjsholds the names the SAS Macro Language Reference documents and neither upstream copy carries:%BY,%TOand%INC;%INDEXC,%INDEXW,%QBQUOTE,%QDEQUOTE,%QINDEX,%QINDEXC,%QINDEXW,%TRANSLATE,%TRANWRD,%TRIMN; and%QKLOWCASE, which upstream ships truncated to%QKLOWCASin bothSASMacroFunctions.jsonandSASAutocallMacros.json.An upstream row always wins, so the supplement shrinks on its own as upstream fills the gaps - it is a bridge, not a second source of truth.
Verification
npm test: 15 tests pass, including a new one asserting the macro groups carry the names above.npm run lint(prettier): clean.npm run fetch -- --ref <pinned>plusnpm run buildleavesdata/,provenance.jsonandsrc/groups.generated.tsunchanged, which is the condition CI enforces.