-
Notifications
You must be signed in to change notification settings - Fork 49
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
Outline does not capture steps within macro definitions #6
Comments
@thays42 I'll let the development team respond officially, but this can get tricky/impossible quickly. SAS macro language can generate any text in nearly any way and only the SAS macro processor can really reveal that structure -- at run time when all other conditions are evaluated. For example, imagine:
What would you expect to see? Or imagine macro code that generates different steps of SAS code depending on some condition? |
I agree that flexibility of the SAS macro language creates a lot of edge cases. This is something I have been thinking about myself when considering SAS language support for VS Code. I would expect the Outline to point to SAS statements that start steps. I would not expect the Outline to try to do any macro processing so that the Outline works with the code as it appears in the source file. In your example, I would expect the Outline to show a single %MACRO (ideally, it'd show %MACRO - FOO, but that's a separate issue). There are definitely edge cases and there always will be because the macro language is so flexible. Perhaps you can establish and document a set of rules that yield a better outline than the current version offers so users know how the outline works. Perhaps there could be a setting like Outline Behavior that can be set to "Top Level" (current behavior) or "Nested" (proposed behavior). |
I think we provide something like lsp server. Maybe we could outline based that. Leave decision on the code style to the user or their team. |
Or make |
Any steps written within a macro definition do not appear in the Outline. Since macros are a way to group and reuse steps, it would be nice if the outline could show steps and macros within a macro definition.
To replicate, place the following code in a new SAS script:
The Outline looks like this:
It would be great if it could look something like this (mocked up in paint):
I am using v0.0.4 of the extension.
The text was updated successfully, but these errors were encountered: