question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode mainbeanfile: no effect [solved]

See original GitHub issue

I’d love to use the autocomplete feature based on my full ledger, but i can’t get it working. Any suggestions?

[SOLVED: see solution at the bottom of this opening post]

System: WSL Ubuntu 18.04 & VSCode, beancount extension

steps to reproduce:

  1. in terminal, cd to main bean folder
  2. enter “code .”
  3. in the vscode window, look for the setting “beancount.mainBeanFile” and override default to “~/pathToLedgerFolder/LedgerFiles/main.bean” Question: should this be in user or workspace preferences? I put it in both to be sure.
  4. make file child.bean and add the line “include child.bean” to main.bean. save main.bean.
  5. open child.bean, enter the following incomplete transaction and observe no autocomplete suggestions: image

intended behavior: show suggestions from main.bean and all included files (image from within main.bean: image

I also made the settings.json with

{
    "beancount.mainBeanFile": "~/pathToLedger/LedgerFolder/Ledgerfiles/main.bean"
}

according to the scheme below. I wonder how it relates to the user/workspace settings of vscode

BeanFolder ├── ledgerFiles │ ├── .vscode │ │ └── settings.json │ └── main.bean

SOLUTION

The cause of the problem was

  1. me specifying an absolute path of the main.bean file where a relative path is required.
  2. me using “~/” instead of “home/” for specifying the python path.

so i could fix the problem by changing

{
    "beancount.mainBeanFile": "~/pathToLedger/BeanFolder/Ledgerfiles/main.bean",
    "beancount.python3Path": "~/path/miniconda3/envs/Bean/bin/python3"
}

to

{
    "beancount.mainBeanFile": "main.bean",
    "beancount.python3Path": "home/path/miniconda3/envs/Bean/bin/python3"
}

just to be clear, these lines need to be

BeanFolder
├── ledgerFiles
│   ├── .vscode
│   │   └── settings.json  <- in this file
│   └── main.bean

you can find the correct relative path by right clicking the main.bean in the explorer pane: image

the correct python path you can find by entering which python3 and copy-pasting the answer

[edit] with these 2 paths in my Workspace Setting I managed to activate auto completion without the restriction of having the main bean folder as vscode working space folder.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Dr-Nukecommented, Apr 3, 2020

I guess the issue is ~ in beancount.python3Path. Maybe you can try a full path?

you nailed it. that fixed it. now the suggestions in child.bean are properly displayed. i will edid the opening post with the solution and then we can close this.

thanks a ton for your help & suggestions!

1reaction
Lencerfcommented, Apr 3, 2020

Can you please open VSCode’s Output panel and switch to beancount to show me the content like this? telegram-cloud-photo-size-5-6334729015734151592-y

Read more comments on GitHub >

github_iconTop Results From Across the Web

User and Workspace Settings - Visual Studio Code
User Settings - Settings that apply globally to any instance of VS Code you ... Changing this setting has no effect on existing...
Read more >
Unable to format a plaintext file · Issue #125594
It seems that VSCode has absolutely no chance to format plain text ("plaintext" as it says itself). Create a .txt file with some...
Read more >
Visual Studio. Code changes don't do anything
It sometimes happens that some files "are being used by another process". Close your solution and delete all "bin" and "obj" subfolders of...
Read more >
VS Code Debugger not working for python
I tried the switch to an old version of the intellisense extension to no effect. I am running latest VSCode on Ubuntu (also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found