Skip to content

Commit efda8d1

Browse files
author
Jiatong Li
committed
feat(codewhisperer): add fileUri to FileContext
1 parent fbf8bd0 commit efda8d1

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

packages/core/src/codewhisperer/client/service-2.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,20 @@
612612
"filename": {
613613
"shape": "FileContextFilenameString"
614614
},
615+
"fileUri": {
616+
"shape": "FileContextFileUriString"
617+
},
615618
"programmingLanguage": {
616619
"shape": "ProgrammingLanguage"
617620
}
618621
}
619622
},
623+
"FileContextFileUriString": {
624+
"type": "string",
625+
"max": 1024,
626+
"min": 1,
627+
"sensitive": true
628+
},
620629
"FileContextFilenameString": {
621630
"type": "string",
622631
"max": 1024,

packages/core/src/codewhisperer/client/user-service-2.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,9 +1852,16 @@
18521852
"leftFileContent": { "shape": "FileContextLeftFileContentString" },
18531853
"rightFileContent": { "shape": "FileContextRightFileContentString" },
18541854
"filename": { "shape": "FileContextFilenameString" },
1855+
"fileUri": { "shape": "FileContextFileUriString" },
18551856
"programmingLanguage": { "shape": "ProgrammingLanguage" }
18561857
}
18571858
},
1859+
"FileContextFileUriString": {
1860+
"type": "string",
1861+
"max": 1024,
1862+
"min": 1,
1863+
"sensitive": true
1864+
},
18581865
"FileContextFilenameString": {
18591866
"type": "string",
18601867
"max": 1024,

packages/core/src/codewhisperer/util/editorContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export function extractContextForCodeWhisperer(editor: vscode.TextEditor): codew
167167
}
168168

169169
return {
170+
fileUri: editor.document.uri.toString().substring(0, CodeWhispererConstants.filenameCharsLimit),
170171
filename: getFileRelativePath(editor),
171172
programmingLanguage: {
172173
languageName: languageName,

0 commit comments

Comments
 (0)