Skip to content

Commit

Permalink
Language server protocol / VS Code extension (ThalesGroup#31)
Browse files Browse the repository at this point in the history
* Add VS code extension for XSMP modeler

* Removing qualified version for ls.jar

* Update CI

Signed-off-by: Cyril Vrousos <[email protected]>

* Add content assist

* Add hover services on keywords

* Implemented unit tests

---------

Signed-off-by: Cyril Vrousos <[email protected]>
Co-authored-by: cyrilvrousos-tas <[email protected]>
  • Loading branch information
cyrilvrousos-tas and cyrilvrousos authored Jul 24, 2023
1 parent b45c0b0 commit 0326104
Show file tree
Hide file tree
Showing 67 changed files with 2,603 additions and 388 deletions.
109 changes: 67 additions & 42 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow will release the Eclipse repository on github when a new tag is pushed
# This workflow will release the Eclipse repository on GitHub when a new tag is pushed

name: Release on github
name: Release on GitHub

on:
push:
Expand All @@ -9,48 +9,73 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
This release contains XSMP modeler ${{ github.ref_name }}
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Install npm dependencies
working-directory: org.eclipse.xsmp.vscode_extension
run: |
npm install
npm install -g @vscode/vsce
- name: Package VS Code Extension
working-directory: org.eclipse.xsmp.vscode_extension
run: |
vsce package --out "target/xsmp-modeler.vsix"
ls -l target
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
This release contains XSMP modeler ${{ github.ref_name }}
To install XSMP Modeler in Eclipse, add or update the XSMP [software site](https://help.eclipse.org/latest/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/tasks-127.htm) with URL:
`jar:https://github.com/ThalesGroup/xsmp-modeler-core/releases/download/${{ github.ref_name }}/org.eclipse.xsmp.repository-${{ github.ref_name }}.zip!/`
To use XSMP Modeler in Visual Studio Code, please install this [extension](https://github.com/ThalesGroup/xsmp-modeler-core/releases/download/${{ github.ref_name }}/xsmp-modeler-${{ github.ref_name }}.vsix).
draft: true
prerelease: false

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/org.eclipse.xsmp.repository/target/org.eclipse.xsmp.repository.zip
asset_name: org.eclipse.xsmp.repository-${{ github.ref_name }}.zip
asset_content_type: application/zip

- name: Upload extension
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/org.eclipse.xsmp.vscode_extension/target/xsmp-modeler.vsix
asset_name: xsmp-modeler-${{ github.ref_name }}.vsix
asset_content_type: application/octet-stream

To install, add or update the XSMP [software site](https://help.eclipse.org/latest/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/tasks-127.htm) with URL:
`jar:https://github.com/ThalesGroup/xsmp-modeler-core/releases/download/${{ github.ref_name }}/org.eclipse.xsmp.repository-${{ github.ref_name }}.zip!/`
draft: true
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/org.eclipse.xsmp.repository/target/org.eclipse.xsmp.repository.zip
asset_name: org.eclipse.xsmp.repository-${{ github.ref_name }}.zip
asset_content_type: application/zip
- name: Publish release
uses: StuYarrow/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ steps.create_release.outputs.id }}

- name: Publish release
uses: StuYarrow/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ steps.create_release.outputs.id }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

## Get started

XSMP Modeler is an Eclipse framework for development of SMDL (Simulation Model Definition Language) as defined in the [ECSS SMP standard](https://ecss.nl/standard/ecss-e-st-40-07c-simulation-modelling-platform-2-march-2020/).
XSMP Modeler is a framework for development of SMDL (Simulation Model Definition Language) as defined in the [ECSS SMP standard](https://ecss.nl/standard/ecss-e-st-40-07c-simulation-modelling-platform-2-march-2020/).

The primary supported IDE is Eclipse. LSP extension for Visual Studio Code is also provided (preview).

It comes with:
- an integrated Text Editor with coloring, error checking, auto-completion, formatting, hover information, outline, quick fix, ...
Expand Down
4 changes: 2 additions & 2 deletions org.eclipse.xsmp.forms/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Require-Bundle: org.eclipse.xsmp,
org.eclipse.emfforms.editor,
org.eclipse.emfforms.swt.core.di,
org.eclipse.xtext.ui,
org.eclipse.xsmp.ui,
org.eclipse.e4.core.contexts,
org.eclipse.emf.ecp.edit.swt,
org.eclipse.emf.ecp.common.ui
org.eclipse.emf.ecp.common.ui,
org.eclipse.xsmp.ide;bundle-version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Service-Component: OSGI-INF/uuidRendererService.xml,
OSGI-INF/expressionRendererService.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.eclipse.emfforms.common.Optional;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.xsmp.ui.contentassist.IReferenceFilter;
import org.eclipse.xsmp.ide.contentassist.IReferenceFilter;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.scoping.IScopeProvider;

Expand Down
11 changes: 11 additions & 0 deletions org.eclipse.xsmp.ide.tests/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
40 changes: 40 additions & 0 deletions org.eclipse.xsmp.ide.tests/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.xsmp.ide.tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
15 changes: 15 additions & 0 deletions org.eclipse.xsmp.ide.tests/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//outlet.DEFAULT_OUTPUT.sourceFolder.src/main/java.directory=xtend-gen
//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=xtend-gen
BuilderConfiguration.is_project_specific=true
eclipse.preferences.version=1
outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ eclipse.preferences.version=1
idePrefixKey=
projectKey=ThalesGroup_xsmp-modeler-core
serverId=SonarCloud/thalesgroup
sqPrefixKey=org.eclipse.xsmp.ide
sqPrefixKey=org.eclipse.xsmp.ide.tests
23 changes: 23 additions & 0 deletions org.eclipse.xsmp.ide.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.xsmp.ide.tests
Bundle-ManifestVersion: 2
Bundle-Name: org.eclipse.xsmp.ide.tests
Bundle-Vendor: Thales Alenia Space
Bundle-Version: 1.1.0.qualifier
Bundle-SymbolicName: org.eclipse.xsmp.ide.tests;singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xtext.testing,
org.eclipse.xtext.ide,
org.junit;bundle-version="4.13.2",
org.eclipse.xsmp;bundle-version="1.1.0",
org.eclipse.xsmp.ide;bundle-version="1.1.0",
org.eclipse.xsmp.lib;bundle-version="1.1.0",
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
org.apache.commons.commons-io;bundle-version="2.11.0",
org.eclipse.xtend.lib;bundle-version="2.30.0",
org.eclipse.lsp4j;bundle-version="0.20.1",
org.eclipse.lsp4j.jsonrpc;bundle-version="0.20.1"
Import-Package: org.junit.jupiter.api;version="[5.1.0,6.0.0)",
org.junit.jupiter.api.extension;version="[5.1.0,6.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: org.eclipse.xsmp.ide.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.xsmp.ide.XsmpcatIdeSetup
3 changes: 3 additions & 0 deletions org.eclipse.xsmp.ide.tests/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source.. = src/
bin.includes = .,\
META-INF/
25 changes: 25 additions & 0 deletions org.eclipse.xsmp.ide.tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xsmp</groupId>
<artifactId>org.eclipse.xsmp.parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.xsmp.ide.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>

<properties>
<sonar.sources></sonar.sources>
<sonar.tests>src</sonar.tests>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*******************************************************************************
* Copyright (C) 2023 THALES ALENIA SPACE FRANCE.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
package org.eclipse.xsmp.ide.tests;

import org.eclipse.xtext.testing.AbstractLanguageServerTest;

public abstract class AbstractXsmpcatLanguageServerTest extends AbstractLanguageServerTest
{

public AbstractXsmpcatLanguageServerTest()
{
super("xsmpcat");
}
}
Loading

0 comments on commit 0326104

Please sign in to comment.