Comments (10)
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.
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.
But this functionality is not part of vscode as far as I know.
You mean LSP?
from metals.
Yes @gabro ! I meant LSP.
from metals.
Related: atom/ide-java#42. It just doesn't work now in Atom.
from metals.
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.
Crosslinking, so that you can vote it up: microsoft/language-server-protocol#335
from metals.
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.
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.
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)
- Indexing runs forever in VSCode probably caused by an unexpected symbol HOT 9
- Auto-import is not suggested for classes with long name HOT 4
- Extract selection as method doesn't infer correct return type HOT 1
- Auto-import is not working for classes with the same name
- Class renaming is broken when you have other tab opened with import
- False error when splicing a polymorphic function HOT 1
- Memory leak - PC + scala 2 HOT 13
- "could not find main class" error when assigning a key to "run" lense for a main class HOT 13
- Type information errors when classloading in macros with `Selectable` HOT 4
- Metals starts a bsp server for project ref, when added as the first workspace folder in VSCode
- Worksheet doesn't show correct Array Output HOT 6
- Worksheet output of previous lines is wrongly updated HOT 1
- Сonstant Scalafix errors HOT 8
- Java source indexing looks to indexing has innefficient file I/O HOT 7
- Metals creates a `.semanticdb` file when opening a single Scala file in VS Cdoe
- OOM while running tests HOT 3
- java.nio.file.NoSuchFileException for a path with @ HOT 2
- recent upgrade fails to run tests HOT 7
- Unable to Goto definition for Sources classes which contains Scala 3 deprecated methods and when the Source Project's version contains number 3 in it HOT 2
- Show aliased type for singleton completions HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metals.