VSCode mainbeanfile: no effect [solved]
See original GitHub issueI’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:
- in terminal, cd to main bean folder
- enter “code .”
- 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.
- make file child.bean and add the line “include child.bean” to main.bean. save main.bean.
- open child.bean, enter the following incomplete transaction and observe no autocomplete suggestions:
intended behavior: show suggestions from main.bean and all included files (image from within main.bean:
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
- me specifying an absolute path of the
main.bean
file where a relative path is required. - 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:
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:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
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!
Can you please open VSCode’s Output panel and switch to
beancount
to show me the content like this?