Shanedell commented on code in PR #509:
URL: https://github.com/apache/daffodil-vscode/pull/509#discussion_r1143885402


##########
src/omega_edit/client.ts:
##########
@@ -145,7 +152,7 @@ export function activate(ctx: vscode.ExtensionContext) {
         port: number | undefined = undefined,

Review Comment:
   Remove this param



##########
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.



##########
src/omega_edit/client.ts:
##########
@@ -145,7 +152,7 @@ export function activate(ctx: vscode.ExtensionContext) {
         port: number | undefined = undefined,
         fileToEdit: string = ''
       ) => {
-        await getOmegaEditPort(port)
+        await getOmegaEditPort(serverPort)

Review Comment:
   See previous comment to remove the port param from the `getOmegaEditPort` 
function since its not needed anymore.



##########
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 thing this 
value shouldn't 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]

Reply via email to