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

[FEATURE] Allow terramate to format code actively #1877

Open
luong-komorebi opened this issue Sep 19, 2024 · 0 comments
Open

[FEATURE] Allow terramate to format code actively #1877

luong-komorebi opened this issue Sep 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@luong-komorebi
Copy link

luong-komorebi commented Sep 19, 2024

Is your feature request related to a problem? Please describe.
Terramate cli can format codes with terramate fmt. However, this can only happens after the codes have been saved, not during edit, and it has to be explicitly called via the command line interface with the files as arguments.

This is counter-intuitive for a development phase. Since we already have the vscode extension and the language server, we should register the capability to format the code (either the whole file or part of the code) as a capability for language server client to use.

This issue is also logged here terramate-io/vscode-terramate#24 but it does not seem like it is catching attention.

As a developer, I would love to detect early syntax errors and quickly get my code cleanly formatted so that developer exeprience and long term maintenance is better

Describe the solution you'd like

Allow the language server and lsp client to format files
Allow vscode users with vscode extension to format .tm.hcl file

Describe alternatives you've considered
I am using a precommit hook that is made by terramate themselves.

- repo: https://github.com/mineiros-io/pre-commit-hooks
  rev: v0.5.1
  hooks:
  - id: terramate-fmt
    types:
    - file
    files: \.tm.hcl$

This can be tweaked to support action on file-save or pre commit phases, but it would requires installing pre-commit and get to know a new system outside of the editor with a capable extension

Additional context
Add any other context or screenshots about the feature request here.

@luong-komorebi luong-komorebi added the enhancement New feature or request label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant