move your vs code extension into eclipse che
play

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. Move your VS Code extension into Eclipse Che Florent Benoit 1

  2. Eclipse Che 7 Eclipse Che 7 2

  3. Devfile Devfile to share workspaces apiVersion : 1.0.0 metadata: generateName : python- Project projects : - Name Repo Branch name : python-hello-world source: type : git IDE location : "https://github.com/che-samples/python-hello-world.git" components : Tools Plug-ins Dep - type : chePlugin Build Env id : ms-python/python/latest memoryLimit : 512Mi - type : dockerimage Runtime Env alias : python image : quay.io/eclipse/che-python-3.7:nightly memoryLimit : 512Mi Test Env mountSources : true commands : - Commands name : run actions : - Build Run Debug type : exec component : python command : "python hello-world.py" workdir : ${CHE_PROJECTS_ROOT}/python-hello-world

  4. Che 7: swappable editor 4

  5. Che 7: registries Registries in Eclipse Che plug-in registry devfile registry workspace 5

  6. Theia IDE and plug-ins Manage all plugins including VS Code extensions 6

  7. More about che 7 Eclipse Che 7: The new, the noteworthy and the future plans! This afternoon: 5PM Seminarraum 5 7

  8. Develop VS Code extensions Develop VS Code extensions 8

  9. VS Code extensions How to start ? Scaffolding: Yeoman generator yo code Develop Intellisense from Eclipse Che IDE Run Run inside Eclipse Che IDE Debug Run inside Eclipse Che IDE 9

  10. VS Code extensions hosted mode Hosted / development mode Browser Che / Theia Container Two instances of Theia Serves Main Theia Theia IDE Main instance to write plug-ins ● Server ( plugin source ) A new instance to run plug-ins ● Serves Hosted Theia Hosted Mode Server ( running plugin ) 10

  11. Demo Demo #1 Develop and debug VSCode extension youtube 11

  12. Develop VS Code extensions Publish VS Code extensions on Eclipse Che registries 12

  13. Che 7: registries Registries in Eclipse Che plug-in registry devfile registry workspace 13

  14. Devfile --- apiVersion: 1.0.0 metadata: name: my-che-workspace components: - type: chePlugin id: redhat/java11/latest plug-in registry devfile https://che-plugin-registry.openshift.io/v3/plugins/ 14

  15. Devfile and registries --- apiVersion: 1.0.0 metadata: name: my-che-workspace components: che plug-in registry - type: chePlugin - reference: https://my-registry/plugins/florent/hello/0.1/meta.yaml devfile my registry 15

  16. Create its own registry Build a custom registry based on existing one Add / update / remove plug-ins ● Rebuild docker image ● 16

  17. Create its own registry on github Or use a simple github project 17

  18. Demo Demo #2 VSCode extension with custom plugin registry youtube 18

  19. VS Code extensions and Eclipse Che VS Code extensions and Eclipse Che 19

  20. BENEFITS ECLIPSE CHE Eclipse Che Workspaces Multi-user / auth plug-ins per workspace OpenID Connect / LDAP / Keycloak Plug-in Registry Cloud Ready Global / per instance Kubernetes / OpenShift 20

  21. Custom namespace @eclipse-che/plugin namespace Interact easily with Eclipse Che API ● https://github.com/eclipse/che-theia/blob/master/extensions/eclipse-che-theia-plugin/src/che-pr oposed.d.ts 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 >; } Simple code to use ● import * as che from '@eclipse-che/plugin'; ... 21 await che.workspace.getCurrentWorkspace();

  22. EXTERNAL PLUG-IN DEPENDENCIES System Runtime dependencies / Language server protocol Java LSP needs Java, PHP requires PHP, etc Tools dependencies $ apt-get install / yum install Native libraries 22

  23. PLUG-IN RUNTIME ECLIPSE CHE Standalone VS Code Eclipse Che with containers Java 11 Java 13 container container Plugin 1 Plugin 2 VS Code Che IDE Che IDE Endpoint Endpoint Plugin1 PluginN JSON RPC Main IDE Container Plugin 3 Java installed on your system 23

  24. How sidecar endpoint is working ? Che Remote Theia endpoint 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

  25. How sidecar endpoint is working ? Che Remote Theia endpoint : some limitations Needs to inherit from a dedicated Docker image ● Workaround with multi-staged builds ● Strong link between Theia image and sidecar images ● (better to use same version of theia on main theia ○ and sidecars) 25

  26. How sidecar endpoint is working ? Che Remote Theia endpoint : some limitations Needs to inherit from a dedicated Docker image ● Workaround with multi-staged builds ● Strong link between Theia image and sidecar images ● (better to use same version of theia on main theia ○ and sidecars) 26

  27. How sidecar endpoint is working ? Upcoming Eclipse Che 7.4 : endpoint improvements Create a single all-in-one binary for this endpoint ● Using nexe tool on Eclipse Che Theia remote package ○ Copy this binary and run it ● Allow to use existing dockers image from docker registries ● FROM docker.io/openjdk:14-alpine ⇒ no need to build images, use image name in plugin’s meta.yaml ● 27

  28. Custom runtime Use a custom runtime for a VS Code extension : meta.yaml 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: - image: "docker.io/eclipse/che-remote-plugin-runner-java11:next" name: vscode-xml memoryLimit: "768Mi" extensions: - https://github.com/redhat-developer/vscode-xml/releases/download/0.7.0/vscode-xml-0.7.0-3205.vsix 28

  29. Demo Demo #3 VSCode extension with custom runtime youtube

  30. Develop VS Code extensions Status 30

  31. VS Code extensions https://che-incubator.github.io/vscode-theia-comparator/status.html 31

  32. VS Code extensions Theia-vscodecov checker https://github.com/theia-ide/theia-vscodecov $ cd my-vscode-extension $ npx theia-vscodecov 32

  33. Develop VS Code extensions Conclusion 33

  34. FUTURE ● Improve VS Code API compliance ● Alternate VS Code extension marketplace 34

  35. Getting started with Eclipse Che Get started with Eclipse Che Sources Dev List che-dev@eclipse.org github.com/eclipse/che Mattermost Docs https://mattermost.eclipse.org http://eclipse.org/che/docs Try it out : https://che.openshift.io 35

  36. Thank you linkedin.com/company/red-hat youtube.com/user/RedHatVideos Red Hat is the world’s leading provider of enterprise open source software solutions. facebook.com/redhatinc Award-winning support, training, and consulting services make twitter.com/RedHat Red Hat a trusted adviser to the Fortune 500. 36

Recommend


More recommend