From 4c99e66a6de9fb33eda416bbbd2c6f3d4496b919 Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Mon, 26 Feb 2024 12:53:36 -0400 Subject: [PATCH 1/5] Update README.md --- README.md | 70 ++++++++++++++++++++++++------------------------------- 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 6dcb98fc..1a29175e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # Markdown Oxide -Obsidian Language Server: Obsidian-flavored-markdown language server -Implementing obsidian PKM features (and possibly more) in the form of a language server allows us to use these features in our favorite text editors (neovim or vscode!) and reuse other lsp related plugins (like Telescope, outline, and builtin lsp support) -## Testing + +Implementing obsidian PKM features (and possibly more) in the form of a language server allows us to use these features in our favorite text editors and reuse other lsp related plugins (like Telescope, outline, refactoring tools, ...) + +## Usage First, compile the plugin. Clone the repo and then run `cargo build --release` @@ -70,53 +71,50 @@ NOTE: To get references on files, you must place your cursor/pointer on the firs ## Features -- [ ] Go to definition (or definitions) from ... - - [X] File references - - [X] Heading references - - [X] Indexed block references. (I call indexed blocks the blocks that you directly link to. The link will look like [[file#^index]]. When linking from the obsidian editor, an *index* ^index is appended to the paragraph/block you are referencing) - - [X] Tags: This will get the locations where the tag is placed; it will give all the locations where the #tag/subtag is written. This is different than the functionality of the reference, which will get all tag and subtag usages: references on #tag will give #tag, #tag/subtag, #tag/sub/subtag ... - - [X] Footnotes +- Go to definition (or definitions) from ... + - [X] File references [[file]] + - [X] Heading references [[file#heading]] + - [X] Block references. [[file#^index]] (I call indexed blocks the blocks that you directly link to. The link will look like [[file#^index]]. When linking from the obsidian editor, an *index* ^index is appended to the paragraph/block you are referencing) + - [X] Tags #tag and #tag/subtag/.. + - [X] Footnotes: "paraphrased text[^footnoteindex]" - [ ] Metadata tag -- [ ] Get references - - [X] To file - - [X] to heading - - [X] to indexed block - - [X] to tag (explained above) - - [X] Footnotes - - [ ] Metadata tag -- [ ] Completions - - [X] File completions (requires extra nvim cmp configuration) - - [X] Heading Completions (requires extra nvim cmp config) - - [X] Established Indexed block completions. - - [X] Footnotes - - [X] New Block Completions: to use this, type `[[ `, and after you press space, completions for every block in the vault will appear; continue typing to fuzzy match the block that you want; finally, select the block; a link will be inserter to the text document and an index (ex ^1j239) will be appended to the block in its respective file - - [ ] Create file completions - - [ ] Make file completions faster in NvimCmp (this is mostly a neovim issue as moxide generates very many completions for large vaults) - - [ ] Callout completions +- Get references + - [X] For File when cursor is on the first character of the first line of the file. This will produce references not only to the file but also to headings and blocks in the file + - [X] For block when the cursor is on the blocks index "...text *^index*" + - [X] For tag when the cursor is on the tags declaration. Unlike go to definition for tags, this will produce all references to the tag and to the tag with subtags + - [X] Footnotes when the cursor is on the declaration line of the footnote; *[^1]: description...* +- Completions (requires extra nvim cmp config; follow the directions above) + - [X] File link completions + - [X] Heading link Completions + - [X] Block link completions (searches the text of the block) + - [X] Footnote link completions + - [X] New Block link Completions through grep: to use this, type `[[ `, and after you press space, completions for every block in the vault will appear; continue typing to fuzzy match the block that you want; finally, select the block; a link will be inserter to the text document and an index (ex ^1j239) will be appended to the block in its respective file + - [ ] Callout/admonition completions - [ ] Metadata completions - - [ ] Dataview? - - [ ] Metadata tag - - [ ] \`\`\`query\`\`\` code blocks -- [X] Preview + - [ ] Dataview completions + - [ ] Metadata tag completions + - [ ] \`\`\`query\`\`\` code block completions +- Hover Preview - [X] File - [X] Headings - [X] Indexed Blocks - [X] Footnotes - [ ] Code Actions - - [x] Missing file for link -> Create the file + - [x] Unresolved file link -> Create the file + - [x] Unresolved heading link -> append heading to file and create file - [ ] Link suggestions (by text match or other) - [ ] Refactoring: Move headers or selections to a new file - [ ] Link an unlinked reference - [ ] Link all unlinked references to a referenceable - [X] Diagnostics - - [X] Missing reference + - [X] Unresolved reference - [ ] Unlinked reference - [X] Symbols - [X] File symbols: Headings and subheadings - [X] Workspace headings: everythign linkable: files, headings, tags, ... Like a good search feature - [ ] Lists and indented lists - [ ] Rename - - [X] File + - [X] File (cursor must be in the first character of the first line) - [X] Headings - [X] Tags - [ ] Indexed Blocks @@ -128,14 +126,6 @@ NOTE: To get references on files, you must place your cursor/pointer on the firs - [ ] Support https://docs.logseq.com/#/page/markdown - [ ] Influence from logseq shortcut completions; such as to dates like /tomorrow - - -### Dev Todo's - -- [X] Extract the RwLock read pattern -- [ ] Fix: update vault (diagnostics and references) after code action -- [ ] Caching: As of right now, the completions really don't need to be recalcualted; there are many other functions like this - # Alternatives **I love open source and all open source authors!! I also believe healthy competition is good! Moxide is competing with some alternatives, and I want to make it the best at its job!!** From ce21582a9cffc83db35fb80dc6e149d286aeb2eb Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Mon, 26 Feb 2024 12:13:49 -0500 Subject: [PATCH 2/5] Update README.md --- README.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/README.md b/README.md index 1a29175e..5b241deb 100644 --- a/README.md +++ b/README.md @@ -136,20 +136,7 @@ Here are the alternatives (open source authors are welcom to make PRs adding the - https://github.com/WhiskeyJack96/logseqlsp ; This is a cool project and a great inspiration for logseq support (which is upcoming). status: it doesn't seem that it is maintained; no commites for 3 months - The og https://github.com/artempyanykh/marksman ; I used this for a while, but it is not obsidian specific and didn't act well w my vault -# Workflows - -- Linking to daily notes in the future to set todos; checking references to those notes using the language server - -# Obsidian Graph Flexing (and maybe a little exigence for the project) - -This is my vault. As you can see, there is a lot of stuff in it. Along with notes, I also like speed. Obsidian, logseq, and other language servers are a little slow with my vault (and a little high latency in general). I need speed; Neovim and this LSP CMPs my needs! (I am using this daily, right now even). - -![image](https://github.com/Feel-ix-343/moxide/assets/88951499/3de26de6-1113-469f-8807-40dd6c2e1e03) - -![image](https://github.com/Feel-ix-343/moxide/assets/88951499/9204ebf9-f927-4f1e-8563-12e79099debd) - - # ---The--bottom--line-------------------------------------------------------- -Listen. I really like vim motions. I also really like low latency terminal editing. I very much so also like my neovim plugins and config. And wow I also like using obsidian (and other md apps). Can't I just have it all??? Can't I brute text edit in neovim and preview and fine edit in the JS madness? Well, I thought I could; that is why I am making this. (And hopefully why you might help me!) +Listen. I really like vim motions. I also really like low latency terminal editing. I very much so also like my neovim plugins and config. And wow I also like using obsidian (and other md apps). Can't I just have it all??? Can't I brute text edit in neovim and preview and fine edit in the JS madness? Well, I thought I could; that is why I am making this. From 93edf4696895ddbb71fc631523138be88b53bf85 Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Mon, 26 Feb 2024 13:04:59 -0500 Subject: [PATCH 3/5] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5b241deb..31bf4495 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,12 @@ vim.api.nvim_exec_autocmds('User', { pattern = 'LspAttached' }) NOTE: To get references on files, you must place your cursor/pointer on the first character of the first line of the file, and then get references. (In VSCode, you can also use the references code lens) +## Note on Linking Syntax + +The linking syntax is that of obsidian's and can be found here https://help.obsidian.md/Linking+notes+and+files/Internal+links + +Generally, this is [[relativeFilePath(#heading)?(|display text|)?]] e.g. [[articles/markdown oxide#Features|Markdown Oxide Features]] to link to a heading in `Markdown Oxide.md` file in the `articles` folder or [[Obsidian]] for the `Obsidian.md` file in the root folder. + ## Features - Go to definition (or definitions) from ... From 9c4970eaeee36996bceb9aa9af4661eafbb422f6 Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Mon, 26 Feb 2024 13:07:07 -0500 Subject: [PATCH 4/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 31bf4495..e53bfbd4 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Generally, this is [[relativeFilePath(#heading)?(|display text|)?]] e.g. [[artic - Completions (requires extra nvim cmp config; follow the directions above) - [X] File link completions - [X] Heading link Completions + - [ ] Subheading compeltions in the form [[file#heading#subheading]] from https://help.obsidian.md/Linking+notes+and+files/Internal+links#Link+to+a+heading+in+a+note (Note: right now you can link to subheadings through [[file#subheading]]) - [X] Block link completions (searches the text of the block) - [X] Footnote link completions - [X] New Block link Completions through grep: to use this, type `[[ `, and after you press space, completions for every block in the vault will appear; continue typing to fuzzy match the block that you want; finally, select the block; a link will be inserter to the text document and an index (ex ^1j239) will be appended to the block in its respective file From 3ea0b151377dfa976bed2be55c4baf2f3cc4a8e2 Mon Sep 17 00:00:00 2001 From: Felix Zeller Date: Mon, 26 Feb 2024 13:25:45 -0500 Subject: [PATCH 5/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e53bfbd4..b6d5a3c5 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ Implementing obsidian PKM features (and possibly more) in the form of a language ## Usage +==I am trying to get this into package distributions right now!!! This should be easier soon== + First, compile the plugin. Clone the repo and then run `cargo build --release` Next, follow the directions for your editor