Misbah M. Awan
Misbah M. Awan

Reputation: 5

XTEXT web editor - custom highlighting in Eclipse Ace

enter image description here

I need guidance about how to use custom highlighting in xtext web editor. I am using eclipse Ace for this.

Actually, I need to highlight or change color of the text where user enters duplicate names.

Regards.

Define Top-Package {

}


Define Timing {
    UUID: "hello"
    SHORT-NAME: "xecutionTiming"
    CATEGORY: ""
    NAME: "iram"
    TRACEABLE-SPECIFICATION-REFS: ""
    Define Constraints {
            Define Execution-Time-Constraint {
            UUID: ""
            SHORT-NAME: "WiperCtrlBasic"
            CATEGORY: ""
            NAME: "rida"
            RESUME-REFS: ""
            PREEMPTION-REFS: ""
            START: ""
            STOP: ""
            }   
        Define Execution-Time-Constraint {
            UUID: ""
            SHORT-NAME: "WiperCtrlBasic"
            CATEGORY: ""
            NAME: "misbah"
            RESUME-REFS: ""
            PREEMPTION-REFS: ""
            START: ""
            STOP: ""
            }
        Define Execution-Time-Constraint {
            UUID: ""
            SHORT-NAME: "WiperCtrlBasic"
            CATEGORY: ""
            NAME: "iram"
            RESUME-REFS: ""
            PREEMPTION-REFS: ""
            START: ""
            STOP: ""
            }       
    
        }
     }      
}  

 }

Upvotes: 0

Views: 175

Answers (1)

YellowAfterlife
YellowAfterlife

Reputation: 3217

The intended "vanilla Ace" way of doing validation is to either use workers (e.g. see javascript_worker.js), or do it yourself whenever you want it.

Ace doesn't have semantic syntax highlighting in the same way VS Code does, but you can use editor.session.setAnnotations to add colored backgrounds behind tokens if you want.

Upvotes: 0

Related Questions