@@ -7,6 +7,11 @@ import {codeAssistApi} from '../../../../store/reducers/codeAssist/codeAssist';
77import type { TelemetryOpenTabs } from '../../../../types/api/codeAssist' ;
88import { AUTOCOMPLETE_ON_ENTER , ENABLE_AUTOCOMPLETE } from '../../../../utils/constants' ;
99import { useSetting } from '../../../../utils/hooks' ;
10+ import { YQL_LANGUAGE_ID } from '../../../../utils/monaco/constats' ;
11+
12+ const limitForTab = 10_000 ;
13+ const limitBeforeCursor = 8_000 ;
14+ const limitAfterCursor = 1_000 ;
1015
1116export type EditorOptions = Monaco . editor . IEditorOptions & Monaco . editor . IGlobalEditorOptions ;
1217
@@ -67,7 +72,7 @@ export function useCodeAssist() {
6772 async ( queries : { text : string ; name ?: string } [ ] ) => {
6873 const preparedData : TelemetryOpenTabs = queries . map ( ( query , index ) => ( {
6974 FileName : query . name || `query${ index } .yql` ,
70- Text : query . text ,
75+ Text : query . text . slice ( 0 , limitForTab ) ,
7176 } ) ) ;
7277 try {
7378 return sendUserQueriesData ( preparedData ) . unwrap ( ) ;
@@ -78,7 +83,16 @@ export function useCodeAssist() {
7883 [ sendUserQueriesData ] ,
7984 ) ;
8085
86+ const config = {
87+ language : YQL_LANGUAGE_ID ,
88+ textLimits : {
89+ beforeCursor : limitBeforeCursor ,
90+ afterCursor : limitAfterCursor ,
91+ } ,
92+ } ;
93+
8194 return {
95+ config,
8296 getCodeAssistSuggestions,
8397 onCompletionAccept,
8498 onCompletionDecline,
0 commit comments