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

Experimental project structure #773

Merged
merged 21 commits into from
Jan 20, 2023

Commits on Jan 4, 2023

  1. Experimental project structure

    This commit represents a new structure for the experimental project, and
    a path forward. With these changes the project now has:
    
      * A build option enabling the experimental server
      * Per-message routing for the experimental server. If enabled, it can
        either share messages with the existing server or take them over.
        Presently, the find references and formatting providers are
        implemented and "exclusive", meaning that they're handled solely by
        the experimental server
      * A consistent interface for building providers.
      * A consistent way to convert lsp messages into data structures and
        back again. This conversion is handled automatically for providers.
      * A genserver-like interface for providers to implement
      * Data structures representing LSP messages that are simple to define
        and build.
      * Fast and efficient conversion between utf8 and utf16.
      * A separation between what a provider does and how it responds to
        messages. This allows the work that underpins providers to be tested
        independently from the language server.
    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    7f6a8b3 View commit details
    Browse the repository at this point in the history
  2. Add underscore code action

    Created a code action that prepends an underscore to unused variable
    names.
    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    74be499 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fa469a3 View commit details
    Browse the repository at this point in the history
  4. Properly handled spacing

    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    4fb8068 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8fecb83 View commit details
    Browse the repository at this point in the history
  6. removed unused variable

    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    2145c24 View commit details
    Browse the repository at this point in the history
  7. Committed to pipeline

    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    e4b7ee4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d46d342 View commit details
    Browse the repository at this point in the history
  9. Code modification framework

    First attempt at a standard interface for code modification. Code mod
    modules take the original text, the ast of the original text and
    arguments that they specify. They return a list of code edits or an
    error.
    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    77f415e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2b04d83 View commit details
    Browse the repository at this point in the history
  11. Fixed off-by-one error that was vexing code unit conversions.

    The problem was that the character positions are _before_ the reported
    unit, so the 0th code unit is before the start of the line and the 1st
    code unit is the first character. The prior code added one to
    character counts to smooth this out, but you can't do that, because
    you could end up indexing into the middle of a multibyte character.
    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    a185b00 View commit details
    Browse the repository at this point in the history
  12. The code action needs to fix up the line numbers

    Code mods deal with snippets of code that need to have their line
    numbers fixed up by the code actions.
    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    d04d93c View commit details
    Browse the repository at this point in the history
  13. Fixed type spec

    The AST type is very complicated, and dialyzer was telling us I got it wrong.
    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    302ebc9 View commit details
    Browse the repository at this point in the history
  14. Made type aliases a thing

    While working on the automatic protocol generators, it became clear
    that type aliases needed to be their own thing, as they operate quite
    differently from the other defined things in the jsonrpc
    protocol. Since they're just aliases, it makes sense to keep their
    definitions on hand and then spit them out when other things make use
    of them during encode and decode.
    
    This did require going back to encoding and ensuring all the encode
    functions return OK tuples.
    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    840caeb View commit details
    Browse the repository at this point in the history
  15. Fixed unit tests

    When patches are unapplied, getting the beam file returned an empty
    path charlist, which dialyzer assumed was a real file name due to a
    weak assumption, which caused unit tests to fail. This was remedied by
    checking for a non-empty charlist, which allows tests to succeed.
    
    Also made patch a test only dependency for .formatter.exs, as this was
    causing formatters to fail.
    scohen committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    b53ac91 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2023

  1. Configuration menu
    Copy the full SHA
    7fde975 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2023

  1. Added sourceror to ease ast to string conversion

    Under 1.12, Macro.to_string proudces wonky output, making `def` calls
    look like function calls by adding needless parenthesis. These
    parenthesis throw off the diff algorithm, and caused an off-by-one
    error in the code mod.
    Sourceror has backported the newer code generation so that it's
    compatible all the way back to 1.10, and produces the correct output.
    scohen committed Jan 19, 2023
    Configuration menu
    Copy the full SHA
    07a4be8 View commit details
    Browse the repository at this point in the history
  2. Added patch as a dev dependency

    Patch's assertions will fail in CI due to `mix format
    --check-formatted` running in dev. Importing patch's deps in test will
    fix this.
    scohen committed Jan 19, 2023
    Configuration menu
    Copy the full SHA
    b23a87d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6c8e9d8 View commit details
    Browse the repository at this point in the history
  4. Fixed dialyzer errors

    scohen committed Jan 19, 2023
    Configuration menu
    Copy the full SHA
    32f9fff View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2023

  1. Encapsulated sourceror

    scohen committed Jan 20, 2023
    Configuration menu
    Copy the full SHA
    f33cb19 View commit details
    Browse the repository at this point in the history