Posted 14 years ago by Russell Mason
Avatar
Hi

I have a language file that starts:

<SyntaxLanguage Key="MyLanguage" LanguageDefinitionVersion="3.0"
Secure="True" WordContainsAdditionalCharacters="@_"
TokenIDTypeName="MyNamespace.MyTokenIDs, MyAssembly"
xmlns="http://ActiproSoftware/SyntaxEditor/3.0/LanguageDefinition">


...

and an enum that starts:

namespace MyNamespace
{
public enum MyTokenIDs
{

DefaultToken,
WhitespaceToken,

...



but I keep getting the exception:

The language 'MyLanguage' has a TokenIDTypeName however the lexical state 'DefaultState' contains a token 'DefaultToken' and no integer constant on the 'MyNamespace.MyTokenIDs' class could be found with the name 'DefaultToken'.



I know its loading the type because if I change the Type name I get a different 'can't load type' error.

I've tried using a public class with public const int DefaultToken = 1; etc but that gives the same error.

Any ideas as to what I've missed

Thanks
Russell Mason

Comments (3)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It looks like you're doing it correctly. Could you possibly send us a tiny sample project to show the problem and we can debug it for you?


Actipro Software Support

Posted 14 years ago by Russell Mason
Avatar
Hi

I have emailed an example to support@actiprosoftware.com, if you haven't recieved it please let me know.

Thanks
russell Mason
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Russell,

Ok, the problem is simply that the first item in your enum is getting a value of 0 (zero). If you set the first enum item's value to 1, it should work. The value zero is the default ID value and means "no ID value is set" to SyntaxEditor.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.