pajoma / vscode-journal

Lightweight journal and simple notes support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pajoma.vscode-journal
GNU General Public License v3.0
233 stars 40 forks source link

Issue with notes cross-referenced to date entries #100

Closed fpopineau closed 2 years ago

fpopineau commented 2 years ago

Hi,

I get a strange result with the Journal:New Journal Note command where 2 links are added to the date entry, and they are both wrong. Those links look like:

- NOTE: [() Journal](file:///c%3A/Home/%40Archive/2021/%40Drafts/Journal)
- NOTE: [() Personal](file:///c%3A/Home/%40Archive/2021/%40Drafts/Personal)

The note itself is created as expected.

FWIW, I am using scopes in my configuration.

[EDIT] The problem comes from the fact that the extension does not expect to find subdirectories in the folder where notes are stored. It should be pretty easy to achieve, but I wonder about any side effects?

Configuration:

"journal.base": "c:\\Home\\@Archive",
"journal.patterns": {
        "entries": {
            "path": "${base}\\${year}\\@Drafts\\Journal",
            "file": "${month}-${day}.${ext}"
        },
        "notes": {
            "path": "${base}\\${year}\\@Drafts",
            "file": "${input}.${ext}"
        },
    },
"journal.scopes":  [        
        {
            "name": "me", 
            "patterns": {
              "notes": {
                "path": "${base}\\${year}\\@Drafts\\Personal",
                "file": "${d: YYYY-MM-DD}-${input}.${ext}"
              }, 
            }
        }

Thanks for your help and keep up the good work.

pajoma commented 2 years ago

I can't think for any side effects, seems like a pattern matching problem (I scan through all configured folders to find new note files). I check it out.

pajoma commented 2 years ago

I filtered out the subdirectories, no sideeffects observed yet. I still have a weird bug that, once I added a new note to the "me" scope, any subsequent calls to the vscode configuration are broken. Restarting vscode fixes it.