Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

fix(regression): Basic single file support #254

Merged
merged 1 commit into from
Aug 19, 2023

Conversation

YDX-2147483647
Copy link
Contributor

@YDX-2147483647 YDX-2147483647 commented Aug 19, 2023

We can edit typst files (even with #import) without a workspace in v0.7, but cannot in v0.8 – v0.9.3. This PR gets the feature back.

If PackageManager tries to resolve a package and finds nothing (e.g. current is empty because there's no workspace), we create a temporary package from the file's parent directory.

(I've only tested it in VS Code)

This PR is implemented as a few or_else(…), so I guess it won't break any existing functions.

Question

Can CurrentPackageError::NotFound ever reach? Should we remove it?

@YDX-2147483647 YDX-2147483647 marked this pull request as draft August 19, 2023 10:25
If `PackageManager` tries to resolve a package and finds nothing (e.g. `current` is empty because there's no workspace), we create a temporary package from the file's parent directory.

Resolves: nvarner#232
@YDX-2147483647 YDX-2147483647 marked this pull request as ready for review August 19, 2023 10:26
@nvarner
Copy link
Owner

nvarner commented Aug 19, 2023

This looks like the right fix for now. If I have time, I'll go back to do some cleanup and decide what to do with CurrentPackageError::NotFound, since I think you're right that it's now unused. However, I believe this fix is correct, and I'll try to get it in a release very soon. Thank you for debugging and patching this!

@nvarner nvarner merged commit e7abf09 into nvarner:master Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unusable after update
2 participants