File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
packages/core/src/amazonq/lsp Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -18,27 +18,32 @@ export const supportedLspServerVersions = '0.1.32'
1818export const lspWorkspaceName = 'AmazonQ-Workspace'
1919
2020export class WorkspaceLSPResolver implements LspResolver {
21+ private readonly versionRange : Range
22+ private readonly shouldCleanUp : boolean
2123 public constructor (
22- private readonly options = {
23- versionRange : new Range ( supportedLspServerVersions ) ,
24- cleanUp : true ,
25- }
26- ) { }
24+ options ?: Partial < {
25+ versionRange : Range
26+ cleanUp : boolean
27+ } >
28+ ) {
29+ this . versionRange = options ?. versionRange ?? new Range ( supportedLspServerVersions )
30+ this . shouldCleanUp = options ?. cleanUp ?? true
31+ }
2732
2833 async resolve ( ) : Promise < LspResolution > {
2934 const manifest = await new ManifestResolver ( manifestUrl , lspWorkspaceName ) . resolve ( )
3035 const installationResult = await new LanguageServerResolver (
3136 manifest ,
3237 lspWorkspaceName ,
33- this . options . versionRange
38+ this . versionRange
3439 ) . resolve ( )
3540
3641 const nodeName =
3742 process . platform === 'win32' ? getNodeExecutableName ( ) : `node-${ process . platform } -${ process . arch } `
3843 const nodePath = path . join ( installationResult . assetDirectory , nodeName )
3944 await fs . chmod ( nodePath , 0o755 )
4045
41- if ( this . options . cleanUp ) {
46+ if ( this . shouldCleanUp ) {
4247 await this . cleanUp ( manifest . versions , path . dirname ( installationResult . assetDirectory ) )
4348 }
4449 return {
You can’t perform that action at this time.
0 commit comments