Skip to content

Commit

Permalink
Fix version, set build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbos committed Jun 17, 2020
1 parent cdb8998 commit d565cf0
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 17 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# archetype-languageserver
A language server for OpenEHR archetypes, to be used in your favorite IDE

Warning: probably will not compile yet, you need the branch preserve_aom_file_positions in github.com/openehr/archie to compile against for this to work.
# Build instructions
- clone github.com/openehr/archie, branch preserve_aom_file_positions
- add `includeBuild 'path-to-archie'` in your settings.gradle file
- download the mac, linux, and windows openJDK binaries, version 14 or newer
- use one of the version 14 openJDK vms to compile the project
- copy `gradle.example.properties` to `gradle.properties`
- cahnge the JDK locations in the gradle properties file
- `./gradlew clean build runtime buildExtension`

The output will be in the .vsix file in `./vscode-extension`.

It contains a linked windows, linux and macos JRE from the OpenJDK project, so should run on whatever OS needed, but x86 only for now.
If you want ARM, very easy as well, just download the ARM openJDK and change the runtime config in build.gradle

This is not yet published to the VSCode marketplace, so instructions for that will follow later.

You also need to integrate this into your favorite IDE of choice. connects using a socket, port 1278, for now, for development purposes, integrated vscode extension, dev extension and better instructions coming soon.
43 changes: 29 additions & 14 deletions vscode-extension/client/src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import * as net from 'net';

import * as path from 'path';
import {Trace} from 'vscode-jsonrpc';
import { window, workspace, commands, ExtensionContext, Uri } from 'vscode';
import { LanguageClient, LanguageClientOptions, ExecutableOptions, Executable, StreamInfo, Position as LSPosition, Location as LSLocation, TransportKind } from 'vscode-languageclient';
Expand All @@ -22,24 +22,39 @@ export function activate(context: ExtensionContext) {
// };

let serverOptions;
if(process.platform == 'win32') {
serverOptions = {
run: {
command: context.extensionPath + '\\archie-lsp-shadow\\bin\\archie-lsp.bat'
if(process.arch != 'x32' && process.arch != 'x64') {
throw 'unsupported CPU, this extension only runs on windows, macos or linux on x86 CPUs: ' + process.arch
}
if (process.platform == 'win32') {
serverOptions = {
run: {
command: path.join(context.extensionPath , 'lsp-images', 'archie-lsp-winx64', 'bin', 'archie-lsp.bat')
},
debug: {
command: context.extensionPath + '\\archie-lsp-shadow\\bin\\archie-lsp.bat'
debug: {
command: path.join(context.extensionPath , 'lsp-images', 'archie-lsp-winx64', 'bin', 'archie-lsp.bat')
}
}
} else {
};
}
else if(process.platform == 'darwin') {
serverOptions = {
run: {
command: context.extensionPath + '/archie-lsp-shadow/bin/archie-lsp'
run: {
command: path.join(context.extensionPath , 'lsp-images', 'archie-lsp-macos', 'bin', 'archie-lsp')
},
debug: {
command: context.extensionPath + '/archie-lsp-shadow/bin/archie-lsp'
debug: {
command: path.join(context.extensionPath , 'lsp-images', 'archie-lsp-macos', 'bin', 'archie-lsp')
}
}
};
} else if (process.platform == 'linux') {
serverOptions = {
run: {
command: path.join(context.extensionPath , 'lsp-images', 'archie-lsp-linux-x64', 'bin', 'archie-lsp')
},
debug: {
command: path.join(context.extensionPath , 'lsp-images', 'archie-lsp-linux-x64', 'bin', 'archie-lsp')
}
};
} else {
throw 'unsupported platform, this extension only runs on windows, macos or linux on x86 CPUs: ' + process.platform
}

let clientOptions: LanguageClientOptions = {
Expand Down
2 changes: 1 addition & 1 deletion vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "OpenEHR ADL support, including syntax highlighting and validation",
"author": "Nedap Healthcare",
"license": "Apache",
"version": "1.0.0",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/nedap/archetype-languageserver"
Expand Down

0 comments on commit d565cf0

Please sign in to comment.