graphql / graphql/graphiql

[lsp-server] Add support for custom regions via comments

Open
#3,791 0 comments 0 reactions 0 assignees View on GitHub
enhancement lsp-server
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

## Current Behavior (if applicable)
``` gql
query {
foo {
bar
baz
# region
zim
zam
zop
# endregion
}
}
```

The region/endregion comments do not activate custom code folding regions.

## Desired Behavior
`# region` and `# endregion` or some variant like `# :region` and `# :endregion` should allow for custom code folding regions. This is especially useful for large queries within one resolver.

This specific syntax is an existing [feature](https://code.visualstudio.com/docs/editor/codebasics#_folding) for other languages in VS Code and there are other mechanisms for other editors. Regardless of the actual implementation, first-party support for some sort of custom folding would be greatly appreciated!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.