Skip to content

Conversation

@jcouv
Copy link
Member

@jcouv jcouv commented Jun 3, 2022

Fixes #61663
Addresses the most urgent scenario in #61094

Corresponding spec update: dotnet/csharplang#6195

FYI @cston @chsienki

@jcouv jcouv self-assigned this Jun 3, 2022
@ghost ghost added the Area-Compilers label Jun 3, 2022
WRN_ObsoleteMembersShouldNotBeRequired = 9042,
ERR_RefReturningPropertiesCannotBeRequired = 9043,

ERR_LineSpanDirectiveRequiresSpace = 9028,
Copy link
Contributor

@cston cston Jun 3, 2022

Choose a reason for hiding this comment

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

ERR_LineSpanDirectiveRequiresSpace = 9028,

Consider moving to line 2074. #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how I got the right number, but in the wrong place... ;-)

<value>The #line directive end position must be greater than or equal to the start position</value>
</data>
<data name="ERR_LineSpanDirectiveRequiresSpace" xml:space="preserve">
<value>The #line span directive requires space before the first parenthesis, before the character offset and before the file name</value>
Copy link
Contributor

@cston cston Jun 3, 2022

Choose a reason for hiding this comment

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

and

It looks like we typically include a comma for three or more items: ", and" #Closed

EOF();
}

[Fact, WorkItem(61663, "https://github.com/dotnet/roslyn/issues/61663")]
Copy link
Contributor

@cston cston Jun 3, 2022

Choose a reason for hiding this comment

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

WorkItem(61663, "#61663")

It feels like the [WorkItem] attribute belongs on the previous test rather than this one. #Closed

}

[Fact, WorkItem(61663, "https://github.com/dotnet/roslyn/issues/61663")]
public void RequireSpace_MissingFilename()
Copy link
Contributor

@cston cston Jun 3, 2022

Choose a reason for hiding this comment

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

RequireSpace_MissingFilename

Is this Incomplete_12? #Resolved

}

[Fact, WorkItem(61663, "https://github.com/dotnet/roslyn/issues/61663")]
public void RequireSpace_MissingFilename_WithoutCharacterOffset()
Copy link
Contributor

@cston cston Jun 3, 2022

Choose a reason for hiding this comment

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

RequireSpace_MissingFilename_WithoutCharacterOffset

Is this Incomplete_11? #Resolved


if (isActive)
{
lineKeyword = CheckFeatureAvailability(lineKeyword, MessageID.IDS_FeatureLineSpanDirective);
Copy link
Contributor

@cston cston Jun 3, 2022

Choose a reason for hiding this comment

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

MessageID.IDS_FeatureLineSpanDirective

Can this MessageID be removed? #Resolved

@cston
Copy link
Contributor

cston commented Jun 3, 2022

Can this resource be removed?


In reply to: 1146180483


In reply to: 1146180483


Refers to: src/Compilers/CSharp/Portable/CSharpResources.resx:6673 in 78cbece. [](commit_id = 78cbece, deletion_comment = False)

For example, this would be valid: `#line(1,2)-(3,4)5"file.cs"`.

In Visual Studio 17.3, the compiler requires spaces before the first parenthesis, the character
offset and the file name.
Copy link
Contributor

@cston cston Jun 3, 2022

Choose a reason for hiding this comment

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

Consider adding a comma: ", and the file name." #Resolved

@jcouv jcouv marked this pull request as ready for review June 3, 2022 17:14
@jcouv jcouv requested a review from a team as a code owner June 3, 2022 17:14
@jcouv
Copy link
Member Author

jcouv commented Jun 3, 2022

@dotnet/roslyn-compiler for second review. Thanks


## Required spaces in #line span directives

***Introduced in .NET SDK 7.0.100, Visual Studio 2022 version 17.3.***
Copy link
Contributor

Choose a reason for hiding this comment

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

.NET SDK 6.0.400?

@jcouv
Copy link
Member Author

jcouv commented Jun 7, 2022

@dotnet/roslyn-compiler for second review. Thanks

@jcouv
Copy link
Member Author

jcouv commented Jun 10, 2022

@dotnet/roslyn-compiler for second review. Thanks

1 similar comment
@jcouv
Copy link
Member Author

jcouv commented Jun 13, 2022

@dotnet/roslyn-compiler for second review. Thanks

@chsienki
Copy link
Member

@jcouv
Copy link
Member Author

jcouv commented Jun 13, 2022

Awesome. Thanks @chsienki

@jcouv jcouv merged commit 65f8ef6 into dotnet:main Jun 13, 2022
@jcouv jcouv deleted the line-space branch June 13, 2022 18:41
@ghost ghost added this to the Next milestone Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require spaces within the enhanced #line directive

4 participants