Coder Social home page Coder Social logo

Comments (10)

olafurpg avatar olafurpg commented on August 15, 2024

It seems eclipse.jdt.ls returns URIs with the jdt scheme https://github.com/eclipse/eclipse.jdt.ls/blob/2127f12fb3700dd783b75d973e4f2ecc134b9ddf/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTUtils.java#L376

In editors like vscode it's possible to register a text content provider for a particular URI scheme, we use this in metadoc scalameta.org/metadoc/ for "semanticdb". But this functionality is not part of vscode LSP as far as I know.

from metals.

laughedelic avatar laughedelic commented on August 15, 2024

I'm going to check how it works in Atom with the Java LSP plugin. And I'm not if it's related or not, but there is this: http://flight-manual.atom.io/hacking-atom/sections/handling-uris

from metals.

gabro avatar gabro commented on August 15, 2024

But this functionality is not part of vscode as far as I know.

You mean LSP?

from metals.

olafurpg avatar olafurpg commented on August 15, 2024

Yes @gabro ! I meant LSP.

from metals.

laughedelic avatar laughedelic commented on August 15, 2024

Related: atom/ide-java#42. It just doesn't work now in Atom.

from metals.

olafurpg avatar olafurpg commented on August 15, 2024

We can have different implementations to handle sources in the classpath depending on the capabilities of the editor. The fallback implementation can use the current hack we have in master.

from metals.

laughedelic avatar laughedelic commented on August 15, 2024

Crosslinking, so that you can vote it up: microsoft/language-server-protocol#335

from metals.

olafurpg avatar olafurpg commented on August 15, 2024

Seems like the relevant part of the vscode api is https://code.visualstudio.com/docs/extensionAPI/vscode-api#workspace.registerTextDocumentContentProvider where we can register a provider for the "semanticdb" URI scheme.

from metals.

olafurpg avatar olafurpg commented on August 15, 2024

VS Code 1.25.0 had updates on "Readonly file system provider" https://code.visualstudio.com/updates/v1_25#_readonly-file-system-provider

from metals.

olafurpg avatar olafurpg commented on August 15, 2024

Fixed in #337. I ended up with writing to files on disk instead of the text content provider system in VS Code with the reasoning being that files work with all clients, not only VS Code.

I actually got the VS Code text content provider working but that opened a can of worms by having to handle metals:// URIs.

Files are written in the .metals/readonly/ directory and preserve the full path from the zip file: .metals/readonly/scala/Predef.scala. The files are marked as read-only (not writable) on macOS/Linux so that users get an error if they try to edit the dependency sources. On Windows I hit on many problems using readonly files (AccessDeniedException from just walking the file tree, not even readon) so I gave up and kept the files writable.

from metals.

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.