3

I'm working on a DSL developed using xtext. I am using autocomplete using orion editor. It works great with the auto generated web editor. But, we want to integrate it with another web app developed using Angular 4. I got to configure the editor, but somehow all calls to language services (e.g. Occurrences, hover, etc) fails with 404. While same calls work fine with the auto generated embedded editor. What I'm missing here?

Here is how my code to create editor looks like in typescript:

xtext.createEditor({
    'serviceUrl': 'http://localhost:8080/xtext-service',
    'syntaxDefinition': 'http://localhost:8080/xtext-resources/generated/dsl-syntax.js',
    'parentClass': 'xtext-editor',
    'enableCors': true,
    'loadFromServer': false
  })

If I compare AJAX calls made by angular app and web editor, significant difference I see is, the web editor sends few cookies, which angular app doesn't. Can that be a reason? If so, how can I fix angular app accordingly?

Rumit Parakhiya
  • 2,674
  • 3
  • 24
  • 33

1 Answers1

0

In case anyone else is stuck with the same situation, I resolved it by adding

sendFullText: true

to the config object passed to the createEditor method. This property configures the editor to use language services in stateless mode and doesn't expect cookie/session to be passed.

Rumit Parakhiya
  • 2,674
  • 3
  • 24
  • 33