Skip to content

Virtual File System #15

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

Merged
merged 8 commits into from
May 2, 2017
Merged

Virtual File System #15

merged 8 commits into from
May 2, 2017

Conversation

alanz
Copy link
Collaborator

@alanz alanz commented Apr 30, 2017

Introduces a virtual file system, in the sense that it processes the textDocument/didOpen, textDocument/didChange and textDocument/didClose notifications to replicate the state of a file being edited in the IDE.

This is accesed in the Handler via a new field with signature

(J.Uri -> IO (Maybe VirtualFile))

where a VirtualFile is defined as

data VirtualFile =
  VirtualFile {
      _version :: Int
    , _text    :: Yi.YiString
    } deriving (Show)

@alanz alanz requested a review from adamwalker May 1, 2017 08:28
@adamwalker
Copy link
Contributor

One problem with depending on the yi-rope package is that it is GPL. IANAL, so I'm not sure if that means that this package must be GPL too. This: http://stackoverflow.com/questions/11819831/including-gpl-external-library-in-mit-code seems to suggest it does.

@adamwalker
Copy link
Contributor

My personal, and entirely selfish preference, is to keep this library MIT so that I can use it in the VHDL language server I am building and sell it in the future.

@alanz
Copy link
Collaborator Author

alanz commented May 1, 2017

Yes, I was wondering about that too.

I discussed it on IRC with some people, who seemed to think that BSD3 and GPL are compatible. I am not personally worried about licensing, so would gladly change the license here to match something.

@adamwalker what are your views on that? Given you are a contributor.

@alanz
Copy link
Collaborator Author

alanz commented May 1, 2017

And BSD3? Because I am quite keen to have changes managed here, and YiRope is good for that.

I imagine it should be possible to pass the types/functions in as part of the initialization, if all else fails.

Except the change management is particularly easy with YiRope.

@adamwalker
Copy link
Contributor

Yeah - anything that uses GPL code must be GPL. It also might be possible to not have the rope stuff as part of the framework but instead provide a separate library that the user calls from within the file opened/changed/saved callbacks that does all the work of keeping track of the contents of URIs.

But, thats not as nice as what you currently have. It's up to you really. Just consider that using yi-rope prevents commercial uses of this library.

@alanz
Copy link
Collaborator Author

alanz commented May 1, 2017

Well, we have identified a workaround that could be made to enable commercial use and strip out the GPL part.

So I suggest we leave it as now and let a future commercial user do that. Unless you want to do a PR on it for that functionality now already.

It is no big deal for me, I am not personally planning commercial use, but I am not keen to do much work for the benefit of commercial users only :).

If it would help, I am happy to change the license too, if you have a preference.

@dpwiz
Copy link

dpwiz commented May 1, 2017

Just consider that using yi-rope prevents commercial uses of this library.

And that means any company that wants to ship a language server will have to ignore this package and build their own from scratch.

@alanz
Copy link
Collaborator Author

alanz commented May 2, 2017

And from GHC 8.2 we can make the Yi.Rope package a backpack specification, so you can plug in anything that meets the signature.

@alanz
Copy link
Collaborator Author

alanz commented May 2, 2017

@adamwalker Are you happy with the proposed workaround, if commercial use is required? I would like to merge this.

@adamwalker
Copy link
Contributor

Yep. The backpack proposal sounds good.

@alanz alanz merged commit 37a1525 into master May 2, 2017
@alanz
Copy link
Collaborator Author

alanz commented May 2, 2017

And I captured the required cleanup in an issue, for any future commercial users.

See #16

@alanz alanz deleted the vfs branch May 5, 2017 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants