MCPcopy Create free account
hub / github.com/Borvik/vscode-postgres / setHostName

Method setHostName

src/commands/addConnection.ts:64–77  ·  view source on GitHub ↗
(input: MultiStepInput, state: Partial<ConnectionState>)

Source from the content-addressed store, hash-verified

62 }
63
64 async setHostName(input: MultiStepInput, state: Partial<ConnectionState>) {
65 state.host = await input.showInputBox({
66 title: this.TITLE,
67 step: input.CurrentStepNumber,
68 totalSteps: this.TotalSteps,
69 prompt: 'The hostname of the database',
70 placeholder: 'ex. 127.0.0.1',
71 ignoreFocusOut: true,
72 value: (typeof state.host === 'string') ? state.host : '',
73 validate: async (value) => (!value || !value.trim()) ? 'Hostname is required' : ''
74 });
75 state.label = state.host;
76 return (input: MultiStepInput) => this.setUsername(input, state);
77 }
78
79 async setUsername(input: MultiStepInput, state: Partial<ConnectionState>) {
80 state.user = await input.showInputBox({

Callers 1

runMethod · 0.95

Calls 2

setUsernameMethod · 0.95
showInputBoxMethod · 0.80

Tested by

no test coverage detected