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

[ refactor ] IDE protocol as a separate module hierarchy #2171

Merged
merged 26 commits into from
Dec 16, 2021

Conversation

ohad
Copy link
Collaborator

@ohad ohad commented Dec 6, 2021

Much left to do:

  • Continue pulling out functionality into protocol hierarchy
  • include deserialisation functions for all messages
  • Create message types for all IDE protocol interactions so that each SExpr construction factors through an IDE message type + serialisation invocation.
    New message types:
    • data Return = OK ... | Error ...
    • Highlighting
    • File position / span
  • Refactor REPL so that it creates return messages instead of SExp's

Breaking changes to the protocol:

  • We now send spans / file contexts with same convention as in Bounds, and this change would breaks, say, emacs's idris2-mode.
  • We now send structured file contexts as response to NameAt, and emacs's jump-to-def needs adjusting accordingly

We updated the following IDE protocol clients (currently draft PR until this one is merged):

Added 3 modules: Protocol.{Hex, IDE, SExp}

Prepare a stub package file so that we could install the protocol
messages + (de)serialisation separately from idris2api
@gallais gallais added the event: IDM 2021/12 Issue tackled during the December 2021 Idris Developers Meeting label Dec 6, 2021
Ohad Kammar added 5 commits December 9, 2021 08:25
Another breaking change: when we send the file context inside a
warning, it is now sent with the `Bounds` convention
for `MetaVarLemma` and `IdrisVersion`
Result is outstanding because it is ambiguous
@ohad ohad marked this pull request as ready for review December 10, 2021 11:44
@ohad ohad requested a review from gallais December 10, 2021 11:44
src/Idris/IDEMode/Commands.idr Outdated Show resolved Hide resolved
src/Idris/IDEMode/REPL.idr Outdated Show resolved Hide resolved
src/Protocol/IDE/Command.idr Outdated Show resolved Hide resolved
src/Protocol/IDE/Decoration.idr Show resolved Hide resolved
src/Protocol/IDE/Command.idr Show resolved Hide resolved
src/Protocol/IDE/Formatting.idr Show resolved Hide resolved
src/Protocol/IDE/Highlight.idr Show resolved Hide resolved
src/Protocol/IDE/Holes.idr Show resolved Hide resolved
src/Protocol/IDE/Result.idr Show resolved Hide resolved
src/Protocol/SExp.idr Show resolved Hide resolved
ohad and others added 3 commits December 16, 2021 18:31
@gallais
Copy link
Member

gallais commented Dec 16, 2021

(If you go to the files tab you can add all the suggestions to a single batch and
commit them all in one go btw)

@gallais gallais self-assigned this Dec 16, 2021
@gallais gallais changed the title Refactoring the IDE protocol to a separate module hierarchy [ refactor ] IDE protocol as a separate module hierarchy Dec 16, 2021
@gallais gallais merged commit 3c532ea into idris-lang:main Dec 16, 2021
@gallais
Copy link
Member

gallais commented Dec 16, 2021

🚀

gallais pushed a commit to idris-community/idris2-mode that referenced this pull request Dec 19, 2021
#11)

* Update semantic highlighting code in line with the update IDE protocol

See idris2 [PR#2171](idris-lang/Idris2#2171 new spec for [`Bounds`](https://github.com/idris-lang/Idris2/blob/dd8914f627604461632bb530cb734014a47f505f/src/Libraries/Text/Bounded.idr#L9-L16)

* Fix off-by-1 error

Co-authored-by: Ohad Kammar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli: ide-mode code: refactoring event: IDM 2021/12 Issue tackled during the December 2021 Idris Developers Meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants