RE: C# 11 multiline strings

Hi! In a question you asked, I read you are using JetBrains Rider with RemObjects Elements/C#.
Do you have any experience with this? You use RO Elements longer than me.

Syntax highlighting worked out-of-the-box. I‘m currently looking into adding
code completion support by adding code definition files. Like:

#if !ISLAND && !TOFFEE
namespace RemObjects
{
    namespace Elements.RTL
    {

        public class Object
        {
        }

        public class String
        {
        }

        //public class string {}
        public class Void
        {
        }

        public class AnsiChar
        {
        }

        public class Int32
        {
        };

        public class List<T>
        {
            public extern Void Add(string s);
        }
    }


        public static class Console //: RemObjects.Elements.System.Object
        {
            public static extern RemObjects.Elements.RTL.Void Write(RemObjects.Elements.RTL.String s);
            public static extern RemObjects.Elements.RTL.Void Write(RemObjects.Elements.RTL.Object s);
            public static extern RemObjects.Elements.RTL.Void Write();
            public static extern RemObjects.Elements.RTL.Void WriteLine(RemObjects.Elements.RTL.String s);
            public static extern RemObjects.Elements.RTL.Void WriteLine(RemObjects.Elements.RTL.Object s);
            public static extern RemObjects.Elements.RTL.Void WriteLine();
            public static extern RemObjects.Elements.RTL.AnsiChar ReadChar();

            public static extern RemObjects.Elements.RTL.String ReadLine();
            //protected this .();
        }
}
#endif

This works fine. Code completion for Console. is available.

Maybe you already got something going, so I don‘t have to re-invent the wheel?

Thanks,
…Danilo

Hi, good to see a familiar face - unfortunately I don’t use REMObjects’ version of C# within JetBrains Rider because it does not have parity with more recent versions of MS C# such as ‘Collection Expressions’ among other things.

Old way:

    int[] array = new int[]{1, 2, 3, 4};
    List<int> list = new List<int>(){1, 2, 3, 4};
    Span<int> span = new Span<int>(array);
    HashSet<int> hashSet = new HashSet<int>{1, 2, 3, 4};

New way using Collection Expressions will not compile in REMObject’s C#:

    int[] array = [1, 2, 3, 4];
    List<int> list = [1, 2, 3, 4]; 
    Span<int> span = [1, 2, 3, 4];
    HashSet<int> hashSet = [1, 2, 3, 4];

Okay, thanks for your answer! :+1:

RO C# is only C# 11 (without multiline strings),
so collection expressions don‘t work yet.

Maybe they update to C# 12 in the future,
I also like collection expressions.

EDIT: multiline strings are working now, after update 12.0.0.2959 :grinning:

Those are fully dfunctional in today build, 2963, btw.

Which ones is that?

Yeah, we strive to add all/most of the new features soon, where sensible and applicable.

1 Like

Thanks! :pray:

Primary constructors are also nice. It saves a lot of constructor code like
this.x = x;
this.y = y;
this.z = z;

Think these are already on the list; i’ll see what we can do to prioritize them.

Jesus wept. The C# team needs to stop trying to “learn” from Swift…

1 Like

:rofl: :+1:

1 Like