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

Failure to indent properly on some cases #57

Open
LuizZak opened this issue Jun 7, 2015 · 1 comment
Open

Failure to indent properly on some cases #57

LuizZak opened this issue Jun 7, 2015 · 1 comment

Comments

@LuizZak
Copy link

LuizZak commented Jun 7, 2015

The automatic indentation works as expected when writing a new rule, adding spaces when adding new lines, but in some cases the indent is not behaving properly, or not working at all.

The following grammar file exhibits odd indenting behavior at a few points:

grammar Test;

options
{
    language=CSharp;
}

testRule1 #point 1#: 'a';

testRule2 #point 2#: 'b'#point 3#

When adding a new line on #point 1#, the next line is not indented at all.
When adding a new line on #point 2#, the next line is indented by two spaces only.
When adding a new line on #point 3#, the next line is indented to align to the 'b' on the line above

When trying to write a new rule at the bottom of the file it indents by a tab when adding new lines.

This behavior occurs when using the unreleased extension that has support on VS 2015, I haven't tested on 2013, though.

@sharwell
Copy link
Member

sharwell commented Jun 7, 2015

Certainly some strange behavior going on here. I don't think I'm going to be able to fix it prior to the next release without delaying the new Visual Studio 2015 support.

Point 3 in your example is actually doing the correct thing, but the other two are not. The difference between the behavior of point 1 and 2 is the inclusion (or omission) of the ; at the end of the line.

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