aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.51k stars 436 forks source link

feat(amazonq): switch to relative path for inline Completion API field #5543

Closed leigaol closed 2 months ago

leigaol commented 2 months ago

Problem

Inline completion quality can be improved by passing the relative path instead of file name.

Solution

In the inline API request payload, we send relative path instead of file name.

No user facing change log item is added. The service controls what is sent for generation, this change will not have immediate customer impact.


License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

github-actions[bot] commented 2 months ago

This pull request modifies a feature or fixes a bug, but it does not include a changelog entry. All pull requests that introduce new features or bug fixes must have a corresponding changelog item describing the changes.

leigaol commented 2 months ago

unit test failures are not relevant to this PR

leigaol commented 2 months ago

/retryBuilds

Will-ShaoHua commented 2 months ago

think it failed because of this test case involved in this change

  559 passing (20s)
  17 pending
  1 failing
  1) editorContext
       getFileRelativePath
         Should return relative path:

      Error: / has incorrect permissions. Expected rwx, found r-x & r-x (ambiguous). [InvalidPermissions] (isOwner: false; mode: drwxr-xr-x 0 0)
      + expected - actual

      -r-x
      +*wx

      at /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:58:15
      at async /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:55:19
      at async /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:50:23
      at async /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:55:19
      at async /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:50:23
      at async toFile (/codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/test/testUtil.ts:31:5)
      at async openATextEditorWithText (/codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/test/testUtil.ts:344:5)
      at async Context.<anonymous> (test/unit/codewhisperer/util/editorContext.test.ts:100:28)

deleteTestTempDirs: deleted 49 test temp dirs
Error: 1 tests failed.
leigaol commented 2 months ago

think it failed because of this test case involved in this change

  559 passing (20s)
  17 pending
  1 failing
  1) editorContext
       getFileRelativePath
         Should return relative path:

      Error: / has incorrect permissions. Expected rwx, found r-x & r-x (ambiguous). [InvalidPermissions] (isOwner: false; mode: drwxr-xr-x 0 0)
      + expected - actual

      -r-x
      +*wx

      at /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:58:15
      at async /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:55:19
      at async /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:50:23
      at async /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:55:19
      at async /codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/fs/fs.ts:50:23
      at async toFile (/codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/test/testUtil.ts:31:5)
      at async openATextEditorWithText (/codebuild/output/src2683340588/src/github.com/aws/aws-toolkit-vscode/packages/core/src/test/testUtil.ts:344:5)
      at async Context.<anonymous> (test/unit/codewhisperer/util/editorContext.test.ts:100:28)

deleteTestTempDirs: deleted 49 test temp dirs
Error: 1 tests failed.

fixed