-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
744 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## 6.1.0 (2023-02-13) | ||
|
||
#### Features | ||
|
||
- add code completion for tests | ||
|
||
## 6.0.0 (2023-02-12) | ||
|
||
#### Breaking Changes | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as models from '../models'; | ||
|
||
export type CompletionItem = { | ||
name: string; | ||
description: string; | ||
text?: string; | ||
}; | ||
|
||
export const completionItemProvider: { | ||
emptyLineProvider: Array<(text: string) => Array<CompletionItem>>; | ||
requestHeaderProvider: Array<(request: models.Request) => Array<CompletionItem>>; | ||
} = { | ||
emptyLineProvider: [], | ||
requestHeaderProvider: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export * from './completionItemProvider'; | ||
export * from './fileProvider'; | ||
export * from './logger'; | ||
export * from './httpClientProvider'; | ||
export * from './javascriptProvider'; | ||
export * from './logger'; | ||
export * from './userInteractionProvider'; | ||
export * from './httpClientProvider'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { completionItemProvider } from '../../io'; | ||
|
||
completionItemProvider.emptyLineProvider.push(() => [ | ||
{ | ||
name: '?? status == ', | ||
description: 'Status assert (200)', | ||
}, | ||
{ | ||
name: '?? status == 200', | ||
description: 'Status assert (200)', | ||
}, | ||
{ | ||
name: '?? duration <', | ||
description: 'Duration assert', | ||
}, | ||
{ | ||
name: '?? body contains', | ||
description: 'Body assert', | ||
}, | ||
{ | ||
name: '?? body matches', | ||
description: 'Body assert', | ||
}, | ||
{ | ||
name: '?? body md5', | ||
description: 'Body assert', | ||
}, | ||
{ | ||
name: '?? body sh256', | ||
description: 'Body assert', | ||
}, | ||
{ | ||
name: '?? header', | ||
description: 'Header assert', | ||
}, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { completionItemProvider } from '../../io'; | ||
|
||
completionItemProvider.emptyLineProvider.push((text: string) => { | ||
const result = [ | ||
{ | ||
name: '{{$prompt ', | ||
description: 'Prompt', | ||
}, | ||
{ | ||
name: '{{$input', | ||
description: 'Input', | ||
}, | ||
{ | ||
name: '{{$password', | ||
description: 'Password', | ||
}, | ||
{ | ||
name: '{{$pick <placeholder> $value:', | ||
description: 'Password', | ||
}, | ||
]; | ||
const index = text.lastIndexOf('{{'); | ||
if (index >= 0) { | ||
return result.map(obj => ({ | ||
...obj, | ||
text: `${text}${obj.name.slice(text.length - index)}`, | ||
})); | ||
} | ||
return result; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { completionItemProvider } from '../../io'; | ||
import { isEventSourceRequest } from './eventSourceRequest'; | ||
|
||
completionItemProvider.emptyLineProvider.push(() => [ | ||
{ | ||
name: 'SSE', | ||
description: 'Server Sent Event', | ||
}, | ||
]); | ||
|
||
completionItemProvider.requestHeaderProvider.push(request => { | ||
const result = []; | ||
if (isEventSourceRequest(request)) { | ||
result.push(...[{ name: 'Event', description: 'Server Sent Events to add listener' }]); | ||
} | ||
return result; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { completionItemProvider } from '../../io'; | ||
import { isGrpcRequest } from './grpcRequest'; | ||
|
||
completionItemProvider.emptyLineProvider.push(() => [ | ||
{ | ||
name: 'GRPC', | ||
description: 'GRPC request', | ||
}, | ||
{ | ||
name: 'proto < ./', | ||
description: 'Proto Import', | ||
}, | ||
]); | ||
|
||
completionItemProvider.requestHeaderProvider.push(request => { | ||
const result = []; | ||
if (isGrpcRequest(request)) { | ||
result.push( | ||
...[ | ||
{ | ||
name: 'ChannelCredentials', | ||
description: 'Channel credentials, which are attached to a Channel, such as SSL credentials.', | ||
}, | ||
] | ||
); | ||
} | ||
return result; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.