File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,6 +388,7 @@ export default function ControlledCodeCell(props: Props) {
388388 response = await runCodiumAiAutocomplete (
389389 codeiumApiKey ?? null ,
390390 prefix + suffix ,
391+ cell . language ,
391392 prefix . length ,
392393 ) ;
393394 } catch ( err ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const EDITOR_API_KEY = 'd49954eb-cfba-4992-980f-d8fb37f0e942';
1111export async function runCodiumAiAutocomplete (
1212 optionalApiKey : string | null ,
1313 source : string ,
14+ sourceLanguage : 'javascript' | 'typescript' ,
1415 cursorOffset : number ,
1516) : Promise < CodiumCompletionResult > {
1617 const protos = protobuf . Root . fromJSON ( languageServerProto as protobuf . INamespace ) ;
@@ -36,8 +37,8 @@ export async function runCodiumAiAutocomplete(
3637 } ) ,
3738 document : DocumentInfo . create ( {
3839 text : source ,
39- editorLanguage : 'javascript' ,
40- language : Language . getOption ( ' JAVASCRIPT') ,
40+ editorLanguage : sourceLanguage ,
41+ language : Language . getOption ( sourceLanguage === 'javascript' ? ' JAVASCRIPT' : 'TYPESCRIPT ') ,
4142 cursorOffset : Long . fromValue ( cursorOffset ) ,
4243 lineEnding : '\n' ,
4344 } ) ,
You can’t perform that action at this time.
0 commit comments