Skip to content

Commit

Permalink
Merge pull request #95 from kieler/nre/updates-semantics-140
Browse files Browse the repository at this point in the history
Version Updates
  • Loading branch information
NiklasRentzCAU authored Apr 29, 2024
2 parents 80e3acc + f07b7db commit b91454f
Show file tree
Hide file tree
Showing 16 changed files with 1,697 additions and 956 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
22 changes: 4 additions & 18 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 Expand Up @@ -59,25 +59,11 @@ export function deactivate(): Promise<void> {
})
}

/** Returns the codename used by KIELER for current OS plattform. */
function getPlattformType(): 'linux' | 'win' | 'osx' {
switch (process.platform) {
case 'linux':
return 'linux'
case 'win32':
return 'win'
case 'darwin':
return 'osx'
default:
throw new Error(`Unknown plattform "${process.platform}".`)
}
}

/**
* Depending on the launch configuration, returns {@link ServerOptions} that either
* connect to a socket or start the LS as a process. It uses a socket if the
* environment variable `KEITH_LS_PORT` is present. Otherwise it runs the jar located
* at `server/kieler-language-server.{platform}.jar`.
* at `server/kieler-language-server.jar`.
*/
function createServerOptions(context: vscode.ExtensionContext): ServerOptions {
// Connect to language server via socket if a port is specified as an env variable
Expand All @@ -99,7 +85,7 @@ function createServerOptions(context: vscode.ExtensionContext): ServerOptions {
}
// eslint-disable-next-line no-console
console.log('Spawning the language server as a process.')
const lsPath = context.asAbsolutePath(`server/kieler-language-server.${getPlattformType()}.jar`)
const lsPath = context.asAbsolutePath(`server/kieler-language-server.jar`)

return {
run: { command: 'java', args: ['-Djava.awt.headless=true', '-jar', lsPath] },
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
Loading

0 comments on commit b91454f

Please sign in to comment.