https://www.dendron.so/ logo
Join DiscordCommunities
Powered by
# dev
  • k

    kevins8

    08/28/2020, 4:16 PM
    > > I'm having some hard times with the lookup; initially I wasn't able to get it working properly, then with some tweaking of schemas it started to work. Now with some drastic schema changes it stopped working again, so decided to remove all schemas to see if it would be able to find just the plain note hierarchy. Currently with no schemas and ~50 notes with dot separated names, the lookup only shows the "root nodes", but loses even them when trying to type something into it. > @User > > sounds like you started diving into the guts of dendron. there's currently a few errors i've been meaning to fix that will show up when you try to build but shouldn't stop compilation. will do a sweep and fix those today > > as for your issue with lookup, that's interesting. the tree view and lookup share a common index so if the treeview is finding it, the whats happening is UI related. > >
    LookupProvider
    is responsible for integrating the lookup results with the engine. the specific code is here: https://github.com/dendronhq/dendron/blob/master/packages/plugin-core/src/components/lookup/LookupProvider.ts#L285
  • j

    jojanaho

    08/28/2020, 4:18 PM
    @User yup, traced the bug there; any tips how to get the execution breaking inside engine.query (called by
    const resp = await engine.query(querystring, opts.flavor);
    )
  • j

    jojanaho

    08/28/2020, 4:18 PM
    looks like I only get disabled breakpoints there
  • k

    kevins8

    08/28/2020, 4:19 PM
    i think there is a way to do this properly with source maps and vscode. because its in a separate lerna package, i've been putting a
    debugger;
    statement inside the
    engine.query
    . this will cause vscode to break inside the compiled
    .js
    code
  • k

    kevins8

    08/28/2020, 4:20 PM
    have a todo for getting debugger working across mono-repo in vscode šŸ˜…
  • k

    kevins8

    08/28/2020, 4:21 PM
    fyi, also happy to debug this alongside on my end. if you do a
    ls -l | awk '{print $9}'
    , i can re-create the file names and try to repro the issue
  • j

    jojanaho

    08/28/2020, 4:29 PM
    sure, here's an output from tree:
    Copy code
    .
    ā”œā”€ā”€ dendron.code-workspace
    ā”œā”€ā”€ docs
    │   ā”œā”€ā”€ assets
    │   │   └── images
    │   │       ā”œā”€ā”€ logo-banner.png
    │   │       └── logo.png
    │   ā”œā”€ā”€ _config.yml
    │   ā”œā”€ā”€ favicon.ico
    │   └── Gemfile
    └── vault
        ā”œā”€ā”€ journal.2020.08.01.md
        ā”œā”€ā”€ journal.2020.08.28.md
        ā”œā”€ā”€ journal.2020.08.md
        ā”œā”€ā”€ journal.2020.09.md
        ā”œā”€ā”€ journal.2020.md
        ā”œā”€ā”€ journal.2020.w.22.md
        ā”œā”€ā”€ journal.md
        ā”œā”€ā”€ journal.template.daily.md
        ā”œā”€ā”€ journal.template.weekly.md
        ā”œā”€ā”€ journal.template.yearly.md
        ā”œā”€ā”€ journal.weekly.md
        ā”œā”€ā”€ pro.md
        ā”œā”€ā”€ root.md
        └── .vscode
            └── dendron.code-snippets
  • j

    jojanaho

    08/28/2020, 4:29 PM
    now I try to get the lookup to work without any schema in place
  • j

    jojanaho

    08/28/2020, 4:32 PM
    If I press CTRL+L in journal.md, it shows only
    journal
    . If i add dot to it (
    journal.
    ), only thing I see is "Create New"
  • j

    jojanaho

    08/28/2020, 4:34 PM
    hmm, I deleted some of the notes still, and now it started to work
  • j

    jojanaho

    08/28/2020, 4:34 PM
    narrowing it down
  • j

    jojanaho

    08/28/2020, 4:37 PM
    okay, looks like I might have found the culprit (?)
  • j

    jojanaho

    08/28/2020, 4:37 PM
    if yaml frontmatter with the following title attribute it breaks,
    title: 2020-08-01
  • j

    jojanaho

    08/28/2020, 4:38 PM
    maybe the code interpret that as a date and ends up crisis šŸ™‚
  • j

    jojanaho

    08/28/2020, 4:38 PM
    anyway, need to leave for a while
  • k

    kevins8

    08/28/2020, 4:38 PM
    > If I press CTRL+L in journal.md, it shows only journal this is expected behavior. in order to keep lookup fast, we try to not do an
    engine.query
    unless we have to. when you first start a lookup, we search for everything under the current hierarchy. https://github.com/dendronhq/dendron/blob/master/packages/plugin-core/src/components/lookup/LookupProvider.ts#L295:L295 so
    journal -> ""
    ,
    journal.foo -> journal.*
    the reason you're not seeing anything for journal is that we also have a special case for
    ""
    where we only show you the 1st level results to not overwhelm you if you're at the root https://github.com/dendronhq/dendron/blob/master/packages/plugin-core/src/components/lookup/LookupProvider.ts#L316:L316
  • k

    kevins8

    08/28/2020, 4:39 PM
    will look into the yaml frontmatter. that part is still a little brittle right now
  • k

    kevins8

    08/28/2020, 5:04 PM
    @User found the issue. we use
    gray-matter
    to parse md frontmatter and by default, it will parse unquoted dates as a time stamp. we use
    fuse.js
    to search doc frontmatter and its not happy when it finds said timestamp https://github.com/jonschlinkert/gray-matter/issues/62
  • k

    kevins8

    08/28/2020, 5:05 PM
    will be pushing out a fix to this in today's update. thanks for doing the detective work!
  • j

    jojanaho

    08/28/2020, 6:27 PM
    Perfect! Glad to help 😊
  • k

    kevins8

    08/28/2020, 6:44 PM
    okay, just pushed and deployed the fix in v0.8.12 šŸ™‚ thanks again for digging into this!
  • j

    jojanaho

    08/28/2020, 8:17 PM
    > this is expected behavior. in order to keep lookup fast, we try to not do an
    engine.query
    unless we have to. when you first start a lookup, we search for everything under the current hierarchy. @User : Have you considered using LSP (Language Server Protocol) for dendron? This would delegate all the heavy lifting and caching into separate process, keeping everything snappy in the UI; basically the workspace could be loaded (and the related index constructed) e.g. when a dendron vault have been found from the workspace.
  • k

    kevins8

    08/28/2020, 8:19 PM
    absolutely and long term that's what I want to switch to. this would also make it easier to share dendron's engine between its bundled extension (markdown links, notes, etc). planning on doing an engine overhaul in late september/october
  • k

    kevins8

    08/28/2020, 8:21 PM
    an lsp will also make it much easier for others to use the dendron engine and build on top of it šŸ™‚
  • j

    jojanaho

    08/28/2020, 8:24 PM
    sounds good!
  • k

    kevins8

    08/28/2020, 10:39 PM
    so still working on fleshing out the dev documentation but there's now a foundation here to help get started: https://www.dendron.so/notes/3489b652-cd0e-4ac8-a734-08094dc043eb.html the repo for the documentation is the same that generates the dendron home page and can be found here: https://github.com/dendronhq/dendron-template contributions welcome šŸ˜‰
  • u

    user

    08/30/2020, 4:01 AM
    Btw, I made a pull request to dendron-template to fix some keyboard shortcuts info that differed from actual shortcuts in my fresh install. I don't have much github experience so l'm not really sure how this is supposed to go).
  • i

    imalightbulb

    08/30/2020, 4:02 AM
    What do mean "different from actual shortcuts in my fresh install"?
  • i

    imalightbulb

    08/30/2020, 4:02 AM
    You can configure custom hotkeys in vsc
  • k

    kevins8

    08/30/2020, 4:03 AM
    > > Btw, I made a pull request to dendron-template to fix some keyboard shortcuts info that differed from actual shortcuts in my fresh install. > I don't have much github experience so l'm not really sure how this is supposed to go). > @User saw it and have merged it. your changes are now live in the updated dendron docs. thanks for the pull request šŸ™‚
12345...108Latest