Skip to content

Commit

Permalink
upgrade to Ωedit™ v0.9.73
Browse files Browse the repository at this point in the history
  • Loading branch information
scholarsmate committed Sep 15, 2023
1 parent 1833bf0 commit 2ea8aea
Show file tree
Hide file tree
Showing 11 changed files with 437 additions and 377 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
strategy:
matrix:
os: [macos-11, ubuntu-20.04, windows-2019]
node: [ '14', '16' ]
node: [ '16', '18' ]
fail-fast: false # don't immediately fail all other jobs if a single job fails
runs-on: ${{ matrix.os }}
defaults:
Expand Down
49 changes: 24 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Apache Daffodil",
"license": "Apache-2.0",
"engines": {
"vscode": "^1.60.2"
"vscode": "^1.67.2"
},
"icon": "images/daffodil.ico",
"categories": [
Expand Down Expand Up @@ -46,50 +46,49 @@
"svelte:check": "svelte-check --tsconfig ./tsconfig.json"
},
"dependencies": {
"@omega-edit/client": "0.9.70",
"@vscode/debugadapter": "1.59.0",
"await-notify": "1.0.1",
"hexy": "0.3.4",
"jsonc-parser": "^3.2.0",
"@omega-edit/client": "0.9.73",
"@viperproject/locate-java-home": "1.1.13",
"semver": "^7.1.1",
"@vscode/debugadapter": "1.63.0",
"await-notify": "1.0.1",
"hexy": "0.3.5",
"jsonc-parser": "3.2.0",
"semver": "7.5.4",
"unzip-stream": "0.3.1",
"uuid": "9.0.0",
"wait-port": "1.0.4",
"xdg-app-paths": "8.3.0"
},
"devDependencies": {
"@tsconfig/svelte": "^3.0.0",
"@tsconfig/svelte": "^5.0.2",
"@types/glob": "^8.0.0",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.1",
"@types/vscode": "^1.60.2",
"@types/vscode-webview": "^1.57.1",
"@vscode/debugadapter-testsupport": "1.59.0",
"@vscode/test-electron": "2.1.5",
"@vscode/vsce": "2.19.0",
"chai": "^4.3.7",
"concurrently": "^8.0.1",
"@types/node": "^20.6.1",
"@types/vscode": "^1.67.2",
"@types/vscode-webview": "^1.57.2",
"@vscode/debugadapter-testsupport": "1.63.0",
"@vscode/test-electron": "2.3.4",
"@vscode/vsce": "2.21.0",
"chai": "^4.3.8",
"concurrently": "^8.2.1",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"css-minimizer-webpack-plugin": "^5.0.1",
"glob": "8.0.3",
"glob": "8.1.0",
"mini-css-extract-plugin": "^2.7.6",
"mocha": "10.2.0",
"nodemon": "^3.0.1",
"prettier": "2.8.8",
"prettier-plugin-svelte": "^2.9.0",
"prettier": "3.0.3",
"prettier-plugin-svelte": "3.0.3",
"run-func": "^3.0.0",
"sass": "^1.57.1",
"sass": "^1.67.0",
"svelte": "^3.55.0",
"svelte-check": "^3.0.2",
"svelte-check": "^3.5.1",
"svelte-loader": "^3.1.9",
"svelte-preprocess": "^5.0.4",
"ts-loader": "9.4.4",
"ts-node": "^10.9.1",
"typescript": "5.1.6",
"vscode-extension-tester": "5.5.3",
"webpack": "5.88.1",
"typescript": "5.2.2",
"vscode-extension-tester": "5.9.1",
"webpack": "5.88.2",
"webpack-cli": "5.1.4"
},
"extensionDependencies": [
Expand Down
5 changes: 2 additions & 3 deletions src/adapter/daffodilDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,8 @@ export class DaffodilDebugSession extends LoggingDebugSession {
bp.id = id
return bp
})
const actualBreakpoints = await Promise.all<DebugProtocol.Breakpoint>(
actualBreakpoints0
)
const actualBreakpoints =
await Promise.all<DebugProtocol.Breakpoint>(actualBreakpoints0)

// send back the actual breakpoint positions
response.body = {
Expand Down
56 changes: 43 additions & 13 deletions src/dataEditor/dataEditorClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ import {
getCounts,
getLogger,
getServerHeartbeat,
getServerVersion,
getServerInfo,
getSessionCount,
getViewportData,
IOFlags,
IServerHeartbeat,
IServerInfo,
modifyViewport,
numAscii,
profileSession,
Expand Down Expand Up @@ -70,6 +71,7 @@ import {
} from '../svelte/src/stores/configuration'
import net from 'net'
import * as vscode from 'vscode'
import os from 'os'

// *****************************************************************************
// global constants
Expand All @@ -94,8 +96,19 @@ const OMEGA_EDIT_MIN_PORT: number = 1024
// file-scoped types
// *****************************************************************************

class ServerInfo implements IServerInfo {
serverHostname: string = 'unknown' // hostname
serverProcessId: number = 0 // process id
serverVersion: string = 'unknown' // server version
jvmVersion: string = 'unknown' // jvm version
jvmVendor: string = 'unknown' // jvm vendor
jvmPath: string = 'unknown' // jvm path
availableProcessors: number = 0 // available processors
}

interface IHeartbeatInfo extends IServerHeartbeat {
omegaEditPort: number
omegaEditPort: number // Ωedit server port
serverInfo: IServerInfo // server info that remains constant
}

class HeartbeatInfo implements IHeartbeatInfo {
Expand All @@ -104,14 +117,12 @@ class HeartbeatInfo implements IHeartbeatInfo {
serverCommittedMemory: number = 0 // committed memory in bytes
serverCpuCount: number = 0 // cpu count
serverCpuLoadAverage: number = 0 // cpu load average
serverHostname: string = 'unknown' // hostname
serverMaxMemory: number = 0 // max memory in bytes
serverProcessId: number = 0 // process id
serverTimestamp: number = 0 // timestamp in ms
serverUptime: number = 0 // uptime in ms
serverUsedMemory: number = 0 // used memory in bytes
serverVersion: string = 'unknown' // server version
sessionCount: number = 0 // session count
serverInfo: IServerInfo = new ServerInfo()
}

// *****************************************************************************
Expand All @@ -123,6 +134,7 @@ let checkpointPath: string = ''
let client: EditorClient
let getHeartbeatIntervalId: NodeJS.Timeout | number | undefined = undefined
let heartbeatInfo: IHeartbeatInfo = new HeartbeatInfo()
let serverInfo: IServerInfo = new ServerInfo()
let omegaEditPort: number = 0

// *****************************************************************************
Expand Down Expand Up @@ -302,8 +314,17 @@ export class DataEditorClient implements vscode.Disposable {
serverCpuLoadAverage: heartbeatInfo.serverCpuLoadAverage,
serverUptime: heartbeatInfo.serverUptime,
serverUsedMemory: heartbeatInfo.serverUsedMemory,
serverVersion: heartbeatInfo.serverVersion,
sessionCount: heartbeatInfo.sessionCount,
serverInfo: {
omegaEditPort: heartbeatInfo.omegaEditPort,
serverVersion: heartbeatInfo.serverInfo.serverVersion,
serverHostname: heartbeatInfo.serverInfo.serverHostname,
serverProcessId: heartbeatInfo.serverInfo.serverProcessId,
jvmVersion: heartbeatInfo.serverInfo.jvmVersion,
jvmVendor: heartbeatInfo.serverInfo.jvmVendor,
jvmPath: heartbeatInfo.serverInfo.jvmPath,
availableProcessors: heartbeatInfo.serverInfo.availableProcessors,
},
},
})
}
Expand Down Expand Up @@ -661,8 +682,8 @@ async function createDataEditorWebviewPanel(
// initialize the first server heartbeat
await getHeartbeat()
assert(
heartbeatInfo.serverVersion.length > 0,
'heartbeat did not return a server version'
heartbeatInfo.serverInfo.serverVersion.length > 0,
'heartbeat did not receive a server version'
)
}

Expand Down Expand Up @@ -1096,14 +1117,12 @@ async function getHeartbeat() {
heartbeatInfo.serverCommittedMemory = heartbeat.serverCommittedMemory
heartbeatInfo.serverCpuCount = heartbeat.serverCpuCount
heartbeatInfo.serverCpuLoadAverage = heartbeat.serverCpuLoadAverage
heartbeatInfo.serverHostname = heartbeat.serverHostname
heartbeatInfo.serverMaxMemory = heartbeat.serverMaxMemory
heartbeatInfo.serverProcessId = heartbeat.serverProcessId
heartbeatInfo.serverTimestamp = heartbeat.serverTimestamp
heartbeatInfo.serverUptime = heartbeat.serverUptime
heartbeatInfo.serverUsedMemory = heartbeat.serverUsedMemory
heartbeatInfo.serverVersion = heartbeat.serverVersion
heartbeatInfo.sessionCount = heartbeat.sessionCount
heartbeatInfo.serverInfo = serverInfo
}

async function serverStart() {
Expand Down Expand Up @@ -1158,7 +1177,18 @@ async function serverStart() {
throw new Error('Server failed to start or PID is invalid')
}
const clientVersion = getClientVersion()
const serverVersion = await getServerVersion()
serverInfo = await getServerInfo()
const serverVersion = serverInfo.serverVersion
// if the OS is not Windows, check that the server PID matches the one started
// NOTE: serverPid is the PID of the server wrapper script on Windows
if (
!os.platform().toLowerCase().startsWith('win') &&
serverInfo.serverProcessId !== serverPid
) {
throw new Error(
`server PID mismatch ${serverInfo.serverProcessId} != ${serverPid}`
)
}
if (serverVersion !== clientVersion) {
throw new Error(
`Server version ${serverVersion} and client version ${clientVersion} must match`
Expand All @@ -1167,7 +1197,7 @@ async function serverStart() {
// get an initial heartbeat to ensure the server is up and running
await getHeartbeat()
clearInterval(animationIntervalId)
statusBarItem.text = `Ωedit server v${serverVersion} started on port ${omegaEditPort} with PID ${serverPid}`
statusBarItem.text = `Ωedit server v${serverVersion} started on port ${omegaEditPort} with PID ${serverInfo.serverProcessId}`
setTimeout(() => {
statusBarItem.dispose()
}, 5000)
Expand Down
2 changes: 1 addition & 1 deletion src/dataEditor/demos/demo-highlight_overlays.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<!doctype html>
<html lang="en-US" xmlns="http://www.w3.org/1999/html">
<head>
<title>Demo - Highlight Overlays</title>
Expand Down
2 changes: 1 addition & 1 deletion src/dataEditor/demos/demo-infinite_scrolling.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<!doctype html>
<html lang="en-US">
<head>
<link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ limitations under the License.
import { addressRadix } from '../../stores'
import { radixToString, regexEditDataTest } from '../../utilities/display'
const PROFILE_DOS_EOL = 256
// title for the byte profile graph
export let title: string
Expand Down Expand Up @@ -475,6 +477,11 @@ limitations under the License.
>{numDistinct}</span
></label
>
<label for="dos_eol-count"
>&nbsp;&nbsp;&nbsp;&nbsp;DOS EOL: <span id="dos_eol-count" class="nowrap"
>{byteProfile[PROFILE_DOS_EOL]}</span
></label
>
<label for="ascii-count"
>ASCII Count: <span id="ascii-count" class="nowrap">{numAscii}</span
></label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ limitations under the License.
import { saveable, fileMetrics } from '../../../stores'
import { createEventDispatcher } from 'svelte'
import SidePanel from '../../layouts/SidePanel.svelte'
import ByteFrequencyGraph from '../../DataMetrics/ByteFrequencyGraph.svelte'
import ByteFrequencyGraph from '../../DataMetrics/DataMetrics.svelte'
import { viewport } from '../../../stores'
import { humanReadableByteLength } from '../../../utilities/display'
import { DATA_PROFILE_MAX_LENGTH } from '../../../stores/configuration'
Expand Down
23 changes: 19 additions & 4 deletions src/svelte/src/components/ServerMetrics/ServerMetrics.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ limitations under the License.
let heartbeat = {
latency: 0,
omegaEditPort: 0,
serverCpuLoadAverage: 0,
serverTimestamp: 0,
serverUptime: 0,
serverUsedMemory: 0,
serverVersion: 'Unknown',
sessionCount: 0,
omegaEditPort: 0,
serverVersion: 'Unknown',
serverHostname: 'Unknown',
serverProcessId: 0,
jvmVersion: 'Unknown',
jvmVendor: 'Unknown',
jvmPath: 'Unknown',
availableProcessors: 0,
}
let timerId: NodeJS.Timeout
Expand Down Expand Up @@ -65,13 +71,20 @@ limitations under the License.
switch (msg.data.command) {
case MessageCommand.heartbeat:
heartbeat.latency = msg.data.data.latency
heartbeat.omegaEditPort = msg.data.data.omegaEditPort
heartbeat.serverCpuLoadAverage = msg.data.data.serverCpuLoadAverage
heartbeat.serverTimestamp = msg.data.data.serverTimestamp
heartbeat.serverUptime = msg.data.data.serverUptime
heartbeat.serverUsedMemory = msg.data.data.serverUsedMemory
heartbeat.serverVersion = msg.data.data.serverVersion
heartbeat.sessionCount = msg.data.data.sessionCount
heartbeat.omegaEditPort = msg.data.data.serverInfo.omegaEditPort
heartbeat.serverVersion = msg.data.data.serverInfo.serverVersion
heartbeat.serverHostname = msg.data.data.serverInfo.serverHostname
heartbeat.serverProcessId = msg.data.data.serverInfo.serverProcessId
heartbeat.jvmVersion = msg.data.data.serverInfo.jvmVersion
heartbeat.jvmVendor = msg.data.data.serverInfo.jvmVendor
heartbeat.jvmPath = msg.data.data.serverInfo.jvmPath
heartbeat.availableProcessors =
msg.data.data.serverInfo.availableProcessors
// set the serverTimestamp to 0 after 5 seconds of no heartbeat to indicate that no heartbeat has been received
clearTimeout(timerId)
Expand Down Expand Up @@ -118,6 +131,8 @@ limitations under the License.
{heartbeat.sessionCount},
<b>Uptime:</b>
{prettyPrintUptime(heartbeat.serverUptime)}
<b>JVM Version:</b>
{heartbeat.jvmVersion}
</div>
</FlexContainer>
{:else}
Expand Down
5 changes: 3 additions & 2 deletions src/tests/suite/dataEditor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { after, before } from 'mocha'
import {
createSimpleFileLogger,
getClientVersion,
getServerVersion,
getServerInfo,
setLogger,
startServer,
stopServerUsingPID,
Expand Down Expand Up @@ -133,7 +133,8 @@ suite('Data Editor Test Suite', () => {

test('server and client versions match', async () => {
const clientVersion = getClientVersion()
const serverVersion = await getServerVersion()
const serverInfo = await getServerInfo()
const serverVersion = serverInfo.serverVersion
assert.strictEqual(serverVersion, clientVersion)
assert.strictEqual(fs.existsSync(serverLogFile), true)
assert.strictEqual(fs.existsSync(logFile), true)
Expand Down
Loading

0 comments on commit 2ea8aea

Please sign in to comment.