https://www.dendron.so/ logo
Join Discord
Powered by
# dev
  • h

    hikchoi

    02/12/2021, 3:20 AM
    would be more exciting sure. I'll look around and see if there's something I want to tackle. In the meantime though, the small tasks are perfect for me to get comfortable with ts
  • k

    kevins8

    02/12/2021, 3:55 AM
    sounds good. i’ll be adding more small tasks tomorrow!
  • h

    hikchoi

    02/12/2021, 3:57 AM
    Thanks! It's a long weekend so I'll have some time to work on them 😄
  • h

    hikchoi

    02/12/2021, 3:58 AM
    Stuck alone during LNY because I don't like the idea of the hypothetical possibility of spreading covid to my family.
  • k

    kevins8

    02/12/2021, 4:21 AM
    sorry to hear that. its a hard choice to be alone in these times, even when its the right thing to do
  • h

    hikchoi

    02/12/2021, 4:24 AM
    tbh I love being home all the time. 😄 unfortunately work wanted me to be in the office starting last monday haha
  • h

    hikchoi

    02/12/2021, 4:25 AM
    The work-home separation is nice though. That was the worst part of WFH
  • k

    kevins8

    02/12/2021, 4:31 AM
    yeah, the way I manage that is keeping office for work and living room for non-work 😅
  • k

    kevins8

    02/13/2021, 12:55 AM
    @User so added both small and medium tasks. in case you did want to tackle medium tasks, the below are two good self contained ones to get started with 😉 - https://github.com/dendronhq/dendron/issues/381 - https://github.com/dendronhq/dendron/issues/446
  • h

    hikchoi

    02/13/2021, 2:40 AM
    will check out 👍
  • h

    hikchoi

    02/13/2021, 3:30 PM
    got most of https://github.com/dendronhq/dendron/issues/446 working. can't decide if we should trigger frontmatter folding on every activeEditor change or not. sometimes you want to have it unfolded, but if you move out of that note and come back it will close again. options I've thought of: 1. add a command to somehow flag note to ignore folding 2. only fold on open (I don't see anything that listens to new files being opened though. does vscode have it built in?) 3. behave differently based on length of content (as #446 mentioned the case of having more fm than note content) thoughts?
  • h

    hikchoi

    02/13/2021, 3:31 PM
    will finish this up tomorrow.
  • h

    hikchoi

    02/13/2021, 3:42 PM
    also, unrelated but do you have plans for documentation generation? not sure what's widely used in the typescript ecosystem but a quick search gave me https://typedoc.org/ not really looking for documentation generation per-se, but some kind of convention for commenting my code. would be nice to format it so that later on if we want to generate docs, we don't have to go back and fix them.
  • h

    hikchoi

    02/13/2021, 3:44 PM
    okay, I just found out about https://tsdoc.org/ 😄 I guess that's standard.
  • k

    kevins8

    02/13/2021, 4:15 PM
    I think the default for
    foldOnOpen
    is fine for now:
    window.onDidChangeActiveTextEditor
    That plus a flag to ignore folding.
  • k

    kevins8

    02/13/2021, 4:15 PM
    As for documentation, we don't but that would be a great next task. going with tsdoc/typedoc makes sense 🙂
  • h

    hikchoi

    02/14/2021, 1:35 AM
    I'll have to read up on how those are set up, but I'll start adding tsdoc formatted comments for things I work on.
  • h

    hikchoi

    02/14/2021, 1:38 AM
    ah, great. would the flag be part of
    DNodePropsV2
    ?
  • h

    hikchoi

    02/14/2021, 1:41 AM
    I was wondering if we should preserve selection on the active editor after folding the frontmatter or just set the cursor to be at the end of the file but I don't need to worry about that if we go for fold on open 😄
  • h

    hikchoi

    02/14/2021, 1:41 AM
    unless selection is preserved when a file is closed.
  • h

    hikchoi

    02/14/2021, 2:03 AM
    wait. do you mean we should trigger the folding behavior on every active editor change? e.g. do you mean: 1. note
    a.md
    and
    b.md
    is open. both have frontmatter unfolded. current active editor is
    a.md
    2. switch over to
    b.md
    . `b.md`'s frontmatter should fold. 3.
    a.md
    is still open on vscode. switch over to
    a.md
    and the frontmatter should fold. what I meant by > 2. only fold on open was : 1. note
    a.md
    is not opened on vscode. 2. open
    a.md
    either by lookup or clicking it on the file explorer. 3. if the frontmatter is unfolded, fold it. this way we aren't triggering it on every active editor change, just when it first opens. front matter folding will stay how it is until it's closed. the user can unfold it if they want, and it it will stay unfolded until they close the tab and open it up again. so I was wondering if there was a watcher that watches for new tabs opening, not switching between already open tabs. (I currently have it so that the folding behavior triggers in
    windowWatcher
    after it triggers update decoration.)
  • h

    hikchoi

    02/14/2021, 2:10 AM
    like this : https://github.com/hikchoi/dendron/commit/8a037334cc4bedef0b62e993081accd4a7191ae0#diff-29a538b9d810bb97df8ace23a332b236bed5dab4624146aefced7919927ad611R37
  • k

    kevins8

    02/14/2021, 3:53 AM
    yeah, your right. folding on open makes more sense than whenever we switch focus 😅 there's a
    workspace.onDidOpenTextDocument: Event<TextDocument>
    event that we can hook into we can put that in here: https://github.com/dendronhq/dendron/blob/master/packages/plugin-core/src/WorkspaceWatcher.ts#L20:L20
  • k

    kevins8

    02/14/2021, 3:53 AM
    also, since you brought up tsdoc, i'm going to go ahead and add tsdoc to all new code as well 🙂
  • h

    hikchoi

    02/14/2021, 4:10 AM
    Awesome. I gotta run around and do some stuff but will get back to folding later tonight.
  • h

    hikchoi

    02/14/2021, 1:29 PM
    hmm. there's a little gap between when
    onDidOpenTextDocument
    fires and the
    activeTextEditor
    changes to the opened file. Gotta find a way to wait for the
    activeTextEditor
    to be set to the opened file without arbitrarily sleeping 🤔
  • h

    hikchoi

    02/14/2021, 2:24 PM
    eh...
    setTimeout
    works good enough 🤷‍♂️
  • h

    hikchoi

    02/14/2021, 2:34 PM
    worse: sometimes opening a note that wasn't previously opened fires
    onDidChangeActiveTextEditor
    instead of
    onDidOpenTextDocument
    😄 more head scratching tomorrow.
  • k

    kevins8

    02/14/2021, 4:41 PM
    so i checked the api for the workbench method.
    The event is emitted before the document is updated in the active text editor
    . it is also not emitted if the document was already open i think
    onDidChangeActiveTextEditor
    always fires. this might require more digging into vscode api. one thing we could do for now is split up the folding provider functionality from automatic folding.
  • h

    hikchoi

    02/14/2021, 9:05 PM
    yeah that might be a more sensible option 😄
1...495051...108Latest