Skip to content

languages/beancount: init#1100

Open
gmvar wants to merge 1 commit intoNotAShelf:mainfrom
gmvar:languages/beancount
Open

languages/beancount: init#1100
gmvar wants to merge 1 commit intoNotAShelf:mainfrom
gmvar:languages/beancount

Conversation

@gmvar
Copy link
Contributor

@gmvar gmvar commented Aug 22, 2025

Create the vim.languages.beancount module using bean-format and beancount-language-server.

Current Issues

  1. Formatting Behavior:
    • The beancount-language-server currently lacks an option to disable formatting. This results in documents being automatically formatted, even when the setting vim.languages.beancount.format.enable is set to false.
    • I have opened an issue on the project's GitHub repository requesting the addition of a toggle for this behavior. Until this feature is implemented, users will experience automatic formatting regardless of their preferences. GitHub Issue #650.
    • beancount-language-server added an option to disable the automatic formatting, though it's not clear to me how to enable that option... Until then, the language server will always format the document.

Sanity Checking

  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • My changes fit guidelines found in hacking nvf
  • Style and consistency
    • I ran Alejandra to format my code (nix fmt)
    • My code conforms to the editorconfig configuration of the project
    • My changes are consistent with the rest of the codebase
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas
    • I have added a section in the manual
    • (For breaking changes) I have included a migration guide
  • Package(s) built:
    • .#nix (default package)
    • .#maximal
    • .#docs-html (manual, must build)
    • .#docs-linkcheck (optional, please build if adding links)
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

@github-actions
Copy link

github-actions bot commented Aug 22, 2025

🚀 Live preview deployed from a3123a9

View it here:

Debug Information

Triggered by: gmvar

HEAD at: languages/beancount

Reruns: 2232

@gmvar gmvar force-pushed the languages/beancount branch from 0d75b65 to 8259788 Compare September 1, 2025 17:44
@gmvar gmvar marked this pull request as ready for review September 1, 2025 17:44
github-actions bot pushed a commit that referenced this pull request Sep 1, 2025
@gmvar gmvar force-pushed the languages/beancount branch from 8259788 to b38da6f Compare September 4, 2025 19:47
github-actions bot pushed a commit that referenced this pull request Sep 4, 2025
@gmvar gmvar force-pushed the languages/beancount branch from b38da6f to fa30514 Compare September 8, 2025 23:02
github-actions bot pushed a commit that referenced this pull request Sep 8, 2025
@horriblename horriblename force-pushed the v0.8 branch 2 times, most recently from 8b98f07 to ba9ce8b Compare September 13, 2025 07:23
@gmvar gmvar force-pushed the languages/beancount branch from fa30514 to aade359 Compare September 26, 2025 16:25
github-actions bot pushed a commit that referenced this pull request Sep 26, 2025
@gmvar gmvar requested a review from horriblename September 26, 2025 16:28
@gmvar gmvar force-pushed the languages/beancount branch from aade359 to 25c8b76 Compare October 5, 2025 02:28
github-actions bot pushed a commit that referenced this pull request Oct 5, 2025
@gmvar gmvar force-pushed the languages/beancount branch from 25c8b76 to c6e58f0 Compare October 30, 2025 17:03
github-actions bot pushed a commit that referenced this pull request Oct 30, 2025
Copy link
Owner

@NotAShelf NotAShelf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, I've meant to reply much earlier but kept forgetting each time. Two little comments before we can get this merged.

@gmvar gmvar force-pushed the languages/beancount branch from c6e58f0 to 08caf4d Compare November 1, 2025 00:05
@gmvar gmvar force-pushed the languages/beancount branch from 08caf4d to 82b0452 Compare November 8, 2025 19:28
github-actions bot pushed a commit that referenced this pull request Nov 8, 2025
@gmvar gmvar requested a review from NotAShelf November 8, 2025 19:30
@gmvar gmvar force-pushed the languages/beancount branch from 82b0452 to f7e8894 Compare December 11, 2025 01:31
github-actions bot pushed a commit that referenced this pull request Dec 11, 2025
@gmvar gmvar force-pushed the languages/beancount branch from f7e8894 to bc7712d Compare January 27, 2026 02:04
github-actions bot pushed a commit that referenced this pull request Jan 27, 2026
Copy link
Owner

@NotAShelf NotAShelf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one blocker, LGTM afterwards.

Comment on lines +19 to +24
beancountLanguageServerWrapped = pkgs.writeShellScriptBin
"beancount-language-server"
''
export PATH=$PATH:${pkgs.beancount}/bin
exec ${pkgs.beancount-language-server}/bin/beancount-language-server "$@"
'';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Vala module uses wrapProgram as follows:

       (getExe (pkgs.symlinkJoin {
          name = "vala-language-server-wrapper";
          paths = [pkgs.vala-language-server];
          meta.mainProgram = "vala-language-server-wrapper";
          buildInputs = [pkgs.makeBinaryWrapper];
          postBuild = ''
            wrapProgram $out/bin/vala-language-server \
              --prefix PATH : ${pkgs.uncrustify}/bin
          '';
        }))

What you're using is not incorrect, but there are existing conventions that I'd rather prefer for their history of adoption and overall reliability. iirc writeShellScriptBin also pulls in another interpreter.

With makeBinaryWrapper we can also ensure better Darwin compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the guidance! I made the change but opted for a PATH suffix instead of a prefix. This ensures that existing configurations remain prioritized, as beancount allows users to install plugins. If the LSP uses a different version of beancount, it can cause diagnostic errors due to unknown features.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think the existing Vala module cmd needs to be changed like so:

- meta.mainProgram = "vala-language-server-wrapper";
+ meta.mainProgram = "vala-language-server";

Doing the current way wasn't successful as a drop in replacement for beancount-language-server during testing.

@gmvar gmvar force-pushed the languages/beancount branch from bc7712d to 558b497 Compare January 28, 2026 02:48
github-actions bot pushed a commit that referenced this pull request Jan 28, 2026
@gmvar gmvar requested a review from NotAShelf January 28, 2026 17:33
@github-actions github-actions bot deleted the branch NotAShelf:main March 1, 2026 05:13
@gmvar gmvar force-pushed the languages/beancount branch from 558b497 to 1dc2b50 Compare March 5, 2026 02:19
@gmvar gmvar changed the base branch from v0.8 to main March 5, 2026 02:19
github-actions bot pushed a commit that referenced this pull request Mar 5, 2026
Create the `vim.languages.beancount` module using `bean-format` and
`beancount-language-server`.
@gmvar gmvar force-pushed the languages/beancount branch from 1dc2b50 to 48b7a34 Compare March 5, 2026 23:46
github-actions bot pushed a commit that referenced this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants