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 41 forks source link

Can't use the extension #10

Closed epinadev closed 7 years ago

epinadev commented 7 years ago

I've installed the extension and configured in the settings the "journal.base" to this "/Users/eduardo/Dropbox/journal". When I try to use for example the following:

journal:today

I get a VS error that says:

Running the contributed command:'journal.today' failed.

Same thing if I try with journal:tomorrow or journal:yesterday.

Also if I press Cmd+Shift+J and then type 0, +1, -1, monday, anything, then nothing happens, same thing with Quick Memo. Actually the only two commands that work are: journal: Notes (which creates a new note and when I save it, it appears in the folder) and journal: Open the Journal (which perfectly opens the journal folder I've configured)

I've checked folder permissions but doesn 't seems to be the problem. I'm using MacOs El Capitan, VSC Version 1.8.1 (1.8.1), and the extension version is 0.4.0 (The only one that vs downloads)

Perhaps is something I'm missing or that I haven't configured, maybe with the VS. I'd really love to use the extension since I was using something similar with Vim and I'm really used to it. Thanks in advance.

epinadev commented 7 years ago

Well, I found what the problem is. I cloned the repo and debugged the extension by myself. I found the problem in the out/src/util/conf.js file:

return (locale.length == 0) ? locale : 'en-US';

It turns out that my locale was empty string "" and thus that was returning, and then it failed. I modified that line to:

return (locale.length == 0) ? 'en-US' : locale;

And now it works. Correct me if I'm wrong but, if no locale is found I think it should return en-US instead of the empty string. Btw, I had 'en-US' in my locale.json after configuring the language on VS, but still it was not working without doing the modification.

pajoma commented 7 years ago

You're right of course, 'en-US' should be the default if no locale is configured. I have to check why it didn't work even after you changed the settings.