Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ cooklang-find = { version = "0.5.0" }
cooklang-import = "0.8.7"
cooklang-sync-client = { version = "0.4.8", optional = true }
libsqlite3-sys = { version = "0.35", features = ["bundled"], optional = true }
cooklang-language-server = "0.2.0"
cooklang-language-server = "0.2.1"
cooklang-reports = { version = "0.2.2" }
directories = "6"
fluent = "0.16"
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CookCLI

A command-line interface for managing and working with Cooklang recipes.
CookCLI is a free, open-source command-line tool for working with [Cooklang](https://cooklang.org/docs/spec/) recipe files. It parses `.cook` files, generates combined shopping lists from multiple recipes, runs a local web server to browse your collection, imports recipes from websites, and scales servings — all from the terminal.

## Commands

Expand Down
12 changes: 9 additions & 3 deletions static/js/src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ async function cooklangCompletions(context) {
const textBefore = line.text.slice(0, pos - line.from);

// Check for trigger characters (@, #, ~)
const match = textBefore.match(/[@#~]([a-zA-Z0-9_]*)$/);
// Include . / - in character class so @./path file references trigger completion
const match = textBefore.match(/[@#~]([a-zA-Z0-9_./\-]*)$/);
if (!match) return null;

const prefix = match[1];
Expand All @@ -53,9 +54,14 @@ async function cooklangCompletions(context) {

return {
from: from,
// Keep completion open while user types path chars; CodeMirror's
// built-in FuzzyMatcher handles client-side narrowing.
validFor: /^[a-zA-Z0-9_./\-]*$/,
options: items.map(item => {
const type = item.kind === 6 ? 'variable' : item.kind === 14 ? 'keyword' : 'text';
const text = item.insertText || item.label;
const type = item.kind === 17 ? 'file' : item.kind === 6 ? 'variable' : item.kind === 14 ? 'keyword' : 'text';
// Prefer textEdit.newText (used by recipe references with explicit ranges),
// then insertText, then label
const text = item.textEdit?.newText || item.insertText || item.label;

// Check if LSP sent a snippet (insertTextFormat === 2)
if (item.insertTextFormat === 2 && text.includes('$')) {
Expand Down
Loading