Skip to content
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

feat(nextls): multi-root workspaces #184

Merged
merged 2 commits into from
Nov 10, 2023
Merged

feat(nextls): multi-root workspaces #184

merged 2 commits into from
Nov 10, 2023

Conversation

mhanberg
Copy link
Collaborator

@mhanberg mhanberg commented Nov 8, 2023

This patch has a dependency on the https://github.com/mhanberg/workspace-folders.nvim plugin.

To try out the behavior, install that plugin and create a .code-workspace file that describes your multi-root workspace (or mono repo as most call it), in the root of your mono repo.

If your monorepo is called "money-factory-io", with the folders "crypto", "ai-chat-app", and "drop-shipping-cms", your code-workspace would be named money-factory-io.code-workspace and look like:

{
  "folders": [
    {"path": "crypto"},
    {"path": "ai-chat-app"},
    {"path": "drop-shipping-cms"},
  ]
}

@mhanberg
Copy link
Collaborator Author

mhanberg commented Nov 8, 2023

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@mhanberg
Copy link
Collaborator Author

mhanberg commented Nov 8, 2023

@cigrainger would you mind trying this out when you get a chance?

I was able to successfully test it out on the nx mono repo, with the following code-workspace file

{
	"folders": [
		{
			"path": "./nx"
		},
		{
			"path": "./exla"
		},
		{
			"path": "torchx"
		}
	]
}

@cigrainger
Copy link

Yassss! I'll give it a whirl when I get to the office this morning. Thanks @mhanberg!

@cigrainger
Copy link

How do I start workspace-folders.nvim without lazy.nvim? I added it to my Nix config and gathered it needs to be run in a VimEnter autocmd, but I'm too ignorant to figure out how to source the thing.

@mhanberg
Copy link
Collaborator Author

mhanberg commented Nov 8, 2023

You can just install it however you normally install plugins and can ignore the VinEnter thing

@cigrainger
Copy link

Ahhhhhh... I'm a goober. Nix happily ignored an invalid hash and just silently didn't install it when I rebuilt the system flake. Cool cool. It's working! Now I need to get the the credo ls working (I think there's a relative path thing going on which Nix doesn't like) and I'm going to be extremely happy. Thanks @mhanberg!

@mhanberg
Copy link
Collaborator Author

mhanberg commented Nov 8, 2023

if you are using Next LS, you can disable the Credo Language Server, as Next LS has a builtin credo extension link to docs

@cigrainger
Copy link

Pfffff stop making it too easy. <3 Also I'll rtfm (you're moving too quick for me over here). Thanks again!

@mhanberg
Copy link
Collaborator Author

mhanberg commented Nov 8, 2023

I'm going to use this branch today just to make sure there aren't any regressions, but i'll most likely merge and release tonight.

@mhanberg
Copy link
Collaborator Author

mhanberg commented Nov 8, 2023

Also nix question for you, are you letting the plugin install Next LS for you, or are you using the nix flake?

@cigrainger
Copy link

Letting the plugin install Next LS (I'm not pure enough). Better to use the flake?

@mhanberg
Copy link
Collaborator Author

mhanberg commented Nov 8, 2023

better to use the flake?

No clue, I am a nix newb, so i was just wondering.

NixOS or just nix package manager?

@cigrainger
Copy link

nix-darwin. I can't give up macOS (I tried but spent more time tweaking things than doing work). I run NixOS on my linux box but I don't run a desktop environment on it.

This patch has a dependency on the `mhanberg/workspace-folders.nvim`
plugin.

To try out the behavior, intsall that plugin and create a
`.code-workspace` file that describes your multi-root workspace (or mono
repo as most call it).

If your monorepo is called "money-factory-io", with the folders
"crypto", "ai-chat-app", and "drop-shipping-cms", your `code-workspace`
would be named `money-factory-io.code-workspace` and look like:

```json
{
  "folders": [
  {"path": "crypto"},
  {"path": "ai-chat-app"},
  {"path": "drop-shipping-cms"},
  ]
}
```
@mhanberg mhanberg force-pushed the 2023-11-07-workspaces branch from 51399bc to 075d88f Compare November 9, 2023 13:25
@mhanberg mhanberg enabled auto-merge (squash) November 9, 2023 13:29
@mhanberg mhanberg merged commit 156cf40 into main Nov 10, 2023
12 checks passed
@mhanberg mhanberg deleted the 2023-11-07-workspaces branch November 10, 2023 17:54
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.

None yet

2 participants