Skip to content
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

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

Open
SCWells72 opened this issue Jan 15, 2025 · 1 comment
Open

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

SCWells72 opened this issue Jan 15, 2025 · 1 comment

Comments

@SCWells72
Copy link
Contributor

SCWells72 commented Jan 15, 2025

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.

@angelozerr
Copy link
Contributor

I love this idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants