Skip to content

Commit

Permalink
fix: autocomplete on windows (#27)
Browse files Browse the repository at this point in the history
Autocomplete on Windows didn't work due to improper path handling.
  • Loading branch information
Cubxity authored Aug 21, 2023
1 parent c33a27b commit 2e008a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src-tauri/src/ipc/commands/typst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pub async fn typst_autocomplete<R: Runtime>(
offset: usize,
explicit: bool,
) -> Result<TypstCompleteResponse> {
let (project, path) = project_path(&window, &project_manager, path)?;
let project = project(&window, &project_manager)?;
let mut world = project.world.lock().unwrap();

let offset = content
Expand Down
2 changes: 1 addition & 1 deletion src/lib/editor/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class TypstCompletionProvider implements languages.CompletionItemProvider
): Promise<languages.CompletionList> {
console.log("completing", position, context);
const { offset: completionOffset, completions } = await autocomplete(
model.uri.path.substring(1),
model.uri.path,
model.getValue(),
model.getOffsetAt(position),
context.triggerKind === CompletionTriggerKind.Invoke
Expand Down

0 comments on commit 2e008a6

Please sign in to comment.