diff options
author | 2021-06-29 11:37:14 +0200 | |
---|---|---|
committer | 2021-06-29 11:37:14 +0200 | |
commit | 272c7c5dd04feb54806b92d88dc1a5029cddc397 (patch) | |
tree | decf6950c10782d124c5a3b6055a09d52f9e5791 /language-web/src/main/js/xtext/services/ValidationService.js | |
parent | Fix derived state computer idempotency (diff) | |
download | refinery-272c7c5dd04feb54806b92d88dc1a5029cddc397.tar.gz refinery-272c7c5dd04feb54806b92d88dc1a5029cddc397.tar.zst refinery-272c7c5dd04feb54806b92d88dc1a5029cddc397.zip |
Webpack build for frontend
Diffstat (limited to 'language-web/src/main/js/xtext/services/ValidationService.js')
-rw-r--r-- | language-web/src/main/js/xtext/services/ValidationService.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/language-web/src/main/js/xtext/services/ValidationService.js b/language-web/src/main/js/xtext/services/ValidationService.js new file mode 100644 index 00000000..85c9953d --- /dev/null +++ b/language-web/src/main/js/xtext/services/ValidationService.js | |||
@@ -0,0 +1,33 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2015 itemis AG (http://www.itemis.eu) and others. | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-2.0. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | |||
10 | define(['xtext/services/XtextService', 'jquery'], function(XtextService, jQuery) { | ||
11 | |||
12 | /** | ||
13 | * Service class for validation. | ||
14 | */ | ||
15 | function ValidationService(serviceUrl, resourceId) { | ||
16 | this.initialize(serviceUrl, 'validate', resourceId); | ||
17 | }; | ||
18 | |||
19 | ValidationService.prototype = new XtextService(); | ||
20 | |||
21 | ValidationService.prototype._checkPreconditions = function(editorContext, params) { | ||
22 | return this._state === undefined; | ||
23 | } | ||
24 | |||
25 | ValidationService.prototype._onConflict = function(editorContext, cause) { | ||
26 | this.setState(undefined); | ||
27 | return { | ||
28 | suppressForcedUpdate: true | ||
29 | }; | ||
30 | }; | ||
31 | |||
32 | return ValidationService; | ||
33 | }); \ No newline at end of file | ||