Commit d3cdaaf1 authored by tizah's avatar tizah

fix editor highlighter

parent 6924eb45
......@@ -25,9 +25,9 @@ const ErrorRenderer = ({ message, opt, editor }: ErrorRendererProps) => {
return result
}
const handlePointToErrorOnClick = () => {
const result = opt.locationString.split(':')
editor._components.registry.get('editor').api.gotoLine(parseInt(result[0]) - 1, parseInt(result[1]))
const handlePointToErrorOnClick = (location, fileName) => {
editor.call('editor', 'discardHighlight')
editor.call('editor', 'highlight', location, fileName)
}
if (!message) return
......@@ -48,7 +48,7 @@ const ErrorRenderer = ({ message, opt, editor }: ErrorRendererProps) => {
<div className="close" data-id="renderer">
<i className="fas fa-times"></i>
</div>
<span className='d-flex flex-column' onClick={handlePointToErrorOnClick}>
<span className='d-flex flex-column' onClick={() => handlePointToErrorOnClick(opt.location, opt.fileName)}>
<span className='h6 font-weight-bold'>{opt.name}</span>
{ opt.item.warning }
{opt.item.more
......
......@@ -169,12 +169,14 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
type: 'warning',
useSpan: true,
errFile: fileName,
fileName,
errLine: row,
errCol: column,
item: item,
name: result.name,
locationString,
more: item.more
more: item.more,
location: location
}
warningErrors.push(options)
setWarning({ msg, hasWarning: true, options, warningErrors: warningErrors })
......@@ -314,7 +316,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
return (
<div className="analysis_3ECCBV px-3 pb-1">
<div className="my-2 d-flex flex-column align-items-left">
<div className="d-flex justify-content-between">
<div className="d-flex justify-content-between" id="staticanalysisButton">
<RemixUiCheckbox
id="checkAllEntries"
inputType="checkbox"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment