1
Move your VS Code extension into Eclipse Che
Florent Benoit
Move your VS Code extension into Eclipse Che Florent Benoit 1 - - PowerPoint PPT Presentation
Move your VS Code extension into Eclipse Che Florent Benoit 1 Eclipse Che 7 Eclipse Che 7 2 Devfile Devfile to share workspaces apiVersion : 1.0.0 metadata: generateName : python- Project projects : - Name Repo Branch name :
1
Florent Benoit
2
Eclipse Che 7
Devfile to share workspaces
Devfile
apiVersion: 1.0.0 metadata: generateName: python- projects:
source: type: git location: "https://github.com/che-samples/python-hello-world.git" components:
id: ms-python/python/latest memoryLimit: 512Mi
alias: python image: quay.io/eclipse/che-python-3.7:nightly memoryLimit: 512Mi mountSources: true commands:
actions:
component: python command: "python hello-world.py" workdir: ${CHE_PROJECTS_ROOT}/python-hello-world
Build Env Runtime Env Commands IDE Tools Plug-ins Dep Project Name Repo Branch Test Env Build Run Debug
Che 7: swappable editor
4
Che 7: registries
5
Registries in Eclipse Che
plug-in registry devfile registry workspace
Theia IDE and plug-ins
6
This afternoon: 5PM Seminarraum 5
More about che 7
7
8
Develop VS Code extensions
Debug Run inside Eclipse Che IDE Run Run inside Eclipse Che IDE
VS Code extensions
9
Scaffolding: Yeoman generator yo code Develop Intellisense from Eclipse Che IDE
How to start ?
VS Code extensions hosted mode
Hosted / development mode
10
Two instances of Theia
Browser Che / Theia Container Main Theia Server Hosted Theia Server Theia IDE
(plugin source)
Hosted Mode
(running plugin)
Serves Serves
Demo #1 Develop and debug VSCode extension youtube
11
12
Develop VS Code extensions
Che 7: registries
13
Registries in Eclipse Che
plug-in registry devfile registry workspace
Devfile
metadata: name: my-che-workspace components:
id: redhat/java11/latest
plug-in registry devfile
14
https://che-plugin-registry.openshift.io/v3/plugins/
Devfile and registries
metadata: name: my-che-workspace components:
che plug-in registry devfile my registry
15
Create its own registry
16
Create its own registry on github
17
Demo #2 VSCode extension with custom plugin registry youtube
18
19
VS Code extensions and Eclipse Che
Eclipse Che Workspaces
plug-ins per workspace BENEFITS
Cloud Ready
Kubernetes / OpenShift
Plug-in Registry
Global / per instance
20
Multi-user / auth
OpenID Connect / LDAP / Keycloak
Custom namespace
21
@eclipse-che/plugin namespace
https://github.com/eclipse/che-theia/blob/master/extensions/eclipse-che-theia-plugin/src/che-pr
export namespace
workspace { export function getCurrentWorkspace() : Promise<cheApi.workspace .Workspace >; export function getAll() : Promise<cheApi.workspace .Workspace []>; export function getAllByNamespace( namespace : string): Promise<cheApi.workspace .Workspace []>; export function getById( workspaceId : string): Promise<cheApi.workspace .Workspace >; export function create( config: cheApi.workspace .WorkspaceConfig , params: KeyValue ): Promise<any>; export function update( workspaceId : string, workspace : cheApi.workspace .Workspace ): Promise<any>; export function deleteWorkspace( workspaceId : string): Promise<any>; export function start(workspaceId : string, environmentName : string): Promise<any>; export function startTemporary( config: cheApi.workspace .WorkspaceConfig ): Promise<any>; export function stop(workspaceId : string): Promise<any>; export function getSettings() : Promise<KeyValue >; }
import * as che from '@eclipse-che/plugin'; ... await che.workspace.getCurrentWorkspace();
EXTERNAL PLUG-IN DEPENDENCIES
22
System Runtime dependencies / Language server protocol Java LSP needs Java, PHP requires PHP, etc Native libraries Tools dependencies $ apt-get install / yum install
VS Code
Plugin1 PluginN
Standalone VS Code
Java 11 container
Plugin 1
Main IDE Container
Plugin 3
JSON RPC
Java 13 container
Plugin 2
Eclipse Che with containers
Che IDE Endpoint Che IDE Endpoint PLUG-IN RUNTIME
23
Java installed on your system
Che Remote Theia endpoint
How sidecar endpoint is working ?
FROM eclipse/che-theia-endpoint-runtime:next RUN apk --no-cache add openjdk11 -repository =http://dl-cdn.alpinelinux.org/alpine/edge/community ENV JAVA_HOME /usr/lib/jvm/default-jvm/ FROM eclipse/che-theia-endpoint-runtime:next RUN apk --no-cache add fortune
24
Che Remote Theia endpoint : some limitations
How sidecar endpoint is working ?
25
○ (better to use same version of theia on main theia and sidecars)
Che Remote Theia endpoint : some limitations
How sidecar endpoint is working ?
26
○ (better to use same version of theia on main theia and sidecars)
Upcoming Eclipse Che 7.4 : endpoint improvements
How sidecar endpoint is working ?
27
○ Using nexe tool on Eclipse Che Theia remote package
FROM docker.io/openjdk:14-alpine
Custom runtime
28
apiVersion: v2 publisher: redhat name: vscode-xml version: latest type: VS Code extension displayName: XML title: XML Language Support by Red Hat description: This VS Code extension provides support for creating and editing XML documents, based on the LSP4XML language server, running with Java. icon: https://www.eclipse.org/che/images/logo-eclipseche.svg repository: https://github.com/redhat-developer/vscode-xml category: Language firstPublicationDate: '2019-04-19' spec:
containers:
name: vscode-xml memoryLimit: "768Mi"
extensions:
Use a custom runtime for a VS Code extension : meta.yaml
Demo #3 VSCode extension with custom runtime youtube
30
Develop VS Code extensions
31
VS Code extensions
https://che-incubator.github.io/vscode-theia-comparator/status.html
32
VS Code extensions
Theia-vscodecov checker
https://github.com/theia-ide/theia-vscodecov
$ cd my-vscode-extension $ npx theia-vscodecov
33
Develop VS Code extensions
34
FUTURE
35
Getting started with Eclipse Che
github.com/eclipse/che
che-dev@eclipse.org
http://eclipse.org/che/docs
https://mattermost.eclipse.org
Get started with Eclipse Che
linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat Red Hat is the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500.
36