-
Notifications
You must be signed in to change notification settings - Fork 35
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
[doc] [example] Example of a setup with multiple workspaces. #611
Merged
Merged
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Multiple workspaces setup | ||
|
||
## How to run it: | ||
|
||
Try to load the `example.code-workspace` file in VSCode. | ||
|
||
You may need to compile the right `.vo` files for the imports to | ||
work. You can do that with the `Save VO command`; as of now, `coq-lsp` | ||
will require you do this before opening the depending files. | ||
|
||
`coq-lsp` will take care of this automatically in the next version, | ||
including the auto-update. You can also do: | ||
|
||
```sh | ||
$ coqc -R bar bar bar/barx.y | ||
$ coqc -R foo foo foo/foox.y | ||
``` | ||
|
||
## `coq-lsp` workspace documentation | ||
|
||
One can add multiple folders or roots to a workspace — for instance | ||
via the "Add Folder to Workspace" command (or | ||
[alternatives](https://code.visualstudio.com/docs/editor/multi-root-workspaces#_adding-folders)). | ||
|
||
For each workspace added to a project, `coq-lsp` will try to configure | ||
it by searching for a `_CoqProject` file, then it will apply the | ||
options found there. In the near future, we will also detect | ||
`dune-project` files at the root too. | ||
|
||
`coq-lsp` does determine the workspace roots using the standard | ||
methods provided by the LSP protocol, in particular `wsFolders`, | ||
`rootURI`, and `rootPath` at initialiation, in this order; and by | ||
listening to the `workspace/didChangeWorkspaceFolders` notification | ||
after initialization. | ||
|
||
## Known problems | ||
|
||
When projects are using Coq plugins, `findlib` doesn't properly | ||
support having multiple roots in the same process. We are using a hack | ||
that seems to work (we reinitialize `findlib`), however the hack is | ||
very fragile; we should improve `findlib` upstream to support our use | ||
case. |
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 @@ | ||
-R . bar |
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,3 @@ | ||
Definition x := 3. | ||
|
||
Print x. |
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,3 @@ | ||
From bar Require Import barx. | ||
|
||
Print x. |
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,27 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "bar" | ||
}, | ||
{ | ||
"path": "foo" | ||
} | ||
], | ||
"settings": { | ||
"files.exclude": { | ||
"**/*.vo": true, | ||
"**/*.vok": true, | ||
"**/*.vos": true, | ||
"**/*.aux": true, | ||
"**/*.glob": true, | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/Thumbs.db": true, | ||
"**/*.olean": true, | ||
"out": false | ||
} | ||
} | ||
} |
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 @@ | ||
-R . foo |
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,3 @@ | ||
Definition x := 3. | ||
|
||
Print x. |
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,3 @@ | ||
From foo Require Import foox. | ||
|
||
Print x. |
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.
https://code.visualstudio.com/docs/editor/multi-root-workspaces
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.
That is, we should probably stick to the same terms as VsCode docs, and the above is an attempt.
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.
Yes, thanks a lot for the suggestions, indeed we need to improve the wording in the line you suggested.