Skip to content

Commit dc70472

Browse files
AnHeuermannosman362
andcommitted
Modelica Language Server initial commit
Co-authored-by: osman362 <136453917+osman362@users.noreply.github.com>
0 parents  commit dc70472

41 files changed

Lines changed: 5876 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/**
2+
client/node_modules/**
3+
client/out/**
4+
server/node_modules/**
5+
server/out/**

.eslintrc.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**@type {import('eslint').Linter.Config} */
2+
// eslint-disable-next-line no-undef
3+
module.exports = {
4+
root: true,
5+
parser: '@typescript-eslint/parser',
6+
plugins: [
7+
'@typescript-eslint',
8+
],
9+
extends: [
10+
'eslint:recommended',
11+
'plugin:@typescript-eslint/recommended',
12+
],
13+
rules: {
14+
'semi': [2, "always"],
15+
'@typescript-eslint/no-unused-vars': 0,
16+
'@typescript-eslint/no-explicit-any': 0,
17+
'@typescript-eslint/explicit-module-boundary-types': 0,
18+
'@typescript-eslint/no-non-null-assertion': 0,
19+
}
20+
};

.github/dependabot

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: monthly

.github/workflows/test.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*.*.*"
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup npm
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
registry-url: https://registry.npmjs.org/
25+
26+
- name: Install X server
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y xvfb
30+
31+
- name: Install the dependencies
32+
run: npm clean-install && npm run postinstall
33+
34+
- name: Build package
35+
run: npm run esbuild
36+
37+
- name: Test language server
38+
run: npm run test:server
39+
40+
- name: Test language server client
41+
run: |
42+
Xvfb -ac :99 -screen 0 1280x1024x16 &
43+
export DISPLAY=:99
44+
npm run test
45+
46+
- name: Package Extension
47+
run: npx vsce package
48+
49+
- name: Archive vsix package
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: modelica-language-server.vsix
53+
path: modelica-language-server-*.vsix
54+
55+
release:
56+
if: startsWith(github.ref, 'refs/tags/')
57+
needs: build
58+
runs-on: ubuntu-latest
59+
permissions:
60+
contents: write
61+
steps:
62+
- uses: actions/download-artifact@v4
63+
with:
64+
name: modelica-language-server.vsix
65+
66+
- name: Release
67+
uses: softprops/action-gh-release@v1
68+
with:
69+
files: |
70+
modelica-language-server-*.vsix
71+
fail_on_unmatched_files: true
72+
generate_release_notes: true
73+
append_body: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode-test
2+
modelica-language-server*.vsix
3+
node_modules/
4+
out/

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
// List of extensions which should be recommended for users of this workspace.
5+
"recommendations": [
6+
"dbaeumer.vscode-eslint",
7+
"AnHeuermann.metamodelica"
8+
]
9+
}

.vscode/launch.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// A launch configuration that compiles the extension and then opens it inside a
2+
// new window
3+
{
4+
"version": "0.2.0",
5+
"configurations": [
6+
{
7+
"name": "Launch Client",
8+
"type": "extensionHost",
9+
"request": "launch",
10+
"runtimeExecutable": "${execPath}",
11+
"args": [
12+
"--extensionDevelopmentPath=${workspaceRoot}"
13+
],
14+
"outFiles": [
15+
"${workspaceRoot}/out/**/*.js"
16+
],
17+
"preLaunchTask": {
18+
"type": "npm",
19+
"script": "esbuild-watch"
20+
}
21+
},
22+
{
23+
"name": "Language Server E2E Test",
24+
"type": "extensionHost",
25+
"request": "launch",
26+
"runtimeExecutable": "${execPath}",
27+
"args": [
28+
"--extensionDevelopmentPath=${workspaceRoot}",
29+
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
30+
"${workspaceRoot}/client/testFixture"
31+
],
32+
"outFiles": [
33+
"${workspaceRoot}/client/out/test/**/*.js"
34+
],
35+
"preLaunchTask": {
36+
"type": "npm",
37+
"script": "test-compile"
38+
}
39+
}
40+
]
41+
}

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.insertSpaces": false,
3+
"typescript.tsc.autoDetect": "off",
4+
"typescript.preferences.quoteStyle": "single",
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": "explicit"
7+
}
8+
}

.vscode/tasks.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "compile",
7+
"group": "build",
8+
"presentation": {
9+
"panel": "dedicated",
10+
"reveal": "never"
11+
},
12+
"problemMatcher": [
13+
"$tsc"
14+
]
15+
},
16+
{
17+
"type": "npm",
18+
"script": "watch",
19+
"isBackground": true,
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
"presentation": {
25+
"panel": "dedicated",
26+
"reveal": "never"
27+
},
28+
"problemMatcher": [
29+
"$tsc-watch"
30+
]
31+
}
32+
]
33+
}

.vscodeignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
!server/OSMC-License.txt
2+
.eslintignore
3+
.github
4+
.gitignore
5+
.travis.yml
6+
.vscode/**
7+
**/*.map
8+
**/*.ts
9+
**/tsconfig.base.json
10+
**/tsconfig.json
11+
client/
12+
contributing.md
13+
esbuild.config.js
14+
node_modules/
15+
scripts/
16+
server/

0 commit comments

Comments
 (0)