Skip to content

Commit fa1b999

Browse files
committed
circular dependency
1 parent 5e0169a commit fa1b999

File tree

4 files changed

+57
-42
lines changed

4 files changed

+57
-42
lines changed

packages/core/src/amazonq/lsp/lspClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class LspClient {
136136
return resp
137137
} catch (e) {
138138
getLogger().error(`LspClient: query error: ${e}`)
139-
return []
139+
throw e
140140
}
141141
}
142142

packages/core/src/amazonq/lsp/lspController.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ export class LspController {
303303
return resp
304304
}
305305

306+
async queryBM25(query: string, path: string) {
307+
try {
308+
return await LspClient.instance.queryBM25(query, path)
309+
} catch (e) {
310+
return []
311+
}
312+
}
313+
306314
async buildIndex() {
307315
getLogger().info(`LspController: Starting LSP`)
308316
const start = performance.now()

packages/core/src/codewhisperer/util/supplementalContext/crossFileContextUtil.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { getFileDistance } from '../../../shared/filesystemUtilities'
1616
import { getOpenFilesInWindow } from '../../../shared/utilities/editorUtilities'
1717
import { getLogger } from '../../../shared/logger/logger'
1818
import { CodeWhispererSupplementalContext, CodeWhispererSupplementalContextItem } from '../../models/model'
19-
import { LspClient } from '../../../amazonq'
19+
import { LspController } from '../../../amazonq'
2020

2121
type CrossFileSupportedLanguage =
2222
| 'java'
@@ -80,14 +80,14 @@ export async function fetchSupplementalContextForSrcV2(
8080
): Promise<Pick<CodeWhispererSupplementalContext, 'supplementalContextItems' | 'strategy'> | undefined> {
8181
const inputChunkContent = getInputChunk(editor)
8282

83-
const bm25Response: { content: string; score: number; filePath: string }[] = await LspClient.instance.queryBM25(
83+
const bm25Response: { content: string; score: number; filePath: string }[] = await LspController.instance.queryBM25(
8484
inputChunkContent.content,
8585
editor.document.uri.fsPath
8686
)
8787
getLogger().info(JSON.stringify(bm25Response))
8888
console.log(bm25Response)
8989

90-
const supContextItems: CodeWhispererSupplementalContextItem[] = bm25Response
90+
const supContextItems: CodeWhispererSupplementalContextItem[] = []
9191
return {
9292
supplementalContextItems: [...supContextItems],
9393
strategy: 'LSP',

packages/toolkit/package.json

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3712,271 +3712,278 @@
37123712
"fontCharacter": "\\f1b4"
37133713
}
37143714
},
3715-
"aws-amazonq-transform-logo": {
3715+
"aws-amazonq-transform-landing-page-icon": {
37163716
"description": "AWS Contributed Icon",
37173717
"default": {
37183718
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37193719
"fontCharacter": "\\f1b5"
37203720
}
37213721
},
3722-
"aws-amazonq-transform-step-into-dark": {
3722+
"aws-amazonq-transform-logo": {
37233723
"description": "AWS Contributed Icon",
37243724
"default": {
37253725
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37263726
"fontCharacter": "\\f1b6"
37273727
}
37283728
},
3729-
"aws-amazonq-transform-step-into-light": {
3729+
"aws-amazonq-transform-step-into-dark": {
37303730
"description": "AWS Contributed Icon",
37313731
"default": {
37323732
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37333733
"fontCharacter": "\\f1b7"
37343734
}
37353735
},
3736-
"aws-amazonq-transform-variables-dark": {
3736+
"aws-amazonq-transform-step-into-light": {
37373737
"description": "AWS Contributed Icon",
37383738
"default": {
37393739
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37403740
"fontCharacter": "\\f1b8"
37413741
}
37423742
},
3743-
"aws-amazonq-transform-variables-light": {
3743+
"aws-amazonq-transform-variables-dark": {
37443744
"description": "AWS Contributed Icon",
37453745
"default": {
37463746
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37473747
"fontCharacter": "\\f1b9"
37483748
}
37493749
},
3750-
"aws-applicationcomposer-icon": {
3750+
"aws-amazonq-transform-variables-light": {
37513751
"description": "AWS Contributed Icon",
37523752
"default": {
37533753
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37543754
"fontCharacter": "\\f1ba"
37553755
}
37563756
},
3757-
"aws-applicationcomposer-icon-dark": {
3757+
"aws-applicationcomposer-icon": {
37583758
"description": "AWS Contributed Icon",
37593759
"default": {
37603760
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37613761
"fontCharacter": "\\f1bb"
37623762
}
37633763
},
3764-
"aws-apprunner-service": {
3764+
"aws-applicationcomposer-icon-dark": {
37653765
"description": "AWS Contributed Icon",
37663766
"default": {
37673767
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37683768
"fontCharacter": "\\f1bc"
37693769
}
37703770
},
3771-
"aws-cdk-logo": {
3771+
"aws-apprunner-service": {
37723772
"description": "AWS Contributed Icon",
37733773
"default": {
37743774
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37753775
"fontCharacter": "\\f1bd"
37763776
}
37773777
},
3778-
"aws-cloudformation-stack": {
3778+
"aws-cdk-logo": {
37793779
"description": "AWS Contributed Icon",
37803780
"default": {
37813781
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37823782
"fontCharacter": "\\f1be"
37833783
}
37843784
},
3785-
"aws-cloudwatch-log-group": {
3785+
"aws-cloudformation-stack": {
37863786
"description": "AWS Contributed Icon",
37873787
"default": {
37883788
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37893789
"fontCharacter": "\\f1bf"
37903790
}
37913791
},
3792-
"aws-codecatalyst-logo": {
3792+
"aws-cloudwatch-log-group": {
37933793
"description": "AWS Contributed Icon",
37943794
"default": {
37953795
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
37963796
"fontCharacter": "\\f1c0"
37973797
}
37983798
},
3799-
"aws-codewhisperer-icon-black": {
3799+
"aws-codecatalyst-logo": {
38003800
"description": "AWS Contributed Icon",
38013801
"default": {
38023802
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38033803
"fontCharacter": "\\f1c1"
38043804
}
38053805
},
3806-
"aws-codewhisperer-icon-white": {
3806+
"aws-codewhisperer-icon-black": {
38073807
"description": "AWS Contributed Icon",
38083808
"default": {
38093809
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38103810
"fontCharacter": "\\f1c2"
38113811
}
38123812
},
3813-
"aws-codewhisperer-learn": {
3813+
"aws-codewhisperer-icon-white": {
38143814
"description": "AWS Contributed Icon",
38153815
"default": {
38163816
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38173817
"fontCharacter": "\\f1c3"
38183818
}
38193819
},
3820-
"aws-ecr-registry": {
3820+
"aws-codewhisperer-learn": {
38213821
"description": "AWS Contributed Icon",
38223822
"default": {
38233823
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38243824
"fontCharacter": "\\f1c4"
38253825
}
38263826
},
3827-
"aws-ecs-cluster": {
3827+
"aws-ecr-registry": {
38283828
"description": "AWS Contributed Icon",
38293829
"default": {
38303830
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38313831
"fontCharacter": "\\f1c5"
38323832
}
38333833
},
3834-
"aws-ecs-container": {
3834+
"aws-ecs-cluster": {
38353835
"description": "AWS Contributed Icon",
38363836
"default": {
38373837
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38383838
"fontCharacter": "\\f1c6"
38393839
}
38403840
},
3841-
"aws-ecs-service": {
3841+
"aws-ecs-container": {
38423842
"description": "AWS Contributed Icon",
38433843
"default": {
38443844
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38453845
"fontCharacter": "\\f1c7"
38463846
}
38473847
},
3848-
"aws-generic-attach-file": {
3848+
"aws-ecs-service": {
38493849
"description": "AWS Contributed Icon",
38503850
"default": {
38513851
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38523852
"fontCharacter": "\\f1c8"
38533853
}
38543854
},
3855-
"aws-iot-certificate": {
3855+
"aws-generic-attach-file": {
38563856
"description": "AWS Contributed Icon",
38573857
"default": {
38583858
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38593859
"fontCharacter": "\\f1c9"
38603860
}
38613861
},
3862-
"aws-iot-policy": {
3862+
"aws-iot-certificate": {
38633863
"description": "AWS Contributed Icon",
38643864
"default": {
38653865
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38663866
"fontCharacter": "\\f1ca"
38673867
}
38683868
},
3869-
"aws-iot-thing": {
3869+
"aws-iot-policy": {
38703870
"description": "AWS Contributed Icon",
38713871
"default": {
38723872
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38733873
"fontCharacter": "\\f1cb"
38743874
}
38753875
},
3876-
"aws-lambda-function": {
3876+
"aws-iot-thing": {
38773877
"description": "AWS Contributed Icon",
38783878
"default": {
38793879
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38803880
"fontCharacter": "\\f1cc"
38813881
}
38823882
},
3883-
"aws-mynah-MynahIconBlack": {
3883+
"aws-lambda-function": {
38843884
"description": "AWS Contributed Icon",
38853885
"default": {
38863886
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38873887
"fontCharacter": "\\f1cd"
38883888
}
38893889
},
3890-
"aws-mynah-MynahIconWhite": {
3890+
"aws-mynah-MynahIconBlack": {
38913891
"description": "AWS Contributed Icon",
38923892
"default": {
38933893
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
38943894
"fontCharacter": "\\f1ce"
38953895
}
38963896
},
3897-
"aws-mynah-logo": {
3897+
"aws-mynah-MynahIconWhite": {
38983898
"description": "AWS Contributed Icon",
38993899
"default": {
39003900
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39013901
"fontCharacter": "\\f1cf"
39023902
}
39033903
},
3904-
"aws-redshift-cluster": {
3904+
"aws-mynah-logo": {
39053905
"description": "AWS Contributed Icon",
39063906
"default": {
39073907
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39083908
"fontCharacter": "\\f1d0"
39093909
}
39103910
},
3911-
"aws-redshift-cluster-connected": {
3911+
"aws-redshift-cluster": {
39123912
"description": "AWS Contributed Icon",
39133913
"default": {
39143914
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39153915
"fontCharacter": "\\f1d1"
39163916
}
39173917
},
3918-
"aws-redshift-database": {
3918+
"aws-redshift-cluster-connected": {
39193919
"description": "AWS Contributed Icon",
39203920
"default": {
39213921
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39223922
"fontCharacter": "\\f1d2"
39233923
}
39243924
},
3925-
"aws-redshift-redshift-cluster-connected": {
3925+
"aws-redshift-database": {
39263926
"description": "AWS Contributed Icon",
39273927
"default": {
39283928
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39293929
"fontCharacter": "\\f1d3"
39303930
}
39313931
},
3932-
"aws-redshift-schema": {
3932+
"aws-redshift-redshift-cluster-connected": {
39333933
"description": "AWS Contributed Icon",
39343934
"default": {
39353935
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39363936
"fontCharacter": "\\f1d4"
39373937
}
39383938
},
3939-
"aws-redshift-table": {
3939+
"aws-redshift-schema": {
39403940
"description": "AWS Contributed Icon",
39413941
"default": {
39423942
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39433943
"fontCharacter": "\\f1d5"
39443944
}
39453945
},
3946-
"aws-s3-bucket": {
3946+
"aws-redshift-table": {
39473947
"description": "AWS Contributed Icon",
39483948
"default": {
39493949
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39503950
"fontCharacter": "\\f1d6"
39513951
}
39523952
},
3953-
"aws-s3-create-bucket": {
3953+
"aws-s3-bucket": {
39543954
"description": "AWS Contributed Icon",
39553955
"default": {
39563956
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39573957
"fontCharacter": "\\f1d7"
39583958
}
39593959
},
3960-
"aws-schemas-registry": {
3960+
"aws-s3-create-bucket": {
39613961
"description": "AWS Contributed Icon",
39623962
"default": {
39633963
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39643964
"fontCharacter": "\\f1d8"
39653965
}
39663966
},
3967-
"aws-schemas-schema": {
3967+
"aws-schemas-registry": {
39683968
"description": "AWS Contributed Icon",
39693969
"default": {
39703970
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39713971
"fontCharacter": "\\f1d9"
39723972
}
39733973
},
3974-
"aws-stepfunctions-preview": {
3974+
"aws-schemas-schema": {
39753975
"description": "AWS Contributed Icon",
39763976
"default": {
39773977
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
39783978
"fontCharacter": "\\f1da"
39793979
}
3980+
},
3981+
"aws-stepfunctions-preview": {
3982+
"description": "AWS Contributed Icon",
3983+
"default": {
3984+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
3985+
"fontCharacter": "\\f1db"
3986+
}
39803987
}
39813988
},
39823989
"notebooks": [

0 commit comments

Comments
 (0)