Internal and external names

SyntaxEditor for Windows Forms Forum

Posted 9 years ago by Joe
Avatar
Hello again!
Is there a possibility to make differences between internal and external names?
I'd sometimes like to use different words in my code then the words shown to the user.

Comments (5)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Joe,

That is not an easy thing to do because it would involve combining your lexical parser with your semantic parse data. At this time we don't really have a good solution for that sort of thing, however you could possibly make it work if you are using a dynamic language and then set the DynamicToken.CustomHighlightingStyle property on the tokens that should have a customized style. That property will override the token's default style so could be useful for this sort of thing.


Actipro Software Support

Posted 9 years ago by Joe
Avatar
Hi!
I now use Localization to do that sort of thing.
The IntelliPrompt MemberList works fine now, but I've still problems with the Highlighting.
This is the method I use for changing the language.

        public void UpdateLanguage()
        {
            this.editor.Document.Language.IsUpdating = true;
            if (Thread.CurrentThread.CurrentUICulture.Name.Equals("en"))
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr");
                language = new OwnSyntaxLanguage();
            }
            else
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
                language = new OwnSyntaxLanguage();
            }
            this.editor.Document.Language.IsUpdating = false;
        }
Maybe you can tell me if there is a misstake or where I have to search for the misstake.
The rest of my program is similar to the SimpleAddOn-Language.

Regards, Joe
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Joe,

Sorry but I'm not sure exactly what you are trying to do there. If you are trying to update the language in use by the editor then you don't need IsUpdating calls (those are only needed if you are modifying the language), and you'd set "editor.Document.Language" to your "new OwnSyntaxLanguage()".


Actipro Software Support

Posted 9 years ago by Joe
Avatar
Hey!
Well...probably I'm also not sure what I'm trying to do. :)
I read some threads and I found the IsUpdating property.
I just like to update the current culture I use. The member lists are right (without using the isUpdate property) but the HighlightingStyles don't change.
So I thought I have to set the IsUpdating property to true.
But probably I have a misstake anywhere else.
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Joe,

I'm not sure how your language is set up or if you have more than one language, such as ones for different cultures. But again if you have two different languages (one for English and one for non-English), then you'd need to set the editor.Document.Language property to a new instance of the language instance you want to use. That will reparse the document (update highlighting too). And no IsUpdating calls are needed in that case.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.