Shanedell commented on code in PR #509:
URL: https://github.com/apache/daffodil-vscode/pull/509#discussion_r1143885018
##########
src/omega_edit/client.ts:
##########
@@ -45,19 +45,21 @@ async function getOmegaEditPort(port: number | undefined =
undefined) {
const defaultServerPort = vscode.workspace
.getConfiguration('dataEditor')
.get<number>('defaultServerPort', serverPort)
- const portEntered = await vscode.window.showInputBox({
- prompt: 'Enter port number to run omega-edit server on',
- value: defaultServerPort.toString(),
- })
- if (portEntered) {
- serverPort = parseInt(portEntered)
- } else {
- serverPort = 0
- throw Error('Bad port entered')
- }
+ serverPort = defaultServerPort
Review Comment:
Update function `getOmegaEditPort` to be
```ts
async function getOmegaEditPort() {
const defaultServerPort = vscode.workspace
.getConfiguration('dataEditor')
.get<number>('serverPort', serverPort)
serverPort = defaultServerPort
}
```
This will always assign a port. Maybe add error checking if the `serverPort
=== 0`.
NOTE: Used `serverPort` instead of `defaultServerPort` as I think it should
be renamed. See
https://github.com/apache/daffodil-vscode/pull/509#discussion_r1143887396
##########
src/omega_edit/client.ts:
##########
@@ -45,19 +45,21 @@ async function getOmegaEditPort(port: number | undefined =
undefined) {
const defaultServerPort = vscode.workspace
.getConfiguration('dataEditor')
.get<number>('defaultServerPort', serverPort)
Review Comment:
Can we rename `defaultServerPort` to `serverPort`? Since it can be updated I
don't think it should have `default` in the name as that makes me think this
value shouldn't be set. This would need updated in the `package.json`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]