Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: resolve projects by lockDatabase #1142

Merged
merged 2 commits into from
Jan 20, 2025
Merged

feat: resolve projects by lockDatabase #1142

merged 2 commits into from
Jan 20, 2025

Conversation

Myriad-Dreamin
Copy link
Owner

@Myriad-Dreamin Myriad-Dreamin commented Jan 9, 2025

Although we have great multiple-files project support in VS Code, we still experiment a sample implementation in VS Code. The new mechanism is put behind a flag. It isn't enabled by default. You can also only use the lockDatabase in some specific workspaces.

  • the CLI or server will update the lock file if one invokes compile/preview commands via CLI or LSP.
  • the server will see the lock file to see what's the best main file to use:
    • If a file is depended by some unique main file recorded in the lock, the main file is used.
    • If a file is depended by multiple main files, the most recently recorded main file wins.
    • otherwise, the language server sets the main file to the file itself.

Even if there is no any editor-side (client-side) additional support, people should be able to tell such information to the language server by invoking CLI in terminal.

We might deprecate the pin/unpin commands if this solution receives positive voice after experiment.

@Myriad-Dreamin Myriad-Dreamin marked this pull request as draft January 20, 2025 03:08
@Myriad-Dreamin Myriad-Dreamin changed the title feat: introduce lockDatabase project resolution feat: resolve projects by lockDatabase Jan 20, 2025
@Myriad-Dreamin Myriad-Dreamin marked this pull request as ready for review January 20, 2025 06:39
@Myriad-Dreamin Myriad-Dreamin merged commit 6d1e40d into main Jan 20, 2025
13 checks passed
@Myriad-Dreamin Myriad-Dreamin deleted the project-history branch January 20, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant