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

Source Generator AnalyzerConfigOptions delete all Property text after the first newline or semicolon #59761

Closed
flo-everett-xero opened this issue Feb 25, 2022 · 2 comments
Assignees
Labels
Area-Compilers Feature - Source Generators Source Generators untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@flo-everett-xero
Copy link

Version Used:
Visual C# Compiler version 3.11.0-4.21602.3 (fc14a13)
Steps to Reproduce:

  1. Add CompilerVisibleProperty to Source Generator consuming project, and define property with a semicolon or newline in it
  2. Reference property from source generator with GeneratorExecutionContext.AnalyzerConfigOptions.GlobalOptions.TryGetValue

Expected Behavior:
Full text of the property should be returned
Actual Behavior:
only text up to the first semicolon or newline is returned. If, for example, the property starts with a newline due to formatting your MSBuild file like

<Project>
  <PropertyGroup>
    <MyProperty>
      This is my property test
   </MyProperty>
 </PropertyGroup>
</Project>

then the value returned will be an empty string

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 25, 2022
@jcouv jcouv added the Feature - Source Generators Source Generators label Feb 25, 2022
@jcouv
Copy link
Member

jcouv commented Feb 25, 2022

Tagging @chsienki for triage.

@chsienki
Copy link
Contributor

Closing as a dupe of #43970

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Feature - Source Generators Source Generators untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

3 participants