Shanedell commented on code in PR #509:
URL: https://github.com/apache/daffodil-vscode/pull/509#discussion_r1144059232
##########
src/omega_edit/client.ts:
##########
@@ -36,29 +37,21 @@ export function getOmegaEditPackageVersion(filePath:
fs.PathLike) {
]
}
-function getServerPidFile() {
+function getServerPidFile(port?: number) {
return path.join(appDataPath, `serv-${serverPort}.pid`)
}
-async function getOmegaEditPort(port: number | undefined = undefined) {
- if (!port) {
- const defaultServerPort = vscode.workspace
+async function getOmegaEditPort() {
+ if (serverPort === 0) {
+ serverPort = 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 {
+ .get<number>('defaultServerPort', defaultServerPort)
Review Comment:
@stricklandrbls I think this variable in `dataEditor` config should be
changed to `serverPort`.
So in `package.json` I believe `dataEditor.defaultServerPort` needs to be
changed to `dataEditor.serverPort`. Then here it should do
`.get<number>('serverPort', defaultServerPort)`. The configuration variable
having `default` in the name makes me think it should not be set.
--
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]