Make it possible to disable comment continuation
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2k
- Forks
- 281
- Avg merge
- 2h 14m
- Merged PRs (30d)
- 6
Description
I have checked that this feature is not already implemented
- This feature does not exist
Use case
When I write a single line comment, I usually want to write code directly after. However, ruby-lsp implements comment continuation for even single line comments, which causes me to attempt to write code on a comment line all the time before I notice and have to go back to remove the leading #. No other LSP that I use does comment continuation this way. The possibility to disable this would make it more convenient to write code for people using multiple languages.
Description
The option to disable comment continuation via the settings of the editor. I only work with VS Code, so I don't know if there would be complications for other editors.
Implementation
I'm (kind of) new to Ruby so I don't trust myself to talk implementation details, but I believe I have found where this feature is implemented at least:
If possible, another user-configurable condition should be added to the if statement in line 53 to allow users to disable it if they don't want to use it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/ruby_lsp/requests/on_type_formatting.rb at the referenced lines, then trace how editor settings are declared and passed to this request. Define a user-configurable option that controls comment continuation without assuming VS Code is the only client. Done means the setting disables continuation when selected while preserving current behavior by default, with coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100