@@ -881,23 +881,23 @@ export class ChatController {
881881 /**
882882 * @returns A Uri array of prompt files in each workspace root's .amazonq/rules directory
883883 */
884- private async collectWorkspaceRules ( ) : Promise < vscode . Uri [ ] > {
885- const rulesFiles : vscode . Uri [ ] = [ ]
884+ private async collectWorkspaceRules ( ) : Promise < string [ ] > {
885+ const rulesFiles : string [ ] = [ ]
886886
887887 if ( ! vscode . workspace . workspaceFolders ) {
888888 return rulesFiles
889889 }
890890
891891 for ( const folder of vscode . workspace . workspaceFolders ) {
892- const rulesPath = vscode . Uri . joinPath ( folder . uri , '.amazonq' , 'rules' )
892+ const rulesPath = path . join ( folder . uri . fsPath , '.amazonq' , 'rules' )
893893 const folderExists = await fs . exists ( rulesPath )
894894
895895 if ( folderExists ) {
896896 const entries = await fs . readdir ( rulesPath )
897897
898898 for ( const [ name , type ] of entries ) {
899899 if ( type === vscode . FileType . File && name . endsWith ( promptFileExtension ) ) {
900- rulesFiles . push ( vscode . Uri . joinPath ( rulesPath , name ) )
900+ rulesFiles . push ( path . join ( rulesPath , name ) )
901901 }
902902 }
903903 }
@@ -918,11 +918,12 @@ export class ChatController {
918918 if ( workspaceRules . length > 0 ) {
919919 contextCommands . push (
920920 ...workspaceRules . map ( ( rule ) => {
921- const workspaceFolderPath = vscode . workspace . getWorkspaceFolder ( rule ) ?. uri ?. path || ''
921+ const workspaceFolderPath =
922+ vscode . workspace . getWorkspaceFolder ( vscode . Uri . parse ( rule ) ) ?. uri ?. path || ''
922923 return {
923924 workspaceFolder : workspaceFolderPath ,
924925 type : 'file' as ContextCommandItemType ,
925- relativePath : path . relative ( workspaceFolderPath , rule . path ) ,
926+ relativePath : path . relative ( workspaceFolderPath , rule ) ,
926927 }
927928 } )
928929 )
0 commit comments