-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Scheme for handling virtual documents #49069
Comments
@octref I don't understand that |
@jrieken I'm suggesting having a |
@octref What would But it wouldn't match schemes provides by custom |
Yes. From language server's perspectives if they declare themselves as able to handle For example, the Intelephense extension creates virtual html files out of the PHP files on disk, and call VS Code command
Yep files backed by custom FileSystemProviders still have a fs behind it. Just need to make extension author aware to always use that provider instead of Node's fs. |
The problem with that is that there can only one provider per scheme (one truth) and I don't understand who that should be. In other words, you cannot be a document provider anymore but we need to invent another indirection. TBH, this looks like a dependency between Intelephense and the Html/CSS extension (without explicitly being declared). IMO if we want to constrain Html/CSS to certain schemes then we should have a reasonable default and the Html/CSS extension needs to export API that allows to manage those schemes, e.g. Intelephense calls a function that Html/CSS exports |
One of the main points for virtual documents is to avoid extension dependencies. That allows users to replace our html/css/json extensions. Also the problem is that many more language extensions that are similar to html/css/json would need such an API. If we want to store meta information for schemes, that could be added to the file system provider or the document providers. What would that information be? 'If you are a language provider, exclude my resources because I guarantee that someone cares for it'? |
I understand, but do we have samples/scenarios for both statements? Otherwise I'd suggest to start simple before bringing out the bigger hammer. Also when did the virtual document renaissance start? Didn't we conclude that it's best to integrate via libraries because its impossible to simply embed a language, e.g. TypeScript with imports embedded inside my new-super-language?
If we do that then this issue resolves itself, right? Isn't the point of Intelephense creating virtual documents that they are not private to the html/css/json extension? |
We have scenarios and samples. They are all spread in various issues so #47288 is about bringing them together and them to the doc/wiki. I suggest to close this issue as we already established that having a well known 'virtual' scheme isn't possible as @jrieken explained in #49069 (comment). I brought up the 'private' flag as I assume @octref main motivation of the proposal was to find a solution for liveshare. I suggest we better continue the brainstoring and discussion of for a better solution in our liveshare channel. @octref ok to close? |
In #48777, we attempted to limit HTML/CSS extensions to only handling
file
anduntitled
schemes. However, this breaks embedded HTML/CSS completions and other language features in Intelephense. It is reverted for release.Intelephense creates a virtual HTML document and runs command
vscode.executeCompletionItemProvider
to get list of completions from HTML language server (which includes CSS/JS embedded in HTML).We should find a way to let languages mark themselves able to handle virtual documents.
The text was updated successfully, but these errors were encountered: