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

Add support for "data" properties #44883

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a6d4e3d
Add support for "data" properties
agocke Jun 5, 2020
1c1eaff
Fix formatting
agocke Jun 12, 2020
d2e9a99
Re-run generation
agocke Jun 12, 2020
cd706d4
Assert that verification fails due to init-only
agocke Jun 13, 2020
6dd0515
Use GetDeclaredMemberSymbol
agocke Jun 16, 2020
0681aa4
Increase stack size limit in Debug configuration
agocke Jun 16, 2020
4dfdccf
Also increase Mac stack size limit
agocke Jun 16, 2020
df74574
Merge branch 'master' into data-properties
agocke Jun 16, 2020
3911c07
Respond to PR comments
agocke Jun 16, 2020
49ea38c
Respond to PR comments
agocke Jun 18, 2020
d8aa614
Add tests for XML doc comments
agocke Jun 18, 2020
2965a7e
Add more IL printing
agocke Jun 18, 2020
045d797
Merge remote-tracking branch 'upstream/master' into data-properties
agocke Jun 18, 2020
2db4a74
Mark unverifiable
agocke Jun 18, 2020
35e4770
Add test for unsafe context
agocke Jun 18, 2020
569aa4a
Adapt to the refactoring of SourcePropertySymbol
agocke Jun 26, 2020
54f82ac
Merge remote-tracking branch 'upstream/master' into data-properties
agocke Jun 26, 2020
e64a470
Clean up PublicApi file
agocke Jun 26, 2020
cfdc293
Remove unchanged files
agocke Jun 26, 2020
649fe6e
Audit additional uses of PropertyDeclarationSyntax and add handling f…
agocke Jun 26, 2020
61cc3d6
Respond to PR comments
agocke Jun 26, 2020
35d6d86
Add ref tests
agocke Jun 27, 2020
f4520d7
Fix formatting
agocke Jun 29, 2020
dbb82a3
Use old style for GlobalSuppression.cs
agocke Jun 29, 2020
56c92ca
Merge remote-tracking branch 'upstream/master' into data-properties
agocke Jun 29, 2020
dfb4de6
Respond to PR comments
agocke Jun 30, 2020
8844778
Respond to PR comments
agocke Jul 1, 2020
4148a43
Merge remote-tracking branch 'upstream/master' into data-properties
agocke Jul 1, 2020
0c38cc8
Explicitly fail verification
agocke Jul 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Compilers/CSharp/Portable/CSharpExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,15 @@ public static Conversion ClassifyConversion(this SemanticModel? semanticModel, i
return csmodel?.GetDeclaredSymbol(declarationSyntax, cancellationToken);
}

/// <summary>
/// Given a syntax node that declares a data property, get the corresponding declared symbol.
/// </summary>
public static IPropertySymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, DataPropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Copy link
Contributor

Choose a reason for hiding this comment

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

GetDeclaredSymbol [](start = 39, length = 17)

Are we testing this method?

{
var csmodel = semanticModel as CSharpSemanticModel;
return csmodel?.GetDeclaredSymbol(declarationSyntax, cancellationToken);
}

/// <summary>
/// Given a syntax node that declares an indexer, get the corresponding declared symbol.
/// </summary>
Expand Down
59 changes: 31 additions & 28 deletions src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema

Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple

There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -4612,7 +4612,7 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
-instrument:TestCoverage Produce an assembly instrumented to collect
coverage information
-sourcelink:&lt;file&gt; Source link info to embed into PDB.

- ERRORS AND WARNINGS -
-warnaserror[+|-] Report all warnings as errors
-warnaserror[+|-]:&lt;warn list&gt; Report specific warnings as errors
Expand Down Expand Up @@ -6280,4 +6280,7 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_DoesNotOverrideMethodFromObject" xml:space="preserve">
<value>'{0}' does not override the method from 'object'.</value>
</data>
<data name="IDS_FeatureDataProperties" xml:space="preserve">
<value>data properties</value>
</data>
</root>
Loading