-
Notifications
You must be signed in to change notification settings - Fork 24
refactor: comint daemon to jsonrpc #165
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
Conversation
@elken sorry for the delay, could you fix conflicts and the CI ? |
Apologies, I haven't used flutter in ages so these changes have been forgotten. I will make time to resolve these this week |
Apparently time makes fools of us all! 😅 I'm looking at this as we speak (will try and resolve the merge conflicts too) |
218239f
to
6717ab1
Compare
@ericdallo I'm not familiar with eask but it seems to be complaining about missing packages and autoloads now (missing packages might be https://github.com/emacs-eask/eask/issues/11) |
6f21aca
to
c5f8af6
Compare
Well I can't replicate the CI errors... Have tried with freshly built emacs 27 and it runs everything fine |
After seeing your last comment, I have reinstalled emacs freshly as well, and I am getting the same error. I can assist you in the process if you need someone for that. @elken |
Sure! If you figure them out do let me know, I'll try and pick it up as I have spare time |
I misread the CI part 😅. If you could instruct me how to use your branch on my local machine, I can try it out. I am not really good at these:/ |
Well that's the thing, it works fine when I run it in isolation locally. Maybe see if act breaks |
@jcs090218 any thoughts about CI failing? |
Cool this looks like it might resolve the CI errors. This isn't ready to go in yet though, and I am starting to be annoyed enough to resolve this so I'll try and have the issues resolved this week ish EDIT: Did a quick google of the windows snapshot failure, it's an emacs 29 function so best guess would be it's pinned to a commit that doesn't have it? |
There is an issue is from Emacs windows snapshot, see https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-07/msg01656.html. We could do the following:
|
I like the experimental version the most, me personally I don't consider Emacs 29 as anything as there's not even a branch cut. So I'd be fine ignoring it unless it's needed. |
Oh yes, please ignore 29. I have it there for my own use. Just look at the experimental part of the code. |
I know what you were referring to, I was agreeing xD I'll submit those in a different PR though |
@elken Looks good to me! |
You sure? I was having issues with emulators starting up in a few cases. It's your codebase so you are obviously much more knowledgable so if you're happy to merge it go for it, I just want to run through some usecases to make sure it works and resolves my issues proper! :D Glad you're happy with it though, I was worried when I made it that I botched it lol |
I meant the code review 😅 I still need to manually test it |
@elken any updates on this? it'd be really nice to have this fixed |
Posted an update on discord but for visibility; I'm leaving the company that uses flutter so my usage of it has gone way down, but I'm keen to try and pick it back up to wrap it up when I can. EDIT: I have acquired much more free time now, so I will be looking into this this week |
I've tried running this branch with the latest master changes, and here's an error I get when opening a dart buffer, and also when I call
The path of my flutter install is correct, written like this in my config.el file (actually here's the whole lsp-dart config block)
|
A change was recently made to adjust how the dart executable is called, I have time to work on this PR again so I will look into it in the next couple of days |
Just a mention though, I've tried running a dart vm main file with lsp-dart-run and it works fine so far. |
Any update on this? I can provide details/help if needed. I could also provide a PR if somebody directed me to something to look at! |
Thanks for this ping, I really do hate having a life sometimes 😅 This weekend I should be free so I'll try my very best to pick it up. I tried to pick this up the other day... In terms of help, I've put the couple of issues I was getting in the initial PR message. @ericdallo I know lsp-mode is starting to move everything over to plists, is this something I should add in here or is that something you'll look into later? Just remembered the last time I tried it when I had my macbook I was running the plist setup and kept hitting issues |
@elken Feel free to do whatever it's easiest for you, I can migrate it later, there are some missing points on other places of lsp-dart that I still need to take a look |
In that case I'll leave it then. Worth being aware of though, last I spoke to yyoncho about it it seemed that most of the other clients have implemented it so I imagine the switch will be soon ™️ |
Yep, it's the top lsp-dart priority to me ATM after this PR , I will try to take a look in the next days |
Change the hacky comint implementation to a more stable and robust JSONRPC implementation. A process is managed by emacs and commands are sent/recieved asynchronously to that process. Obseletes emacs-lsp#164
Ensure this is pulled while we need it
Handle the fact that lsp-dart-flutter-command is now a list rather than a fixed string
Upon loading, the daemon sends a couple of messages that jsonrpc tries to treat as a single message
Only process the success callback when there's a result to apply
@ericdallo I can't apologise enough for this taking so long 😅 I've fixed both the issues I mentioned in the original message, so this should be fine to look over now. I appreciate that jsonrpc is a bit of a black box, so I'm happy to provide some accompanying documentation on how things work but as far as I can tell this should be good for testing at least. I also don't have access to a macbook now, but I might be able to wrangle some people who do; but there's no reason that this shouldn't resolve the original issue that spawned this. I also know it's a busy night for you, so without derailing this thread good luck! |
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.
Thank you very much for this @elken!
I reviewed and manually tested and works great, I will merge this and do only a few refactorings on master like removing the message
, try to remove ht dep and improve some function's complexity, anyway glad to see this working!
Thanks! Glad it's working smoothly. I wrote that massive process filter function in a bit of a haze then convinced myself "ah it works for now" 🤣 |
@elken no problem, I'm finishing the refactor on that function, it's not that better than before but it's using some lsp-mode functions for that instead. |
Yeah, ideally both would have to be supported. Maybe create a frozen |
yeah for now I'll try to leave this complexity in a specific function or so |
Change the hacky comint implementation to a more stable and robust
JSONRPC implementation.
A process is managed by emacs and commands are sent/recieved
asynchronously to that process.
Currently there still exists a couple of bugs I'm struggling to nail down
(mostly because I'm unfamiliar with the hash-table/dash combination):
once. This should easily be rectified with a
listp
check when parsingwhy. I suspect something isn't being set correctly maybe in one of the
listeners
Apologies for opening two PRs for the same thing, when I first tried getting
this working every request timed out so I looked into the tcp implementation.
This supersedes that now as it's much more simple.
Obseletes #164