Skip to content

Conversation

@kristof-mattei
Copy link
Contributor

@kristof-mattei kristof-mattei commented Nov 30, 2025

I validated all usages of "builtin in the lsp crate, but all occurrences found are actually referring standard slint components.

Now trying to get the whole thing to work together in the VS Code development environment.

@CLAassistant
Copy link

CLAassistant commented Nov 30, 2025

CLA assistant check
All committers have signed the CLA.

I validated all usages of `"builtin` in the `lsp` crate, but
all occurrences found are actually referring standard slint components
@kristof-mattei
Copy link
Contributor Author

Update: this fix actually does the job:

image

This is taken from a project opened within WSL. Marking as ready for review.

Closes

@kristof-mattei kristof-mattei marked this pull request as ready for review November 30, 2025 01:49
@ogoffart
Copy link
Member

Thanks a lot for this patch!
This fixes #8089 , right?

IMHO all URLS should go transparently through the compiler, without needing to single out some schemas. I don't remember exactly why we use the path, i think it's so that the compiler can open itself the import from the file system.

Anyway, I think this is good for now as it solves this immediate problem.

@kristof-mattei
Copy link
Contributor Author

@ogoffart yes, it should fix #8089

@kristof-mattei
Copy link
Contributor Author

Reading through the codebase I think builtin is used to disambiguate between files on the filesystem and files in slint's builtin components.

match path.strip_prefix("builtin:/") {

And the Path is mapped to a Url because then there is first-class support for schemes.

slint/tools/lsp/common.rs

Lines 130 to 136 in fb15b42

pub fn file_to_uri(path: &Path) -> Option<Url> {
if ["builtin:/", "vscode-remote:/"].iter().any(|prefix| path.starts_with(prefix)) {
Url::parse(path.to_str()?).ok()
} else {
Url::from_file_path(path).ok()
}
}

can be reduced to just Url::parse but then ANY url is valid, whereas here the only valid schemes are builtin or vscode-remote, or it's a filepath.

@ogoffart ogoffart merged commit 16b6101 into slint-ui:master Dec 1, 2025
41 checks passed
burhankhanzada pushed a commit to burhankhanzada/slint that referenced this pull request Dec 8, 2025
I validated all usages of `"builtin` in the `lsp` crate, but
all occurrences found are actually referring standard slint components

Fixes slint-ui#8089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants