effekt-lang / effekt-lang/effekt-vscode

Unexpected Default Effekt Formatter

Open
#49 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5
Forks
5
PR merge metrics
No merged PRs in 30d

Description

#### Summary
I drafted a custom document formatter for Effekt as I think it would be a nice tool for development. However, I noticed that there is already a **default formatter** registered for Effekt, even though searching for `"format"`, `"formatter"`, or `"registerDocumentFormattingEditProvider"` in the codebase yields no results. This default formatter conflicts with the draft by having two "effekt" (default) formatters in VSCode. Maybe I'm not seeing something or there is no need for a formatter at all.

This default formatter also appears **non-functional**—when triggered via "Format Document," it does not modify the file.
I tested it with the following code-piece, which I think should somehow be altered by an formatter:
```scala
def count[A](list: List[A]){predicate:A=> Bool }: Int = {
var acc : Int = 0
list.foreach {el=>
if( predicate(el) ) {
acc =acc+ 1
}
}
acc
}
```

#### Expected Behavior
- There should be a way to **find and modify** the existing formatter or disable it if it is not functional.
- If a formatter is already provided (e.g., by the language server), it should be documented and properly implemented.
- If no formatter exists, I should be able to **register a new one** without conflicts.

#### Observation
- The formatter is marked as **(default)** in the list of formatters for Effekt.
- Without my draft, the same non-functional formatter is still available.
- The source of this formatter is unclear—possibly from an **external dependency** or the **language server** ?

**Does the language server implicitly register a formatter?** If so, is there a way to interact with or override it?

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.