File tree Expand file tree Collapse file tree 8 files changed +319
-190
lines changed
gpt-runner-shared/src/common/types
gpt-runner-vscode/src/register Expand file tree Collapse file tree 8 files changed +319
-190
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ coverage
12
12
dist
13
13
examples /** /pnpm-lock.yaml
14
14
node_modules
15
+ playground /.vscode
15
16
packages /gpt-runner /README.md
16
17
packages /gpt-runner-vscode /LICENSE
17
18
result.json
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export enum ChatMessageStatus {
11
11
}
12
12
13
13
export enum ClientEventName {
14
+ RefreshTree = 'refreshTree' ,
14
15
InsertCodes = 'insertCodes' ,
15
16
DiffCodes = 'diffCodes' ,
16
17
}
Original file line number Diff line number Diff line change 1
1
import type { ClientEventName } from './enum'
2
2
3
3
export interface ClientEventData {
4
+ [ ClientEventName . RefreshTree ] : void
5
+
4
6
[ ClientEventName . InsertCodes ] : {
5
7
codes : string
6
8
}
7
9
8
10
[ ClientEventName . DiffCodes ] : {
9
11
codes : string
10
12
}
13
+
11
14
}
12
15
13
16
export type EventEmitterMap = {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export async function registerOpenInBrowser(
21
21
22
22
disposable = vscode . commands . registerCommand ( Commands . OpenInBrowser , ( ) => {
23
23
openInBrowser ( {
24
- url : `${ getServerBaseUrl ( ) } /#/chat` ,
24
+ url : `${ getServerBaseUrl ( ) } /#/chat?rootPath= ${ cwd } ` ,
25
25
} )
26
26
} )
27
27
Original file line number Diff line number Diff line change @@ -14,11 +14,14 @@ class ChatViewProvider implements vscode.WebviewViewProvider {
14
14
15
15
#view?: vscode . WebviewView
16
16
#extContext: ExtensionContext
17
+ #projectPath: string
17
18
18
19
constructor (
19
20
extContext : ExtensionContext ,
21
+ projectPath : string ,
20
22
) {
21
23
this . #extContext = extContext
24
+ this . #projectPath = projectPath
22
25
}
23
26
24
27
resolveWebviewView (
@@ -66,6 +69,7 @@ class ChatViewProvider implements vscode.WebviewViewProvider {
66
69
window.vscode = acquireVsCodeApi()
67
70
68
71
window.__GLOBAL_CONFIG__ = {
72
+ rootPath: '${ this . #projectPath} ',
69
73
serverBaseUrl: '${ getServerBaseUrl ( ) } ',
70
74
initialRoutePath: '/chat',
71
75
showDiffCodesBtn: true,
@@ -101,7 +105,7 @@ export async function registerWebview(
101
105
contextLoader : ContextLoader ,
102
106
ext : ExtensionContext ,
103
107
) {
104
- const provider = new ChatViewProvider ( ext )
108
+ const provider = new ChatViewProvider ( ext , cwd )
105
109
let webviewDisposer : vscode . Disposable | undefined
106
110
107
111
const dispose = ( ) => {
You can’t perform that action at this time.
0 commit comments