Skip to content

Commit 88db689

Browse files
committed
refactor: move cleanup work to more general location
1 parent bf36a48 commit 88db689

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

packages/amazonq/src/lsp/lspInstaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {
1212
fs,
1313
LspResolution,
1414
getNodeExecutableName,
15+
cleanUpLSPDownloads,
1516
} from 'aws-core-vscode/shared'
1617
import path from 'path'
17-
import { cleanUpLSPDownloads } from 'aws-core-vscode/amazonq'
1818

1919
const manifestURL = 'https://aws-toolkit-language-servers.amazonaws.com/codewhisperer/0/manifest.json'
2020
export const supportedLspServerVersions = '^2.3.0'

packages/core/src/amazonq/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export {
1717
} from './onboardingPage/walkthrough'
1818
export { LspController } from './lsp/lspController'
1919
export { LspClient } from './lsp/lspClient'
20-
export { cleanUpLSPDownloads } from './lsp/util'
2120
export { api } from './extApi'
2221
export { AmazonQChatViewProvider } from './webview/webView'
2322
export { init as cwChatAppInit } from '../codewhispererChat/app'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { LanguageServerResolver } from '../../shared/lsp/lspResolver'
1010
import { Range } from 'semver'
1111
import { getNodeExecutableName } from '../../shared/lsp/utils/platform'
1212
import { fs } from '../../shared/fs/fs'
13-
import { cleanUpLSPDownloads } from './util'
13+
import { cleanUpLSPDownloads } from '../../shared'
1414

1515
const manifestUrl = 'https://aws-toolkit-language-servers.amazonaws.com/q-context/manifest.json'
1616
// this LSP client in Q extension is only going to work with these LSP server versions

packages/core/src/shared/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export { TabTypeDataMap } from '../amazonq/webview/ui/tabs/constants'
6363
export * from './lsp/manifestResolver'
6464
export * from './lsp/lspResolver'
6565
export * from './lsp/types'
66+
export * from './lsp/utils/cleanup'
6667
export { default as request } from './request'
6768
export * from './lsp/utils/platform'
6869
export * as processUtils from './utilities/processUtils'

packages/core/src/amazonq/lsp/util.ts renamed to packages/core/src/shared/lsp/utils/cleanup.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
*/
55

66
import path from 'path'
7-
import { LspVersion } from '../../shared'
8-
import { fs } from '../../shared/fs/fs'
9-
import { partition } from '../../shared/utilities/tsUtils'
7+
import { LspVersion } from '../types'
8+
import { fs } from '../../../shared/fs/fs'
9+
import { partition } from '../../../shared/utilities/tsUtils'
1010
import { sort } from 'semver'
1111

12-
export async function getDownloadedVersions(installLocation: string) {
12+
async function getDownloadedVersions(installLocation: string) {
1313
return (await fs.readdir(installLocation)).map(([f, _], __) => f)
1414
}
1515

packages/core/src/test/amazonq/lsp/util.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
*/
55

66
import { Uri } from 'vscode'
7-
import { fs } from '../../../shared'
7+
import { cleanUpLSPDownloads, fs } from '../../../shared'
88
import { createTestWorkspaceFolder } from '../../testUtil'
99
import path from 'path'
1010
import assert from 'assert'
11-
import { cleanUpLSPDownloads } from '../../../amazonq/lsp/util'
1211

1312
async function fakeInstallVersion(version: string, installationDir: string): Promise<void> {
1413
const versionDir = path.join(installationDir, version)

0 commit comments

Comments
 (0)