microsoft / microsoft/language-server-protocol
Request for more folding range kinds
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13k
- Forks
- 1k
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 10
Description
Request
Currently we have just three range kinds: imports, comment and region. Even though the FoldingRange.kind is defined as string and is meant to be extensible, current situation does not lead to new kinds being agreed between clients and servers. Clients do not want to add kinds that servers do not produce, and servers don't want to add kinds that are not supported by clients.
Adding more kinds would allow servers to emit more detailed folding structure and let clients offer users greater customization options, e.g. if servers emitted method_with_docblock, docblock, method, method_body for the following code:
/** // <== method_with_docblock, docblock
* @param int $param
*/ // <== docblock end
function func($param): int // <== method
{ // <== method body
....
} // <== method body end, method end, method_with_docblock end
clients/users would be able to configure folding in various ways just by toggling what kinds of folding ranges a client would recognize.
Examples
Folding method_with_docblock (the function func($param): int is assumed to be produced by providing collapsedText with the corresponding folding range
+-- function func($param): int --
Folding docblock and method_body
+-- /** --
+-- function func($param): int --
{
+--
}
Contributor guide
No contributing guide indexed for this repository
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 by reviewing the existing FoldingRange.kind definition and the three current kinds named in the issue: imports, comment, and region. Done means reaching agreement on additional standardized folding kinds and reflecting that decision in the protocol specification and examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100