Giter Site home page Giter Site logo

Question: LSP4E with Linked Files about lsp4e HOT 4 CLOSED

eclipse avatar eclipse commented on September 27, 2024
Question: LSP4E with Linked Files

from lsp4e.

Comments (4)

mickaelistria avatar mickaelistria commented on September 27, 2024

The assumption is usually that the LS can access the same resources as the client. Virtual filesystems or linked files make this assumption broken, so it's even not clear that language servers are supposed to work at all with them.
However, you can trick the filesystem consumers with symbolic link or linked files on the filesystem level (instead of client one). Is this something you can use?

from lsp4e.

rubenporras avatar rubenporras commented on September 27, 2024

Is the assumption that the LS can access the same resources as the client is something built into the LSP Specification (I could not find it) or rather something built-in LSP4e?

I see that the client includes the source text in the Json, request, so fetching the text of the source does not require that the server can access the source on the filesystem level. I also found in https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWatchedFiles that "Servers are allowed to run their own file system watching mechanism and not rely on clients to provide file system events. However this is not recommended", so I am not sure how to understand the assumption.

I am not sure what we would need to use symbolic link or linked files on the filesystem level but so far I did not detected any problem with the virtual file system. Yes, I needed to submit a couple of changes to the LSPEclipseUtils class, but so far the changes where not complex or cumbersome.

We have a highly customized eclipse and xtext setup already (I would not go into details), so even if I prefer that LSP4e works out of the box as much as possible, if we need to customize/extend it little LSP4e, it would not be a deal breaker for us. With this in mind calling LanguageServiceAccessor.getInitializedLanguageServers(file, x -> true); does not seem to be a big issue. Or do you know already about any problem with that?

from lsp4e.

mickaelistria avatar mickaelistria commented on September 27, 2024

If symbolic links can't work, then yes, you probably have to notify the LS about all the files existing an their content so it can re-emulate the filesystem on its end.

calling LanguageServiceAccessor.getInitializedLanguageServers(file, x -> true); does not seem to be a big issue. Or do you know already about any problem with that?

No, that's not a problem, some other LSP4E clients do it already.

from lsp4e.

rubenporras avatar rubenporras commented on September 27, 2024

Thanks for the quick answer, then I close the ticket and carry on with the call as in my first comment when opening the ticket.

from lsp4e.

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.