Skip to content

Commit

Permalink
fix the lint warning start position
Browse files Browse the repository at this point in the history
  • Loading branch information
jczhong84 committed Nov 16, 2024
1 parent 27beae2 commit 8f3aaea
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions querybook/webapp/hooks/queryEditor/useLint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TDataDocMetaVariables } from 'const/datadoc';
import { IQueryValidationResult } from 'const/queryExecution';
import { useDebounce } from 'hooks/useDebounce';
import useDeepCompareEffect from 'hooks/useDeepCompareEffect';
import { posToOffset } from 'lib/codemirror/utils';
import { getTokenAtOffset, posToOffset } from 'lib/codemirror/utils';
import { getContextSensitiveWarnings } from 'lib/sql-helper/sql-context-sensitive-linter';
import { ILinterWarning, TableToken } from 'lib/sql-helper/sql-lexer';
import { TemplatedQueryResource } from 'resource/queryExecution';
Expand Down Expand Up @@ -75,10 +75,7 @@ const queryValidationErrorsToDiagnostics = (
suggestion,
} = validationError;

const startPos = posToOffset(editorView, {
line,
ch: ch + 1,
});
const startPos = posToOffset(editorView, { line, ch });
const endPos =
endLine !== null && endCh !== null
? posToOffset(editorView, {
Expand Down

0 comments on commit 8f3aaea

Please sign in to comment.