Skip to content
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

TACL collapses DEF TEXT based on indent, not square brackets #26

Open
Ben-Voris opened this issue Nov 2, 2022 · 3 comments
Open

TACL collapses DEF TEXT based on indent, not square brackets #26

Ben-Voris opened this issue Nov 2, 2022 · 3 comments

Comments

@Ben-Voris
Copy link

Test:

?tacl routine
#frame

[#DEF routine_name ROUTINE |BODY|
  #FRAME
  #OUTPUT [#ROUTINENAME] - testing
  #UNFRAME
]   == end of routine_name

[#DEF help_text TEXT |BODY|
A line that starts in column 1,
and another line that starts at column 1.
  A line that start at column 3.
  Another line that starts at column 3.
    A line that starts at column 5
A final line that starts at column 1.

] == end of help_text

#outputv help_text

routine_name
#unframe

The block collapse arrow should appear on the line containing [#DEF help_text TEXT |BODY| and should collapse all lines until it reaches ] == end of text which is how it works for the block that begins with [#DEF routine_name ROUTINE |BODY| and ends with ] == end of routine_name.

Instead, in a text definition, the block collapse arrows only appear on the indentation changes as show here

image

I don't mind additional block collapse arrows (is that the right term?) but I do think the brackets should always be a block.

Thank you.

@knovichikhin
Copy link
Owner

knovichikhin commented Nov 3, 2022

This extension does not provide folding strategy for TACL sources. This means that VSCode will fallback to indentation based folding strategy. And this is what you see happening.

https://code.visualstudio.com/api/language-extensions/language-configuration-guide#folding

A folding region starts when a line has a smaller indent than one or more following lines, and ends when there is a line with the same or smaller indent.

The answer is to implement folding strategy for TACL that works the way we expect these things to work. That' something I have not found motivation to do in the past.

@Ben-Voris
Copy link
Author

Ben-Voris commented Nov 3, 2022 via email

@knovichikhin
Copy link
Owner

It actually acts exactly as described.

A folding region starts when a line has a smaller indent than one or more following lines, and ends when there is a line with the same or smaller indent.

[#DEF routine_name ROUTINE |BODY| <=== folding region starts because following lines have greater indent
  #FRAME
  #OUTPUT [#ROUTINENAME] - testing
  #UNFRAME
]   == end of routine_name <=== folding region ends because this line is at the same indent as the folding region start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants