Get / End Get doesn't get highlighted

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Irwin
Posts: 88
Joined: Wed Mar 23, 2022 10:24 am
Location: España

Get / End Get doesn't get highlighted

Post by Irwin »

Hi Chris,

The words "Get" and "Set" are not being highlighted with the new version. eg:

Code: Select all

Get
   return _myProperty
End Get

Set
   _myProperty := value
End Set
User avatar
Chris
Posts: 5010
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Get / End Get doesn't get highlighted

Post by Chris »

Hi Irwin,

Seems to work here. Are those inside a PROPERTY...END PROPERTY statement?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Irwin
Posts: 88
Joined: Wed Mar 23, 2022 10:24 am
Location: España

Re: Get / End Get doesn't get highlighted

Post by Irwin »

Chris wrote: Mon Dec 30, 2024 10:17 pm Hi Irwin,

Seems to work here. Are those inside a PROPERTY...END PROPERTY statement?
Hi Chris, I've detected my error. I was declaring an "Instance" property but that's not a valid identifier (although the compiler does not complain at all :)). I've solved the issue typing @@ before my identifier.

Code: Select all

   Static Property @@Instance As MyClass
      Get
         If _instance != Null
            Throw InvalidOperationException{"Class not initialized."}
         EndIf
         Return _instance
      End Get
   End Property
thanks!
User avatar
Chris
Posts: 5010
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Get / End Get doesn't get highlighted

Post by Chris »

Hi Irwin,

Ah, OK, it's a bug in XIDE then, will make it accept "Instance" as a property name. Normally INSTANCE is a modifier synonym to PROTECT(ED), but it's fine to use it as a property name, too.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply