diff --git a/Composer/packages/ui-plugins/lg/src/LgField.tsx b/Composer/packages/ui-plugins/lg/src/LgField.tsx index 19e808ccfb..24a665cab4 100644 --- a/Composer/packages/ui-plugins/lg/src/LgField.tsx +++ b/Composer/packages/ui-plugins/lg/src/LgField.tsx @@ -62,11 +62,8 @@ const LgField: React.FC> = props => { }, }; - const diagnostic = lgFile && filterTemplateDiagnostics(lgFile.diagnostics, template)[0]; + const diagnostics = lgFile ? filterTemplateDiagnostics(lgFile.diagnostics, template) : []; - const errorMsg = diagnostic - ? diagnostic.message.split('error message: ')[diagnostic.message.split('error message: ').length - 1] - : ''; const [localValue, setLocalValue] = useState(template.body); const sync = useRef( debounce((shellData: any, localData: any) => { @@ -110,7 +107,7 @@ const LgField: React.FC> = props => { height={100} value={localValue} onChange={onChange} - errorMessage={errorMsg} + diagnostics={diagnostics} hidePlaceholder languageServer={{ path: lspServerPath, diff --git a/Composer/packages/ui-plugins/luis/src/LuisIntentEditor.tsx b/Composer/packages/ui-plugins/luis/src/LuisIntentEditor.tsx index 2f82e93c9a..ddd8e6fe9b 100644 --- a/Composer/packages/ui-plugins/luis/src/LuisIntentEditor.tsx +++ b/Composer/packages/ui-plugins/luis/src/LuisIntentEditor.tsx @@ -42,11 +42,7 @@ const LuisIntentEditor: React.FC> = props => { onChange(intentName); }; - const diagnostic = luFile && filterSectionDiagnostics(luFile.diagnostics, luIntent)[0]; - - const errorMsg = diagnostic - ? diagnostic.message.split('error message: ')[diagnostic.message.split('error message: ').length - 1] - : ''; + const diagnostics = luFile ? filterSectionDiagnostics(luFile.diagnostics, luIntent) : []; return ( > = props => { luOption={{ fileId: luFile.id, sectionId: luIntent.Name }} value={luIntent.Body} onChange={commitChanges} - errorMessage={errorMsg} + diagnostics={diagnostics} options={{ lineNumbers: 'off', minimap: {