-
-
Notifications
You must be signed in to change notification settings - Fork 30
feat: workspace folders #18
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
base: main
Are you sure you want to change the base?
Conversation
328d567
to
63af087
Compare
be99c6d
to
96a16cd
Compare
This adds support for multiple projects within the server node, and starts a project node for each detected project within the workspace. It also changes the manager node to use the name of the workspace folder instead of the name of the first project that starts distribution.
2c69620
to
c0c879a
Compare
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.
Are you able to add tests that validate adding and removing workspace folders?
Otherwise looks good, just change the PR title to say "feat: workspace folders"
a423e25
to
90ab70a
Compare
@mhanberg using GenLSP test helpers sometimes exunit will not terminate after running all tests(or sometimes it will run only a subset of the new tests), do you know if this may be related to the GenLSP helpers? Other tests that start project nodes like |
13a9a77
to
d6279f4
Compare
Not that I know of, but I'll pull it down and see what happens. |
Sorry about the wait, but I pulled this down. The tests seem to just run as normal, except for one test failing of a code error. |
Can you share the error? Besides the issue I mentioned, all tests are green on my end |
The first couple of times i ran it, this was the failure
But I just ran it again and a different test failed
|
I think I just ran into the problem tho |
This test was failing because the context project's entropy did not match what the patched function received. Matching on the uri instead(which is what actually identifies the project) fixes the test.
I think I fixed both issues. I'm still experiencing the issue where |
9df9074
to
04968a1
Compare
Are you still experiencing that weird tests don't end problem? CI seems to be passing. |
It might be worth it to move the "multi root but not workspace folders" work to a different branch and merge in the actual workspace folders support |
@mhanberg I'm not sure, Steve reported that the project node would sometimes crash and that would happen regardless of the project node being spawned via workspace folders or some other way |
This adds support for multiple projects within the server node, and starts a project node for each detected project within the workspace. The detection implemented here is just using the presence of a
mix.exs
file to assume it's a project root.It also changes the manager node to use the name of the workspace folder instead of the name of the first project that starts distribution. The reason is that if you have projects
a
andb
in the same root folderfoo
, and you start Expert on the root folder, then the manager node will be named after the first project node that is started. Runningepmd -names
shows this:project-a-entropy
project-b-entropy
manager-a-entropy
I htink having the manager be named
manager-foo-entropy
sounds more correct.To test this branch you can clone this repo: https://github.com/doorgan/monorepo_test
Then check on files from both
main
andsecondary
that:Additionally you can also test that Lexical works on
.exs
or.ex
files in a workspace without amix.exs
file.It is worth noting that this should be tested with VS Code using the Lexical LSP extension and pointing it to an expert release using this branch, or some other editor (like emacs) that doesn't automatically start a new Expert server(ie something other than Neovim)