Ensure LSPs Exit, Add Exit Activities#2080
Merged
thecoolwinter merged 5 commits intoCodeEditApp:mainfrom Jul 11, 2025
Merged
Conversation
6 tasks
thecoolwinter
added a commit
that referenced
this pull request
Jul 16, 2025
### Description
- Adds two key commands - Command R and Command . to start and stop tasks.
- Adds a new Tasks menu item. Subitems:
- Run {Selected Task}
- Runs the selected task, disabled when no selected task.
- Stop {Selected Task}
- Stops the selected task, disabled when no task is running.
- Show {Selected Task} Output
- Navigates to the selected task output - this could maybe? be in the Navigate menu. *Looking for feedback here.*
- Chose Task...
- Submenu is a list of the user's tasks. Selects a task. If the user has no tasks, has a single "Create Task" item.
- Manage Tasks
- Opens the workspace's task settings.
### Related Issues
* Thought there was an open issue but there isn't, whoops.
### Checklist
- [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code
### Screenshots
Demo with running a task, stopping it, navigating to it's output.
> Note that there's a few bugs in this demo that are fixed by #2080. Such as overlapping task status and task activities appearing in all workspaces.
https://github.com/user-attachments/assets/602dedf2-3626-4ea1-a04b-9d7a9945a458
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
LSPs may refuse to exit (due to a bug or whatnot) but we need to ensure that CodeEdit can still close when quit. This adds both a timeout when language servers are stopped, and a method to send
SIGKILLto language servers if necessary.This can only cause a delay while quitting CodeEdit. To help with the UX here, I've added some activity notifications that tell the user why we're delaying quitting CodeEdit. Both task termination and language server stopping are displayed while CodeEdit attempts to quit.
Detailed Changes
LanguageClientpackage to use a new method that lets us grab the started language server process.pid_tof the process is stored onLanguageServerfor future use.LSPService.stopServerto not use a throwing task group. For some reason the task group refused to continue even if the language server did close correctly. A non-throwing task group works correctly.LSPService.killAllServersto sendSIGKILLto all language servers if necessary.AppDelegateto send activity notifications when delaying quitting the app.AppDelegateto timeout language server stopping and kill them if necessary.TaskNotificationHandlerto help with sending tasks. Updated docs to match.TaskNotificationHandlerto limit activities to a single workspace. If left out, does not limit the workspace.CEActiveTaskto differentiate between task runs (see screen recording).Related Issues
Checklist
Screenshots
Before change. Tasks show up in all workspaces, cancelled tasks remove new task activities.
Screen.Recording.2025-07-08.at.11.58.24.AM.mov
After the change. Active tasks have their own ID and cancelled tasks don't remove new task activities.
Screen.Recording.2025-07-08.at.11.57.09.AM.mov