packages feed

phoityne-vscode-0.0.8.0: README.md


# Phoityne VSCode

Phoityne is a ghci debug viewer for Visual Studio Code. (on Windows)


## Debug on VSCode

1. Start VSCode
2. Open stack project folder
3. Open debug view
4. Open launch.json
5. Set startup source file. Default file is test/Spec.hs
6. Run debug(F5)

[![Demo Video1](https://sites.google.com/site/phoityne/doc_jp/demo01.gif)](https://sites.google.com/site/phoityne/doc_jp/demo01.gif?attredirects=0)


## Key Bindings

* F5 : start debug
* F6 : show command menu (for stack watch)
* Shift + F6 : stop stack watch
* F7 : stack clean & build
* F8 : stack test


## Important

* Breakpoint can be set in a .hs file which defineds "module ... where".
* Source file extension must be ".hs"
* When you start debugging for the first time, .vscode/tasks.json will be created automatically. Then you can use F6, F7, F8 shortcut key.


## Install


### Run stack install

    % stack install phoityne-vscode
      . . . . .
    %

Add 'phoityne-vscode.exe' to PATH environment.

    % where $path:phoityne-vscode.exe
    C:\Users\[user name]\AppData\Roaming\local\bin\phoityne-vscode.exe
    
    %


### Install vscode extensions

1. ctrlr + p on Visual Studio Code
2. ext install haskell ... 
3. select "[Haskell GHCi debug viewer Phoityne](https://marketplace.visualstudio.com/items?itemName=phoityne.phoityne-vscode)"
## Capabilites

* supportsConfigurationDoneRequest : no
* supportsFunctionBreakpoints : no
* supportsConditionalBreakpoints : yes
* supportsEvaluateForHovers : yes
* exceptionBreakpointFilters : no
* supportsStepBack : no
* supportsSetVariable : no
* supportsRestartFrame : no


## Configuration

### .vscode/launch.json

* startup
  * required
  * default : ${workspaceRoot}/test/Spec.hs
  * debug startup file, will be loaded automatically.
* ghciCmd
  * required
  * default: stack ghci --test --no-load --no-build
  * launch ghci command, must be Prelude module loaded.  
    For example, "ghci -i${workspaceRoot}/src", "cabal exec -- ghci -i${workspaceRoot}/src"
* ghciPrompt
  * required
  * default: H>>= 
  * ghci command prompt string.
* logFile
  * required
  * default: ${workspaceRoot}/.vscode/phoityne.log
  * internal log file.
* logLevel
  * required
  * default: WARNING
  * internal log level.

### .vscode/tasks.json

* stack build
  * required
  * default: stack build
  * task definition for F6 shortcut key.
* stack clean & build
  * required
  * default: stack clean && stack build
  * task definition for F7 shortcut key.
* stack test
  * required
  * default: stack test
  * task definition for F8 shortcut key.
* stack watch
  * required
  * default: stack build --test --no-run-tests --file-watch
  * task definition for F6 shortcut key.