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

New project structure / beginning of plugins #184

Merged
merged 6 commits into from
May 30, 2023
Merged

New project structure / beginning of plugins #184

merged 6 commits into from
May 30, 2023

Conversation

scohen
Copy link
Collaborator

@scohen scohen commented May 25, 2023

Making plugins necessitated a new project structure, as we're going to need to publish a separate library for plugin authors so they can use them. We'll also need a bunch of the modules they'll use, so we need the least stressful way of depending on the libraries we publish.

Creating a separate repo would make our lives very difficult, so I added a projects directory at the top level, and the published libraries go in there. We utilize path dependencies for our internal libraries.

I also added the beginnings of a plugin architecture, but I wanted to get this change out before it gets too big. Plugins are quite complicated, and we're going to need to do a bit of refactoring when we add one. That refactoring, plus all of this moving would make the PR very difficult to review.

This PR also includes a new genserver dispatcher so that the compile tracer isn't slowed down by extraneous work.

@scohen scohen requested a review from scottming May 25, 2023 23:50
Making plugins necessitated a new project structure, as we're going to
need to publish a separate library for plugin authors so they can use
them. We'll also need a bunch of the modules they'll use, so we need
the least stressful way of depending on the libraries we publish.

Creating a separate repo would make our lives very difficult, so I
added a projects directory at the top level, and the published
libraries go in there. We utilize path dependencies for our internal
libraries.

I also added the beginnings of a plugin architecture, but I wanted to
get this change out before it gets too big. Plugins are quite
complicated, and we're going to need to do a bit of refactoring when
we add one. That refactoring, plus all of this moving would make the
PR very difficult to review.

This PR also includes a new genserver dispatcher so that the compile
tracer isn't slowed down by extraneous work.
@scohen scohen force-pushed the lexical-plugins branch from 8d53558 to e72fc8e Compare May 26, 2023 00:18
@scottming
Copy link
Collaborator

scottming commented May 26, 2023

In addition to the mentioned issues, we also need to consider the problem of Diagnostics clearing, which doesn't seem to be reflected in this PR.

For example, the diagnostic clearing of Mix shouldn't clear Credo's Diagnostics.

@scohen
Copy link
Collaborator Author

scohen commented May 26, 2023

This pr doesn’t build diagnostics yet, that’s going to be another large change

scohen added 4 commits May 26, 2023 09:23
The name lexical conflicted with the language server's app and
formatting would fail because it was using lexical's mix project. This
was also reflected by the necessity of creating a unique name for the
project, the fix was just masking the problem.
If we can't find the formatter, we were running the formatter with
default options, which would be annoying if you've configured
the formatter, and you'd just get the defaults. This could be
annoying. This change makes a best effort to find the .formatter.exs
in the parent directories of your application, and it stops at the app
root. If it's not found in any of the parents, you get default options.
I kept having to update the apps at the top of this file whenever I
added, removed or renamed a dependency. This is annoying, and I
thought it would be a lot easier to just let the mix.exs control which
apps are needed by remote_control.
@scohen
Copy link
Collaborator Author

scohen commented May 26, 2023

In addition to the mentioned issues, we also need to consider the problem of Diagnostics clearing, which doesn't seem to be reflected in this PR.

This is a good point, let me share my strategy with you now.

I want to normalize all diagnostic messages to utilize the plugin replies --even builds. Each plugin will then own a specific source (and we'll treat ours with the source of lexical). Then, clearing diagnostics will be a matter of:

  1. For a project build, clear all diagnostics when the project is compiled.
  2. For a file, clear diagnostics when the file is changed and let the plugins re-add them.

@scottming
Copy link
Collaborator

Apply your last suggestions: #184 (comment)

Then you are good.😊

@scohen scohen force-pushed the lexical-plugins branch from 5b30756 to 767786f Compare May 30, 2023 20:06
@scohen scohen merged commit a696249 into main May 30, 2023
@scohen scohen deleted the lexical-plugins branch May 30, 2023 20:15
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.

2 participants