Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #190 from ckipp01/treeview
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 authored May 5, 2020
2 parents bc57d9c + 35ce972 commit 4d15eb0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions coc-mappings.vim
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ nnoremap <silent> <space>t :<C-u>CocCommand metals.tvp<CR>
nnoremap <silent> <space>tb :<C-u>CocCommand metals.tvp metalsBuild<CR>
" Toggle Tree View 'metalsCompile'
nnoremap <silent> <space>tc :<C-u>CocCommand metals.tvp metalsCompile<CR>
" Reveal current current class (trait or object) in Tree View 'metalsBuild'
nnoremap <silent> <space>tf :<C-u>CocCommand metals.revealInTreeView metalsBuild<CR>
" Reveal current current class (trait or object) in Tree View 'metalsProject'
nnoremap <silent> <space>tf :<C-u>CocCommand metals.revealInTreeView metalsProject<CR>
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,16 @@
"type": "object",
"default": [
{
"name": "metalsCompile",
"name": "metalsBuild",
"size": 10,
"expanded": [
[
"metals://ongoing-compilations"
"projects:"
]
]
},
{
"name": "metalsBuild",
"name": "metalsProject",
"size": 40,
"expanded": [
[
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@ coc-metals has a built-in implementation of the [Tree View Protocol](https://sca
If you have the [recommended mappings](coc-mappings.vim) copied, you'll notice
that in the bottom you'll have some TVP related settings. You can start by
opening the TVP panel by using the default `<space> t`. Once open, you'll see
there are two parts to the panel. The first being the `MetalsCompile` where you
can see the status of ongoing compilations for your modules and also options to
compile.
there are two parts to the panel. The first being the `MetalsBuild` where you
can find multiple build-related commands.

![MetalsCompile](https://i.imgur.com/QBPHNQo.gif)
![metalsBuild](https://i.imgur.com/cwm2asx.png)

You are able to trigger the compiles while being on top of the option you are
attempting to trigger and pressing `r`. You can change this default in the
settings. You can find all the relevant TVP settings below in the [Available Configuration Options](#available-configuration-options).
settings. You can find all the relevant TVP settings below in the [Available
Configuration Options](#available-configuration-options).

The second part of the TVP panel is a view of your project and external dependencies.
You can navigate through them by jumping to the next or previous nodes, the last
Expand Down Expand Up @@ -330,7 +330,7 @@ install [coc-json](https://github.com/neoclide/coc-json).
`metals.superMethodLensesEnabled` | Enable/disable goto super method code lens (default is true)
`metals.treeviews.toggleNode` | Expand / Collapse tree node (default `<CR>`)
`metals.treeviews.initialWidth` | Initial Tree Views panels (default `40`)
`metals.treeviews.initialViews` | Initial views that the Tree View Panel Dispalys. Done mess with this unless you know what you're doing.
`metals.treeviews.initialViews` | Initial views that the Tree View Panel Displays. Don't mess with this unless you know what you're doing.
`metals.treeviews.gotoLastChild` | Go to the last child Node (defalt `J`)
`metals.treeviews.gotoParentNode` | Go to parent Node (default `p`)
`metals.treeviews.gotoFirstChild` | Go to first child Node (default `K`)
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ function launchMetals(
"doctor-run",
"compile-cascade",
"compile-cancel",
"compile-clean",
];

commands.forEach((command) => {
Expand Down
6 changes: 6 additions & 0 deletions src/tvp/treeview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ export class TreeView implements Disposable {
highlightSchema = "TvpVal";
break;
case "command":
case "sync":
case "connect":
case "cascade":
case "cancel":
case "clean":
case "debug-stop":
highlightSchema = "TvpCommand";
break;
default:
Expand Down

0 comments on commit 4d15eb0

Please sign in to comment.