Skip to content

#else not formatted in #if'd out code #285

@dpoeschl

Description

@dpoeschl

Ported from TFS WorkItem: 1089196


Repro Steps:

Affected Branch:
Affected Build:
Affected Product Language:

Steps to reproduce:

1. Copy/paste C#:

 

class MyClass
{
    static void Main(string[] args)
    {
#if false
$$

#endif
}
}

 

2. Remove the $$ if necessary and type <enter>#else

 

Expected: #else moved to left alignment

Actual: #else is still indented at method body level


Revisions:

  1. Created By David Poeschl (12/1/2014 1:43:39 PM)

  1. Edited By David Poeschl (12/1/2014 1:44:00 PM)

Note: this may be related to #286 due to parse tree shape


  1. Edited By Kevin Pilch-Bisson (12/2/2014 8:54:54 AM)

1. I don't think this is related to #286, since in C# you already have a "Bad directive trivia" once you have typed the "#".

 

2. This works if you type it on the line immediately after the #if false, but not on subsequent lines.

 

3. Format document doesn't fix it either.


Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions