You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Shanedell (via GitHub)" <gi...@apache.org> on 2023/01/31 18:01:46 UTC
[GitHub] [daffodil-vscode] Shanedell opened a new pull request, #440: Update omega-edit to allow configuration of the server port.
Shanedell opened a new pull request, #440:
URL: https://github.com/apache/daffodil-vscode/pull/440
Update omega-edit to allow configuration of the server port.
Closes #271
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #440: Update omega-edit to allow configuration of the server port.
Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #440:
URL: https://github.com/apache/daffodil-vscode/pull/440#discussion_r1093294990
##########
src/omega_edit/client.ts:
##########
@@ -50,17 +54,38 @@ async function cleanupViewportSession(
async function commonOmegaEdit(
ctx: vscode.ExtensionContext,
startServer: boolean,
- omegaEditPackageVersion: string
+ omegaEditPackageVersion: string,
+ port: number
) {
if (!serverRunning && startServer) {
;[serverTerminal, serverRunning] = await startOmegaEditServer(
ctx,
rootPath,
- omegaEditPackageVersion
+ omegaEditPackageVersion,
+ port
)
}
}
+async function getOmegaEditPort(
+ port: number | undefined = undefined
+): Promise<number> {
+ if (!port) {
+ let portEntered = await vscode.window.showInputBox({
Review Comment:
`const` can be used here.
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #440: Update omega-edit to allow configuration of the server port.
Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #440:
URL: https://github.com/apache/daffodil-vscode/pull/440#discussion_r1093313939
##########
src/omega_edit/utils.ts:
##########
@@ -138,14 +144,29 @@ export async function viewportSubscribe(
export async function startOmegaEditServer(
ctx: vscode.ExtensionContext,
rootPath: string,
- omegaEditPackageVersion: string
+ omegaEditPackageVersion: string,
+ port: number
): Promise<[vscode.Terminal, boolean]> {
const [scriptName, scriptPath] = await omegaEditServer.setupServer(
rootPath,
omegaEditPackageVersion,
ctx.asAbsolutePath('./node_modules/omega-edit')
)
- let terminal = await runScript(scriptPath, scriptName)
+ process.env.OMEGA_EDIT_SERVER_PORT = port.toString()
+
+ let terminal = await runScript(
Review Comment:
`let` could be `const` here. Would it be worth sending the UI an info/warn message about the server starting up successfully or not?
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #440: Update omega-edit to allow configuration of the server port.
Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #440:
URL: https://github.com/apache/daffodil-vscode/pull/440#discussion_r1093313939
##########
src/omega_edit/utils.ts:
##########
@@ -138,14 +144,29 @@ export async function viewportSubscribe(
export async function startOmegaEditServer(
ctx: vscode.ExtensionContext,
rootPath: string,
- omegaEditPackageVersion: string
+ omegaEditPackageVersion: string,
+ port: number
): Promise<[vscode.Terminal, boolean]> {
const [scriptName, scriptPath] = await omegaEditServer.setupServer(
rootPath,
omegaEditPackageVersion,
ctx.asAbsolutePath('./node_modules/omega-edit')
)
- let terminal = await runScript(scriptPath, scriptName)
+ process.env.OMEGA_EDIT_SERVER_PORT = port.toString()
+
+ let terminal = await runScript(
Review Comment:
`let` could be `const` here. Would it be worth sending the UI an info/warn message about the server starting up successfully or not? If there is a message, we can use that when automating the GUI tests to see if the server was started successfully or not. Getting access to the terminal output has been a challenge to get in the GUI tests, so messages will make it more robust.
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #440: Update omega-edit to allow configuration of the server port.
Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #440:
URL: https://github.com/apache/daffodil-vscode/pull/440#discussion_r1093309652
##########
src/omega_edit/utils.ts:
##########
@@ -26,7 +26,13 @@ import { getClient, ALL_EVENTS } from 'omega-edit/settings'
import * as omegaEditServer from 'omega-edit/server'
import { runScript } from '../utils'
-const client = getClient()
+var client
Review Comment:
`var` should be `let`. Should specify the `client` type here as well.
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] scholarsmate commented on pull request #440: Update omega-edit to allow configuration of the server port.
Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on PR #440:
URL: https://github.com/apache/daffodil-vscode/pull/440#issuecomment-1413743396
@mbeckerle or @stevedlawrence, will you review this PR at your earliest convenience? Thanks.
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #440: Update omega-edit to allow configuration of the server port.
Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #440:
URL: https://github.com/apache/daffodil-vscode/pull/440#discussion_r1093322822
##########
src/utils.ts:
##########
@@ -143,7 +143,13 @@ export async function unzipFile(zipFilePath: string, extractPath: string) {
return await new Promise((resolve, reject) => {
let stream = fs
.createReadStream(zipFilePath)
+ /* Ignore error that type Extract is not WritableStream. If converted to
+ * unzip.Extract({ path: `${extractPath}` }).unzipStream it fails completely
+ * but keeping it this way works fine
+ */
+ // @ts-ignore
Review Comment:
Can you cast it `as WritableStream`?
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] Shanedell merged pull request #440: Update omega-edit to allow configuration of the server port.
Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell merged PR #440:
URL: https://github.com/apache/daffodil-vscode/pull/440
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #440: Update omega-edit to allow configuration of the server port.
Posted by "scholarsmate (via GitHub)" <gi...@apache.org>.
scholarsmate commented on code in PR #440:
URL: https://github.com/apache/daffodil-vscode/pull/440#discussion_r1093304529
##########
src/omega_edit/client.ts:
##########
@@ -69,8 +94,13 @@ export function activate(ctx: vscode.ExtensionContext) {
ctx.subscriptions.push(
vscode.commands.registerCommand(
'omega_edit.version',
- async (startServer: boolean = true) => {
- await commonOmegaEdit(ctx, startServer, omegaEditPackageVersion)
+ async (
+ startServer: boolean = true,
+ port: number | undefined = undefined
+ ) => {
+ port = await getOmegaEditPort(port)
+ initOmegaEditClient('127.0.0.1', port.toString())
+ await commonOmegaEdit(ctx, startServer, omegaEditPackageVersion, port)
return await omegaEditVersion.getVersion()
Review Comment:
This is invisible to the end-user using the GUI. Should put the version in an info message as well.
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org