Skip to content

feat(lsp): getting macro parameters when using ctrl space for custom macros(2129) - #2130

Open
kailas-late wants to merge 18 commits into
mainfrom
pr-issue-2129
Open

kailas-late wants to merge 18 commits into
mainfrom
pr-issue-2129

Conversation

@kailas-late

@kailas-late kailas-late commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary:
This PR adds support for providing parameter information and signature help for custom SAS macros when using Ctrl + Space in the editor.

Key changes:

  • Introduces a shared macro definition parser to identify custom macro definitions, including positional parameters, keyword parameters, default values.
  • Adds a client-side CustomMacroProvider to scan .sas files and supply custom macro definitions to the language server.
  • Automatically refreshes the custom macro information when SAS files are created, modified, opened, closed, or deleted.
  • Enhances the language server to provide completion and signature help for custom macros, including parameter descriptions and source information.
  • Handles macro definitions from the current document.

Resolves #2129.

Testing:

  • Added unit tests for custom macro definition parsing and macro store functionality.
  • Added tests for macro signature help and parameter identification.
  • Updated the client test configuration and test paths to support the new implementation.

How did you test this change?

  • Verify custom macro parameter suggestions using Ctrl + Space.
  • Verify signature help for macros with or without parameters defined in the current SAS file.
  • Verify that macro information refreshes correctly after modifying, renaming, creating, and deleting SAS files.

TODOs:

  • Add any supporting documentation and (optionally) update CHANGELOG.md

@kailas-late
kailas-late marked this pull request as ready for review October 30, 2026 13:30
@kailas-late
kailas-late requested a review from a team as a code owner October 30, 2026 13:30

@ksurajofficial ksurajofficial left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also suggest getting feedback from @2TomLi , since this is specific to the code editor.

Comment thread server/src/sas/CompletionProvider.ts Resolved
Comment thread server/src/sas/SyntaxProvider.ts Resolved
Comment thread client/tsconfig.json Resolved
Comment thread server/src/server.ts Resolved
…macros(2129)

Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Comment thread .vscode/.yarnrc.yml Resolved
Signed-off-by: Kailas Late <dvklate@gmail.com>
@ksurajofficial

Copy link
Copy Markdown
Contributor

Thanks, Kailas, for addressing my queries! Overall, looks good to me. Just one request for a separate doc ticket once testing is complete and the PR is merged: this looks like a good candidate to be part of the documentation, so could you add a GIF of this feature under "Code Completion" in sasCodeEditing?

@kailas-late
kailas-late requested a review from a team November 5, 2026 16:32
…macros(2129)

Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Comment thread server/src/sas/MacroDefinitionParser.ts Resolved
Comment thread server/src/sas/MacroDefinitionParser.ts Resolved
Comment thread server/src/sas/MacroDefinitionParser.ts Resolved
Comment thread server/src/sas/CompletionProvider.ts Resolved
Comment thread server/src/sas/CompletionProvider.ts Resolved
ksurajofficial
ksurajofficial previously approved these changes Nov 11, 2026
@kailas-late kailas-late added the ready for test PR is ready for testing (before merge) label Nov 11, 2026
@kailas-late kailas-late removed the ready for test PR is ready for testing (before merge) label Nov 11, 2026

@yououhan123 yououhan123 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
Signed-off-by: Kailas Late <dvklate@gmail.com>
@kailas-late

Copy link
Copy Markdown
Contributor Author

Thanks again, @ksurajofficial and @yououhan123, for the review, and apologies for the confusion around the scope.

After revisiting the requirements today, I realized that the consumer's requirements cover individual files only, so cross-file/workspace handling is outside the scope of this PR.

I've aligned the implementation accordingly. Could you please take another look when you get a chance? I'd be happy to address any further feedback.

@kailas-late kailas-late added the ready for test PR is ready for testing (before merge) label Nov 13, 2026
@kailas-late kailas-late removed the ready for test PR is ready for testing (before merge) label Nov 13, 2026
@davidbaileync davidbaileync added the ready for test PR is ready for testing (before merge) label Nov 13, 2026
@davidbaileync davidbaileync removed the ready for test PR is ready for testing (before merge) label Nov 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants