| Summary: | C# importer doesn't support properties | ||
|---|---|---|---|
| Product: | [Applications] umbrello | Reporter: | UnremarkableGuy <badpointer0> |
| Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | okellogg |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | All | ||
| Latest Commit: | https://invent.kde.org/sdk/umbrello/commit/47e8a38a28f02bbafd437fb4038e055249d4441b | Version Fixed/Implemented In: | 2.33.80 (KDE releases 22.03.80) |
| Sentry Crash Report: | |||
Git commit 47e8a38a28f02bbafd437fb4038e055249d4441b by Oliver Kellogg.
Committed on 12/02/2022 at 13:44.
Pushed by okellogg into branch 'master'.
Finalize "C#: Windows Forms classes are not imported" and fix "C# importer doesn't support properties"
umbrello/codeimport/csharp/csharpimport.{h,cpp}
- Reimplement function preprocess(QString&); from NativeImportBase,
currently only to discard preprocessor lines.
Reason: If we don't do this then preprocessor lines are forwarded to
the m_source token stream which creates problems on parsing.
umbrello/codeimport/csharp/csharpimport.cpp
- Cosmetic change in function joinTypename: Use lookAhead() in place of
m_source[m_srcIndex + 1].
- In function resolveClass first call
findObject(className, currentScope())
and if this returns non null then return the found object.
- In function parseStmt :
- Before testing isTypeDeclaration(keyword), while
isClassModifier(keyword) returns true assign advance() to keyword.
- Simplify if-statement testing isTypeDeclaration(keyword), use
`keyword' in place of nextKeyword.
- Remove handling of keyword "#", this is obsoleted by reimplementing
preprocess(QString&).
- Before expecting `keyword' to be a type name advance over possible
modifiers using isCommonModifier(keyword).
- In handling of nextToken "(", do not try resolving the return type
if it is "void". In this case set typeName empty to avoid creation
of a bogus type for "void".
- Before handling a data member declaration add handling of nextToken
"{" (property).
Related: bug 449268
FIXED-IN:2.33.80 (KDE releases 22.03.80)
M +72 -44 umbrello/codeimport/csharp/csharpimport.cpp
M +4 -2 umbrello/codeimport/csharp/csharpimport.h
https://invent.kde.org/sdk/umbrello/commit/47e8a38a28f02bbafd437fb4038e055249d4441b
Git commit 9ac2ebbb56cea9d7f26d5dd4b2003187ddc5c842 by Oliver Kellogg. Committed on 19/02/2022 at 20:18. Pushed by okellogg into branch 'master'. test/import/csharp/properties.cs : New file tests C# properties. A +24 -0 test/import/csharp/properties.cs https://invent.kde.org/sdk/umbrello/commit/9ac2ebbb56cea9d7f26d5dd4b2003187ddc5c842 |
C# importer fails to parse property1 properly and doesn't import property2 and property3 at all public class TestClass { public int property1 { get; set; } public int property2 { get; set; } public int property3 { get; set; } }