Browse Source

Fixed highlight bug

pull/12820/head
mpetrov 1 year ago
parent
commit
49e627a8a6
  1. 5
      ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.models.ts
  2. 2
      ui-ngx/src/app/shared/models/ace/ace.models.ts
  3. 14
      ui-ngx/src/app/shared/models/calculated-field.models.ts

5
ui-ngx/src/app/modules/home/pages/scada-symbol/scada-symbol-editor.models.ts

@ -35,7 +35,8 @@ import {
AceHighlightRule,
AceHighlightRules,
dotOperatorHighlightRule,
endGroupHighlightRule
endGroupHighlightRule,
identifierRe
} from '@shared/models/ace/ace.models';
import { HelpLinks, ValueType } from '@shared/models/constants';
import { formPropertyCompletions } from '@shared/models/dynamic-form.models';
@ -924,8 +925,6 @@ export class ScadaSymbolElement {
}
const identifierRe = /[a-zA-Z$_\u00a1-\uffff][a-zA-Z\d$_\u00a1-\uffff]*/;
const scadaSymbolCtxObjectHighlightRule: AceHighlightRule = {
token: 'tb.scada-symbol-ctx',
regex: /\bctx\b/,

2
ui-ngx/src/app/shared/models/ace/ace.models.ts

@ -376,5 +376,7 @@ export const endGroupHighlightRule: AceHighlightRule = {
next: 'no_regex'
};
export const identifierRe = /[a-zA-Z$_\u00a1-\uffff][a-zA-Z\d$_\u00a1-\uffff]*/;

14
ui-ngx/src/app/shared/models/calculated-field.models.ts

@ -32,7 +32,8 @@ import {
AceHighlightRule,
AceHighlightRules,
dotOperatorHighlightRule,
endGroupHighlightRule
endGroupHighlightRule,
identifierRe
} from '@shared/models/ace/ace.models';
export interface CalculatedField extends Omit<BaseData<CalculatedFieldId>, 'label'>, HasVersion, HasEntityDebugSettings, HasTenantId, ExportableEntity<CalculatedFieldId> {
@ -480,6 +481,17 @@ export const getCalculatedFieldArgumentsHighlights = (
? 'calculatedFieldRollingArgumentValue'
: 'calculatedFieldSingleArgumentValue'
})),
no_regex: [
{
token: 'tb.identifier',
regex: identifierRe,
},
{
token: 'tb.paren.lparen',
regex: '\\(',
next: 'start'
}
],
...calculatedFieldSingleArgumentValueHighlightRules,
...calculatedFieldRollingArgumentValueHighlightRules,
...calculatedFieldTimeWindowArgumentValueHighlightRules

Loading…
Cancel
Save