-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Multiple Content Roots #1821
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d7783cc
Update protocol
radeusgd 7f7b8a0
Switching config to only include main content root
radeusgd bf173a1
Migrating FileManager to use ContentRootManager
radeusgd 457ecff
Decouple FileManager from static content roots config,
radeusgd d82dfff
WIP refactoring runtimeFailureMapper
radeusgd ad176d5
Finish migration to modified RuntimeFailureMapper
radeusgd ef90411
WIP removing references to old findContentRoot
radeusgd e0d6dbb
Decouple PathWatcher and SuggestionsHandler
radeusgd 01240e1
Add filesystem and home roots on startup
radeusgd 9136ba9
Add subscription and notifications
radeusgd 8063543
Forward notifications to the IDE
radeusgd 7c68881
WIP adding runtime endpoint
radeusgd a5299cc
Modify ContentRootManager to listen for library updates
radeusgd ae2f3f8
Content Root docs
radeusgd 78dd075
Some more docs and tests
radeusgd bffde21
changelog
radeusgd bb03f12
Fix imports
radeusgd 67826d2
cr: add param comments
radeusgd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...nguage-server/src/main/scala/org/enso/languageserver/filemanager/ContentRootManager.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.enso.languageserver.filemanager | ||
|
||
import java.io.File | ||
import java.util.UUID | ||
import scala.concurrent.{ExecutionContext, Future} | ||
|
||
/** The external interface of the Content Root Manager that can be used by other | ||
* components. | ||
* | ||
* This interface encapsulates the underlying Actor-based implementation and | ||
* only exposes the operations that are simple requests. To subscribe for | ||
* content root updates, the Actor interface should be used directly. | ||
*/ | ||
trait ContentRootManager { | ||
|
||
/** Lists the content roots currently available. | ||
* | ||
* @param ec the execution context on which to wait for the reply from the | ||
* content root manager | ||
* @return a future that will complete with a list of currently available | ||
* content roots | ||
*/ | ||
def getContentRoots(implicit | ||
ec: ExecutionContext | ||
): Future[List[ContentRootWithFile]] | ||
|
||
/** Finds the content root with the given id. | ||
* | ||
* @param id the id of the content root to get | ||
* @param ec the execution context on which to wait for the reply from the | ||
* content root manager | ||
* @return a future that will complete either with the found content root or | ||
* with an error if a content root with the requested id was not | ||
* found | ||
*/ | ||
def findContentRoot(id: UUID)(implicit | ||
ec: ExecutionContext | ||
): Future[Either[ContentRootNotFound.type, ContentRootWithFile]] | ||
|
||
/** Converts a filesystem path to a path relative to one of the available | ||
* content roots. | ||
* | ||
* The implementation should pick the most specific content root for the | ||
* path, i.e. the one whose root location shares the longest common prefix | ||
* with the path that is being resolved. | ||
* | ||
* @param path the path to convert | ||
* @param ec the execution context on which to wait for the reply from the | ||
* content root manager | ||
* @return a future that will complete with the relativized path or None if | ||
* the path was not relative to any of the available roots | ||
*/ | ||
def findRelativePath(path: File)(implicit | ||
radeusgd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ec: ExecutionContext | ||
): Future[Option[Path]] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a reminder to make sure that the appropriate task is scheduled on the IDE side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@farmaazon @MichaelMauderer I understand that this will likely need to be integrated for the https://github.com/enso-org/ide/issues/1634
Besides, I understand that before that the
file/rootAdded
notification was not being handled. Is it a breaking change for the IDE that we will start sending it? Will it cause errrors if you have no handler for it? If yes, I'd like to ask if you can add at least a dummy handler for compatibility which can later be extended to its full functionality.