Giter VIP home page Giter VIP logo

Comments (7)

olafurpg avatar olafurpg commented on July 24, 2024

Been demoing metadoc at Scala World, missing this functionality a lot!

from metabrowse.

jonas avatar jonas commented on July 24, 2024

Yes. Are all file names in the workbench index?

from metabrowse.

olafurpg avatar olafurpg commented on July 24, 2024

from metabrowse.

olafurpg avatar olafurpg commented on July 24, 2024

A few relevant links

workspace.filenames: Seq[String] includes all the filenames in the workspace

https://github.com/scalameta/metadoc/blob/ecb37f35612464a5c73469ed961f21c4b97bb483/metadoc-js/src/main/scala/metadoc/MetadocApp.scala#L48

One idea, I'm wondering if it is possible to use DocumentSymbolProvider to jump to different URIs than the current open buffer 🤔 The API seems to allow returning SymbolInformation which may be able to have .location.uri and .kind
https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.symbolinformation.html#kind Might be worth a shot.

from metabrowse.

olafurpg avatar olafurpg commented on July 24, 2024

I tried to use DocumentSymbolProvider to switch URI but it seems monaco doesn't like that. It looks very promising however since there exists a SymbolKind.file which has a nice icon

screen shot 2018-06-04 at 21 38 10

Seems we may need to register our own command using
CommonEditorRegistry as requested microsoft/vscode#7250

I tried

@JSGlobal("monaco.CommonEditorRegistry")
@js.native
object CommonEditorRegistry extends js.Object {
  def registerEditorAction(editorAction: IEditorAction): Unit = js.native
}

but hit on Cannot read property 'registerEditorAction' of undefined.

from metabrowse.

olafurpg avatar olafurpg commented on July 24, 2024

The objective is to reproduce the following typescript snippet https://github.com/Microsoft/vscode/blob/047b88c39ccb5875356276ae98b7429e4b279d6a/src/vs/editor/standalone/browser/quickOpen/quickOutline.ts#L113-L130 to register a custom command "Open file"

from metabrowse.

olafurpg avatar olafurpg commented on July 24, 2024

Registration of commands seems to have been changed in the latest monaco version https://github.com/Microsoft/vscode/blob/d328fec640d2f2b78faa501ecd613cb0312c8472/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts#L37-L39 and it seems CommonEditorRegistry no longer exists.

from metabrowse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.