diff --git a/packages/hoppscotch-app/components/graphql/RequestOptions.vue b/packages/hoppscotch-app/components/graphql/RequestOptions.vue index 226461553..fb5cc8044 100644 --- a/packages/hoppscotch-app/components/graphql/RequestOptions.vue +++ b/packages/hoppscotch-app/components/graphql/RequestOptions.vue @@ -5,7 +5,7 @@ :id="'query'" :label="`${t('tab.query')}`" :selected="true" - :indicator="gqlQueryString.length > 0" + :indicator="gqlQueryString && gqlQueryString.length > 0 ? true : false" >
{ results = results.concat( semanticLints.map((lint: any) => ({ - from: lint.from, - to: lint.to, + from: { + ch: lint.from.ch + 1, + line: lint.from.line + 1, + }, + to: { + ch: lint.from.ch + 1, + line: lint.to.line + 1, + }, severity: "error", message: `[semantic] ${lint.message}`, })) @@ -24,12 +30,12 @@ const linter: LinterDefinition = async (text) => { results = results.concat( res.errors.map((err: any) => { const fromPos: { line: number; ch: number } = { - line: err.lineNumber - 1, - ch: err.column - 1, + line: err.lineNumber, + ch: err.column, } const toPos: { line: number; ch: number } = { - line: err.lineNumber - 1, + line: err.lineNumber, ch: err.column, } @@ -42,14 +48,14 @@ const linter: LinterDefinition = async (text) => { }) ) } - } catch (e) { + } catch (e: any) { const fromPos: { line: number; ch: number } = { - line: e.lineNumber - 1, - ch: e.column - 1, + line: e.lineNumber, + ch: e.column, } const toPos: { line: number; ch: number } = { - line: e.lineNumber - 1, + line: e.lineNumber, ch: e.column, } diff --git a/packages/hoppscotch-app/helpers/editor/linting/testScript.ts b/packages/hoppscotch-app/helpers/editor/linting/testScript.ts index 902d1778c..75d193f82 100644 --- a/packages/hoppscotch-app/helpers/editor/linting/testScript.ts +++ b/packages/hoppscotch-app/helpers/editor/linting/testScript.ts @@ -10,8 +10,14 @@ const linter: LinterDefinition = async (text) => { results = results.concat( semanticLints.map((lint: any) => ({ - from: lint.from, - to: lint.to, + from: { + ch: lint.from.ch + 1, + line: lint.from.line + 1, + }, + to: { + ch: lint.from.ch + 1, + line: lint.to.line + 1, + }, severity: "error", message: `[semantic] ${lint.message}`, })) @@ -24,12 +30,12 @@ const linter: LinterDefinition = async (text) => { results = results.concat( res.errors.map((err: any) => { const fromPos: { line: number; ch: number } = { - line: err.lineNumber - 1, - ch: err.column - 1, + line: err.lineNumber, + ch: err.column, } const toPos: { line: number; ch: number } = { - line: err.lineNumber - 1, + line: err.lineNumber, ch: err.column, } @@ -42,14 +48,14 @@ const linter: LinterDefinition = async (text) => { }) ) } - } catch (e) { + } catch (e: any) { const fromPos: { line: number; ch: number } = { - line: e.lineNumber - 1, - ch: e.column - 1, + line: e.lineNumber, + ch: e.column, } const toPos: { line: number; ch: number } = { - line: e.lineNumber - 1, + line: e.lineNumber, ch: e.column, } diff --git a/packages/hoppscotch-app/pages/index.vue b/packages/hoppscotch-app/pages/index.vue index e2eb9148a..4888692c1 100644 --- a/packages/hoppscotch-app/pages/index.vue +++ b/packages/hoppscotch-app/pages/index.vue @@ -46,7 +46,9 @@ @@ -54,7 +56,7 @@