Skip to content

Add support for folding-by-default of certain regions #749

Closed
@SCWells72

Description

@SCWells72

JetBrains' IDEs provide support for automatic folding for certain regions, some language-agnostic and some language-specific, e.g.:

Image

The textDocument/foldingRange response does provide some limited categorization of folding ranges, e.g., the following from the TypeScript language server:

[
  {
    "startLine": 5,
    "endLine": 55,
    "kind": "imports"
  },
]

and the following from the Java language server (jdtls):

[
  {
    "startLine": 0,
    "endLine": 9,
    "kind": "comment"
  },
  {
    "startLine": 21,
    "endLine": 23,
    "kind": "comment"
  },
  {
    "startLine": 13,
    "endLine": 19,
    "kind": "imports"
  },
]

It would be nice if these could either be automatically mapped to the corresponding IDE folding regions, e.g., kind: imports => Settings | Editor | General | Code Folding | Fold by default | General | Imports, or if minimally there could be some other way to specify which values for kind should be folded by default, e.g., through client configuration.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

  • Status

    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions