obsidian-various-complements-plugin icon indicating copy to clipboard operation
obsidian-various-complements-plugin copied to clipboard

FR: Option to automatically add words from Obsidian's built-in dictionary to the completion list

Open chrisgrieser opened this issue 3 years ago • 17 comments
trafficstars

Screenshot 2021-12-23 19 41 06 Screenshot 2021-12-23 19 42 23

I noticed that quite often, the words that I manually add to Obsidian's dictionary are often long academic terms that I'd also want to have suggested for autocompletes.

Is it possible to have an option to add the words Obsidian saves in that "Ignored Words" list also to the list of words suggested? (They are saved in .obsidian/app.json, btw.)

chrisgrieser avatar Dec 23 '21 18:12 chrisgrieser

Hi, @chrisgrieser. Thank you for your FR :)

I noticed that quite often, the words that I manually add to Obsidian's dictionary are often long academic terms that I'd also want to have suggested for autocompletes.

Right. I think so, too.

They are saved in .obsidian/app.json, btw.

I have added a word to the dictionary and seen .obsidian/app.json. But there are no words I added.

{
  "autoPairBrackets": false,
  "showLineNumber": true,
  "vimMode": true,
  "promptDelete": false,
  "alwaysUpdateLinks": true,
  "newFileLocation": "folder",
  "newFileFolderPath": "Notes/2021-51w",
  "showUnsupportedFiles": true,
  "attachmentFolderPath": "./attachments",
  "autoConvertHtml": false,
  "autoPairMarkdown": false,
  "pdfExportSettings": {
    "pageSize": "Letter",
    "landscape": false,
    "margin": "0",
    "downscalePercent": 100
  },
  "readableLineLength": true,
  "mobilePullAction": "command-palette:open",
  "defaultViewMode": "source",
  "livePreview": true,
  "legacyEditor": false,
  "spellcheck": true,
  "spellcheckLanguages": [
    "en-US"
  ]
}

If this behavior is as expected, It seems difficult to implement because there are no APIs related to spell checker/dictionary in Obsidian API .

tadashi-aikawa avatar Dec 25 '21 05:12 tadashi-aikawa

Hmm, for me they do show – maybe it takes a bit of time until the cache is written to that file or something? 🤔 Screenshot 2021-12-25 13 51 34

chrisgrieser avatar Dec 25 '21 12:12 chrisgrieser

I couldn't reproduce it even after reboot a machine. 🤔 (my machine is Windows?)

tadashi-aikawa avatar Dec 26 '21 13:12 tadashi-aikawa

could be an Windows issue since on mac, Obsidian uses a different type of spellcheck. no idea though 🤔

chrisgrieser avatar Dec 26 '21 13:12 chrisgrieser

Let me make this FR low priority because there are no interfaces on Obsidian API about this feature.

tadashi-aikawa avatar Jan 24 '22 00:01 tadashi-aikawa

I just came back to this, and app.vault.config.spellcheckDictionary in the console gives me an array of all words I manually added. Wouldn't hurt adding it, since it's so easy to implement I guess? Like simply a toggle in the settings, ignoring it when for whatever reason the words are not saved in that config file for users of certain operating systems?

chrisgrieser avatar Apr 16 '22 16:04 chrisgrieser

Ok. I'll implement it to v6.0.0-beta1. However, my windows machine has no app.vault.config.spellcheckDictionary, so I can't confirm it. Please test the feature after I release v6.0.0-beta1 🙏

tadashi-aikawa avatar Apr 17 '22 02:04 tadashi-aikawa

Sure, thank You 🤗

chrisgrieser avatar Apr 17 '22 03:04 chrisgrieser

Please test the feature after I release v6.0.0-beta1 🙏

Oh.. I forgot to implement.., so it will release v6.0.0-beta3 😅

tadashi-aikawa avatar Apr 17 '22 08:04 tadashi-aikawa

I found the dictionary file at $env:APPDATA/obsidian/Custom Dictionary.txt.

hoge
hogehoge
tadashi
tadashi-aikawa
checksum_v1 = 771945cfd7d9baa2348a00aa4f00a90c

In macOS, Is the dictionary file at ~/obsidian/Custom Dictionary.txt by any chance?

tadashi-aikawa avatar Apr 17 '22 10:04 tadashi-aikawa

In macOS, Is the dictionary file at ~/obsidian/Custom Dictionary.txt by any chance?

Nope, they are in .obsidian/app.json, as an array with the key spellcheckDictionary

chrisgrieser avatar Apr 17 '22 11:04 chrisgrieser

okay, i updated to beta3, where/how do I use the new feature? can't find anything in the settings and in the commands? 🤔

chrisgrieser avatar Apr 17 '22 21:04 chrisgrieser

okay, there is some strange stuff with the spellcheck dictionary going on, see here (and the following messages where I describe it): https://discord.com/channels/686053708261228577/716028884885307432/965367785507160064

chrisgrieser avatar Apr 17 '22 22:04 chrisgrieser

Sorry for the confusion. It doesn't release yet 😅 (the release note is correct). I'll release it after solving your problem in #114 .

okay, there is some strange stuff with the spellcheck dictionary going on, see here (and the following messages where I describe it): https://discord.com/channels/686053708261228577/716028884885307432/965367785507160064

Thanks! That would be very helpful. 😄

tadashi-aikawa avatar Apr 18 '22 00:04 tadashi-aikawa

@chrisgrieser I have released v6.0.0-beta7 🚀

Please confirm after enabling the below option whether it works as you expected.

image

tadashi-aikawa avatar Apr 29 '22 15:04 tadashi-aikawa

oh sorry, I haven't emphasized it properly... like in the Discord conversation linked above, we found out that the .obsidian/app.json contains only the spellcheck words for the outdated legacy editor – words I add to the spellcheck dictionary actually do not show up there, and I only had some there since I started adding words before the new editor 🙈

So basically the added words seem to be stored somewhere, but the .obsidian/app.json is not the right place, at least when you use the new editor. sorry, I should have said it more clearly instead of just linking the conversation 😔

chrisgrieser avatar Apr 29 '22 15:04 chrisgrieser

.obsidian/app.json contains only the spellcheck words for the outdated legacy editor

Oh... I overlooked legacy editor 😅 If so, there is nothing to do unless Obsidian API for spellcheck is published. 🤔

tadashi-aikawa avatar Apr 30 '22 03:04 tadashi-aikawa