fwcd / fwcd/vscode-kotlin

Improved region-comment folding support

Open
#76 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
359
Forks
56
PR merge metrics
No merged PRs in 30d

Description

### Motivation
Having the same code folding syntax supported in Android Studio and VS Code would be great.
It's just really annoying that they're not the same.

### Description
Code like

```kotlin
//region Some name here
foo()
//endregion
```

is understood by Android Studio, and VS Code (if set to or Rust using the RLS extension). This means it's possible for
VS Code to understand this syntax, if the language extension supports it.

However, when VS Code uses this extension to handle Kotlin, the code can no longer be folded.

### Proposed change

Accept both

```kotlin
// #region regionName
vsCodeStyle()
// #endregion
```

and

```kotlin
//region regionName
androidStudioStyle()
//endregion
```

syntax comments.

If I have time, I might open a PR myself, let me know if that'd help.
*Edit*: I might have to look for the correct repository to submit this issue to. Searching the code, I'm not sure this extension handles code folding itself. Should this be changed in this extension or in the Language-Server?

# TL;DR

`// #region regionName` & `// #endregion` works, but `//region regionName` & `//endregion` doesn't;
please fix/improve

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing whether code folding is handled by the VS Code extension or the Language-Server, as the issue does not identify the owning component. Done means both Android Studio-style and VS Code-style region comments fold correctly when the Kotlin extension is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.