* Added FOAM_CURRENT_DIR template variable
* Added /research-issue Claude command
* Added integration test to create note using FOAM_CURRENT_DIR
* Updated documentation
* fixed comment
* Fail FOAM_CURRENT_DIR resolution if no editor nor workspace is open
- Template objects
- Separation of template loading, processing and file creation
- Support both Markdown and JavaScript templates
- Somewhat secure VM sandbox for JavaScript template execution in trusted workspaces
- Main entry point for note creation is `create-note` command
- Maintain backward compatibility with existing API
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Added VS Code mock to turn e2e into unit/integration tests
* Provide fallback to editor directory when creating new note with relative path
* Added `clear` function to `FoamWorkspace`
* Fixed tests for dated notes by providing configuration defaults
* Using different workspace directory when resetting mock
* tweaked test suite configuration to manage vscode mock
* Tweaked test scripts to allow running specs in "unit" mode with mock vscode environment
* Marked spec files that can be run in unit mode
* Added testing documentation
* removed --stream flag
* updated @types/node to match engine's version
* Fixing open-resource tests
* extension descriptions now reflect .vscode dir
including that image pasting is now supported natively
* Markdown AiO is still recommended
---------
Co-authored-by: Daniel Carosone <dan@geek.com.au>
* Introduced FOAM_TITLE_SAFE, which is the FOAM_TITLE variable with all the invalid path characters replaced by '-'
* (out of scope) In notes explorer show item description only when name is different from note title
* Addresses #1184
Currently tag completion only works in the front matter if you type a `#`
character. Adding the suggested tag will then mark the tag as a comment
```markdown
---
tags: #foo #bar
---
```
Update the tag completion provider to recognize if we are in the
front-matter, by using adding two functions to utils.ts. Because the
tag completion intellisense must be summoned with either the `#`
character or the keybinding (typically `ctrl+space`), allow
for 2 outcomes
1. if the tag is prefixed in the front matter with a `#`, remove it when
substituting the tag.
2. If `ctrl-space` is used, recognize we are on the `tags: ` line and
allow for non-`#` prefaced words.
The tag provider only works on the `tags: ` within the `tags: ` key of
the frontmatter. For example
```markdown
---
title: A title
tags:
- foo
- bar
- |
```
(where `|` is the cursor) will provide suggestions for tags.
Outside the `tags:` element, suggestions will not be provided.
```markdown
---
title: A title
tags:
- foo
- bar
dates:
- 2023-01-1
- |
```
* Refactor into functions for front matter & content
Refactor the main provider method into two
sub-functions, one for front matter, one for
regular content. Add helper functions to generate
the `CompletionItems` and to find the start & end
indices of the last match to `#{tag}`.