Skip to content

Latest commit

 

History

History
99 lines (87 loc) · 6.1 KB

DEVELOPMENT.md

File metadata and controls

99 lines (87 loc) · 6.1 KB

How to Start VSCode Extension in Dev mode

Local

Windows

  1. Install scoop https://scoop.sh/#/
  2. Use scoop to install git, nodejs, nvm, yarn, java17 and visual studio code if not already installed.
scoop bucket add main
scoop bucket add extras
scoop bucket add java
scoop install main/git
scoop install main/nodejs
scoop install main/nvm
scoop install main/yarn
scoop install java/openjdk17
scoop install extras/vscode
  1. The version of VSCode must be at 1.78.2 or newer.
  2. Install the following VSCode extensions if not already installed
code --install-extension vscjava.vscode-java-pack
code --install-extension vscjava.vscode-gradle
  1. Clone OML Vision into your workspace git clone https://github.com/opencaesar/oml-vision.git
  2. Open OML Vision in VSCode
  3. Press F5 on your Keyboard or Ctrl+Shift+D (Windows) or Cmd+Shift+D (macOS) and click the green play button in the upper left that says Run Extension. This takes care of building the application in Dev Mode.
  4. Open the OML model repo in Dev mode of OML Vision. Read more here
  5. IMPORTANT you can’t have the same OML repo open in another instance of vscode. If you try to open a folder in the vision app that is already open in another instance of vscode it just quietly does nothing.
  6. Click the eye in the left hand side which corresponds to OML Vision or click the ellipsis at the bottom of the sidebar which will expand a selection menu. Select OML Vision from there.

macOS

  1. Install homebrew https://brew.sh
  2. Use scoop to install git, nodejs, nvm, yarn and visual studio code if not already installed.
brew install git
brew install nodejs
brew install nvm
brew install yarn
brew install openjdk@17
brew install --cask visual-studio-code
  1. The version of VSCode must be at 1.78.2 or newer.
  2. Install the following VSCode extensions
code --install-extension vscjava.vscode-java-pack
code --install-extension vscjava.vscode-gradle
  1. Clone OML Vision into your workspace git clone https://github.com/opencaesar/oml-vision.git
  2. Open OML Vision in VSCode
  3. Press F5 on your Keyboard or Ctrl+Shift+D (Windows) or Cmd+Shift+D (macOS) and click the green play button in the upper left that says Run Extension. This takes care of building the application in Dev Mode.
  4. Open the OML model repo in Dev mode of OML Vision. Read more here
  5. IMPORTANT you can’t have the same OML repo open in another instance of vscode. If you try to open a folder in the vision app that is already open in another instance of vscode it just quietly does nothing.
  6. Click the eye in the left hand side which corresponds to OML Vision or click the ellipsis at the bottom of the sidebar which will expand a selection menu. Select OML Vision from there.

Remote

Github Codespaces

  1. Go to the the home page of the OML Vision Github repo located here
  2. Open the repo in a code space. Read more here
  3. IMPORTANT Github Codespaces are not free indefinitely for a personal account under the Github Free tier. Typically Github Codespaces can be used for free for a certain amount of hours per month before a user is billed. Read more here
  4. In the terminal, run git switch master and git pull. This will get the latest changes from OML Vision into the codespace.
  5. Press F5 on your Keyboard or Ctrl+Shift+D (Windows) or Cmd+Shift+D (macOS) and click the green play button in the upper left that says Run Extension. This takes care of building the application in Dev Mode.
  6. If you get a popup that asks for permission to open the debugger in a new tab or window, click Continue.
  7. Open the OML model repo in Dev mode of OML Vision. Read more here
  8. IMPORTANT you can’t have the same OML repo open in another instance of vscode. If you try to open a folder in the vision app that is already open in another instance of vscode it just quietly does nothing.
  9. Click the eye in the left hand side which corresponds to OML Vision or click the ellipsis at the bottom of the sidebar which will expand a selection menu. Select OML Vision from there.
  10. If the eye does not appear, refresh the browser

Troubleshooting

Known issues:

  • If startFusekiVision exits with error and you see in .fuseki.log that Fuseki is running at port 3030 already, do the following:
  • Solution:
  1. lsof -i :[port of running fuseki process]
  2. Find the PID of the running fuseki process from the result
  3. Kill the fuseki process: kill [pid]
  4. Re-run the gradle task (whether it was owlLoadVision or startFusekiVision)

Debugging

Debug commands and controller

  1. Add a breakpoint to a line of code in the commands or controller folder
  2. Run VSCode Extension in Development mode
  3. Breakpoints will allow you to see the stack trace of a line of code in a program within the commands or controller folder

Debug views

  1. Run VSCode Extension in Development mode
  2. Hit Ctrl + Shift + P or Cmd + Shift + P to open the VSCode Command Palette
  3. Search for Developer: Open Webview Developer Tools
  4. The developer tools allows you to inspect elements in the webview that come from the view folder like a typical React web application
  5. You can view an example of someone debugging a VSCode Code Extension Webview here

Open Web Query Fuseki UI

  1. Open any browser and go to the following URL http://localhost:3030/

How to view log files in Fuseki Server

  1. Go into the .fuseki/fuseki.log file
  2. Should see POST API calls