metabrowse icon indicating copy to clipboard operation
metabrowse copied to clipboard

Workspace symbol provider

Open olafurpg opened this issue 8 years ago • 5 comments

https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name

The api exists in vscode but not monaco https://github.com/Microsoft/vscode/blob/478365bce508cc391e4cfc5c9e1eeee7c87c39c9/src/vs/vscode.d.ts#L2034

We have all the data to implement this.

olafurpg avatar Jul 02 '17 15:07 olafurpg

We can do this the same way we do for searching for filenames. I would restrict the symbols to global class/object/trait kinds.

olafurpg avatar Sep 28 '18 09:09 olafurpg

Here's a quick mock-up for creating an "omnibar" to search/complete file and symbol names.

screen shot 2018-09-28 at 12 02 18
input#omnibar {
    background-color: rgba(255,255,255,0.1);
    border: none;
    position: absolute;
    top: 10px;
    left: 59px;
    color: inherit;
    font-size: inherit;
    height: 36px;
    padding-left: 10px;
    width: 79%;
}

If I can get that to work (or find a library that allows to easily create a search box with pluggable completion) we should be able to implement this.

jonas avatar Sep 28 '18 16:09 jonas

@jonas That looks amazing, I might be tempted to implement the completions myself in Scala.js. What would the interface be? I can imagine something like

def completions(query: String): List[String]

I have forever wanted a search bar similar to https://cs.chromium.org

olafurpg avatar Sep 28 '18 22:09 olafurpg

@jonas have you tried to see if we can access the same APIs as QuickOutlineAction for the document symbol provider? https://github.com/Microsoft/vscode/blob/d5b94eb3a7f1fe165590bbd0e685516400050a8f/src/vs/editor/standalone/browser/quickOpen/quickOutline.ts#L115-L151

olafurpg avatar Sep 29 '18 13:09 olafurpg

When looking at switching to the Monaco Webpack plugin (#106) I noticed that it uses the JS sources directly, so it might be possible to access some of that, however, since it is not exposed via the Monaco API I don't know if it is possible.

jonas avatar Oct 05 '18 17:10 jonas