Skip to content

Commit

Permalink
build with node 16, some version bumps to align with klighd-vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRentzCAU committed Apr 26, 2024
1 parent 2ffe3dc commit f07b7db
Show file tree
Hide file tree
Showing 16 changed files with 1,695 additions and 940 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off"
},
"ignorePatterns": ["**/*.d.ts", "lib", "dist", "webpack.config.js"]
"ignorePatterns": ["**/*.d.ts", "lib", "dist", "pack", "webpack.config.js"]
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 16.x
- run: yarn
- run: yarn package
- run: yarn lint
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist
lerna-debug.log
lib
node_modules
pack
plugins
src-gen
workspace
Expand Down
1 change: 1 addition & 0 deletions keith-vscode/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
'no-underscore-dangle': 0,
'no-nested-ternary': 0,
'no-param-reassign': 0,
'no-empty-function': 0, // messes up "empty" constructors
'class-methods-use-this': 0,
},
settings: {
Expand Down
50 changes: 25 additions & 25 deletions keith-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"homepage": "https://rtsys.informatik.uni-kiel.de/kieler",
"engines": {
"vscode": "^1.60.0"
"vscode": "^1.85.0"
},
"categories": [
"Programming Languages",
Expand Down Expand Up @@ -637,35 +637,35 @@
"vscode:prepublish": "yarn run build"
},
"devDependencies": {
"@types/node": "^12.11.7",
"@types/react": "^17.0.27",
"@types/vscode": "^1.56.0",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"clean-webpack-plugin": "^4.0.0-alpha.0",
"css-loader": "^5.2.4",
"eslint": "^8.4.0",
"@types/node": "^16.11.7",
"@types/react": "^18.3.0",
"@types/vscode": "^1.85.0",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.8.1",
"eslint": "^8.56.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-prettier": "^4.0.0",
"mini-css-extract-plugin": "^1.6.0",
"prettier": "2.5.1",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"mini-css-extract-plugin": "^2.7.6",
"prettier": "3.1.1",
"rimraf": "^4.4.0",
"source-map-loader": "^3.0.0",
"style-loader": "^1.2.1",
"ts-loader": "^9.2.3",
"vsce": "1.88.0",
"webpack": "^5.39.1",
"webpack-cli": "^4.7.2"
"style-loader": "^3.3.3",
"ts-loader": "^9.5.1",
"vsce": "1.95.1",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@kieler/table-webview": "^0.0.3",
"es6-shim": "^0.35.6",
"react": "^17.0.2",
"@kieler/table-webview": "^0.0.5",
"es6-shim": "^0.35.8",
"react": "^18.3.0",
"snabbdom-to-html": "^7.0.0",
"vscode-languageclient": "^5.2.1",
"vscode-uri": "^3.0.2"
"vscode-languageclient": "^9.0.1",
"vscode-uri": "^3.0.8"
}
}
8 changes: 4 additions & 4 deletions keith-vscode/src/error-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2021 by
* Copyright 2021-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand All @@ -16,7 +16,7 @@
*/

import { window } from 'vscode'
import { CloseAction, ErrorAction, ErrorHandler, Message } from 'vscode-languageclient'
import { CloseHandlerResult, ErrorHandler, ErrorHandlerResult, Message } from 'vscode-languageclient'

/**
* Simple LS connection error handling that informs the user about encountered
Expand All @@ -25,15 +25,15 @@ import { CloseAction, ErrorAction, ErrorHandler, Message } from 'vscode-language
export class KeithErrorHandler implements ErrorHandler {
constructor(private defaultHandler: ErrorHandler) {}

error(error: Error, message: Message, count: number): ErrorAction {
error(error: Error, message: Message, count: number): ErrorHandlerResult | Promise<ErrorHandlerResult> {
window.showErrorMessage('Connection to KIELER Language Server produced an error!')
// eslint-disable-next-line no-console
console.error(error)

return this.defaultHandler.error(error, message, count)
}

closed(): CloseAction {
closed(): CloseHandlerResult | Promise<CloseHandlerResult> {
window.showErrorMessage('Connection to KIELER Language Server got closed!')

return this.defaultHandler.closed()
Expand Down
4 changes: 2 additions & 2 deletions keith-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2021-2023 by
* Copyright 2021-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand All @@ -17,7 +17,7 @@

import { connect, NetConnectOpts, Socket } from 'net'
import * as vscode from 'vscode'
import { LanguageClient, LanguageClientOptions, ServerOptions, StreamInfo } from 'vscode-languageclient'
import { LanguageClient, LanguageClientOptions, ServerOptions, StreamInfo } from 'vscode-languageclient/node'
import { Settings, settingsKey } from './constants'
import { KeithErrorHandler } from './error-handler'
import { CompilationDataProvider } from './kico/compilation-data-provider'
Expand Down
24 changes: 12 additions & 12 deletions keith-vscode/src/kico/compilation-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2021 by
* Copyright 2021-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand All @@ -16,7 +16,7 @@
*/

import * as vscode from 'vscode'
import { LanguageClient } from 'vscode-languageclient'
import { LanguageClient } from 'vscode-languageclient/node'
import { Utils } from 'vscode-uri'
import { Settings } from '../constants'
import { SettingsService } from '../settings'
Expand Down Expand Up @@ -151,7 +151,7 @@ export class CompilationDataProvider implements vscode.TreeDataProvider<Compilat
this.context.subscriptions.push(this.compilation)

// Bind notifications to receive
lsClient.onReady().then(() => {
lsClient.start().then(() => {
lsClient.onNotification(
compilationSystemsMessageType,
(systems: CompilationSystem[], snapshotSystems: CompilationSystem[]) => {
Expand Down Expand Up @@ -444,7 +444,7 @@ export class CompilationDataProvider implements vscode.TreeDataProvider<Compilat

async onDidChangeActiveTextEditor(editor: vscode.TextEditor | undefined): Promise<void> {
if (editor && editor.document.uri.scheme === 'file') {
this.lsClient.onReady().then(() => {
this.lsClient.start().then(() => {
this.editor = editor
this.requestSystemDescriptions()
})
Expand Down Expand Up @@ -476,7 +476,7 @@ export class CompilationDataProvider implements vscode.TreeDataProvider<Compilat
this.requestedSystems = true
const uri = this.editor.document.uri.toString()
// Check if language client was already initialized and wait till it is
this.lsClient.onReady().then(async () => {
this.lsClient.start().then(async () => {
await this.lsClient.sendNotification(GET_SYSTEMS, uri)
})
} else {
Expand All @@ -490,7 +490,7 @@ export class CompilationDataProvider implements vscode.TreeDataProvider<Compilat
* @param index index of snapshot
*/
public show(uri: string, index: number): void {
this.lsClient.onReady().then(async () => {
this.lsClient.start().then(async () => {
this.indexMap.set(uri, index)
this.lsClient.sendRequest(SHOW, [uri, `${diagramType}_sprotty`, index])
// original model must not fire this emitter.
Expand Down Expand Up @@ -532,7 +532,7 @@ export class CompilationDataProvider implements vscode.TreeDataProvider<Compilat
// TODO too much information? Test this for visual clutter
vscode.window.showInformationMessage(`Compiling ${uri} with ${command}`)
}
this.lsClient.onReady().then(() => {
this.lsClient.start().then(() => {
this.lsClient.sendNotification(COMPILE, [
uri,
`${diagramType}_sprotty`,
Expand Down Expand Up @@ -631,7 +631,7 @@ export class CompilationDataProvider implements vscode.TreeDataProvider<Compilat
* Notifies the LS to cancel the compilation.
*/
public async requestCancelCompilation(): Promise<void> {
this.lsClient.onReady().then(() => {
this.lsClient.start().then(() => {
this.cancellingCompilation = true
this.lsClient.sendNotification(CANCEL_COMPILATION)
this.compilationFinishedEmitter.fire(false)
Expand Down Expand Up @@ -842,10 +842,10 @@ export class CompilationDataProvider implements vscode.TreeDataProvider<Compilat
parentElement.iconPath = error
? new vscode.ThemeIcon('error')
: warn
? new vscode.ThemeIcon('warning')
: info
? new vscode.ThemeIcon('info')
: ''
? new vscode.ThemeIcon('warning')
: info
? new vscode.ThemeIcon('info')
: ''
if (info || warn || error) {
parentElement.tooltip = 'Check the KIELER Compiler output channel for details'
}
Expand Down
8 changes: 4 additions & 4 deletions keith-vscode/src/model-checker/model-checker-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2022 by
* Copyright 2022-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand All @@ -18,7 +18,7 @@
import { TableWebview } from '@kieler/table-webview/lib/table-webview'
import * as path from 'path'
import * as vscode from 'vscode'
import { LanguageClient } from 'vscode-languageclient'
import { LanguageClient } from 'vscode-languageclient/node'
import { CompilationDataProvider } from '../kico/compilation-data-provider'
import { COMPILE_AND_SIMULATE } from '../simulation/commands'

Expand Down Expand Up @@ -103,13 +103,13 @@ export class ModelCheckerDataProvider implements vscode.WebviewViewProvider {
) {
this.compiler = compiler
// Bind to LSP messages
lsClient.onReady().then(() => {
lsClient.start().then(() => {
lsClient.onNotification(propertiesMessageType, (propertyMsg) => {
this.props = propertyMsg.properties
this.handlePropertiesMessage(this.props)
})
})
lsClient.onReady().then(() => {
lsClient.start().then(() => {
lsClient.onNotification(
updatePropertyStatusMessageType,
(id: string, status: VerificationPropertyStatus, counterexampleUri: string) => {
Expand Down
7 changes: 5 additions & 2 deletions keith-vscode/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2022 by
* Copyright 2022-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand Down Expand Up @@ -39,7 +39,10 @@ export class SettingsService<S> {
* @param settingKeys list of settings to manage. Note: This HAS to be an array containing
* the keys of all settings passed as the class generic.
*/
constructor(private readonly configurationKey: string, settingKeys: SettingList<S>) {
constructor(
private readonly configurationKey: string,
settingKeys: SettingList<S>
) {
this.cache = new Map()

// read current settings into cache
Expand Down
17 changes: 14 additions & 3 deletions keith-vscode/src/simulation/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ export function getNonce(): string {
* Internal data structure to save all data required to display a simulation in the siulation view.
*/
export class SimulationData {
constructor(public data: unknown[], public input: boolean, public output: boolean, public categories: string[]) {}
constructor(
public data: unknown[],
public input: boolean,
public output: boolean,
public categories: string[]
) {}
}

/**
Expand All @@ -77,7 +82,10 @@ export class SimulationStartedMessage {
}

export class Category {
constructor(public name: string, public symbols: string[]) {}
constructor(
public name: string,
public symbols: string[]
) {}
}

/**
Expand All @@ -91,7 +99,10 @@ export class SimulationStepMessage {
* Message send by the LS whenever a simulation is stopped.
*/
export class SimulationStoppedMessage {
constructor(public successful: boolean, public message: string) {}
constructor(
public successful: boolean,
public message: string
) {}
}

export const SimulationDataBlackList: string[] = ['#interface']
Expand Down
8 changes: 4 additions & 4 deletions keith-vscode/src/simulation/simulation-table-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { TableWebview } from '@kieler/table-webview/lib/table-webview'
import * as path from 'path'
import * as vscode from 'vscode'
import { LanguageClient } from 'vscode-languageclient'
import { LanguageClient } from 'vscode-languageclient/node'
import { Settings, SimulationType } from '../constants'
import {
CompilationDataProvider,
Expand Down Expand Up @@ -199,7 +199,7 @@ export class SimulationTableDataProvider implements vscode.WebviewViewProvider {
)

// Bind to LSP messages
lsClient.onReady().then(() => {
lsClient.start().then(() => {
lsClient.onNotification(externalStepMessageType, (message: SimulationStepMessage) => {
this.handleStepMessage(message)
})
Expand Down Expand Up @@ -525,7 +525,7 @@ export class SimulationTableDataProvider implements vscode.WebviewViewProvider {
if (this.kico.editor && !this.simulationRunning) {
// The uri of the current editor is needed to identify the already compiled snapshot that is used to start the simulation.
const uri = this.kico.lastCompiledUri
this.lsClient.onReady().then(() => {
this.lsClient.start().then(() => {
this.lsClient.sendNotification('keith/simulation/start', [uri, this.settings.get('simulationType')])
})
this.simulationStatus.text = '$(spinner) Starting simulation...'
Expand Down Expand Up @@ -784,7 +784,7 @@ export class SimulationTableDataProvider implements vscode.WebviewViewProvider {
* Start the simulation visualization socket server and opens a browser window.
*/
openExternalKVizView(): void {
this.lsClient.onReady().then(() => {
this.lsClient.start().then(() => {
this.lsClient.sendNotification('keith/simulation/startVisualizationServer')
})
vscode.env.openExternal(vscode.Uri.parse('http://localhost:5010/visualization'))
Expand Down
4 changes: 2 additions & 2 deletions keith-vscode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"target": "es2017",
"outDir": "dist",
"lib": ["es6", "dom"],
"lib": ["es2017", "dom"],
"jsx": "react",
"sourceMap": true,
"rootDir": "src",
Expand Down
Loading

0 comments on commit f07b7db

Please sign in to comment.