Closed lexaknyazev closed 6 years ago
Thanks @lexaknyazev.
@najadojo When time permits can you take a look?
I haven't spent much time looking at the Draco extension yet but I assume I could create the same data view that I can with the core vertex buffers. I'll look into making such a modification.
So @lexaknyazev... Now that this fix is in master (not published yet)... When do we get Draco support in the validator? 😁
Version 2.1.7 is now published.
Go to Definition on indices
or attributes within KHR_draco_mesh_compression
yields
ERROR: Can no longer find document in editor:
path
This is working for me after updating to the released build... can you provide more explicit repro steps? I've found that VSCode sometimes closes the original document (when it shows the name in italics) and this messes up the processing we do to do the navigation.
1.21.1
, plugin 2.1.7
.glTF-Sample-Models\2.0\
).Avocado\glTF-Draco\Avocado.gltf
).indices
or any attribute. Tool-tip shows some numbers.indices
or any attribute. A new tab with error replaces the tab with the asset.Yeah, the italics are significant because they indicate the document is being previewed (not sure if that's the correct term) and not permanently open. When you "Go to Definition", if the definition resides in an external document, it opens that new document in italics/preview mode, which displaces any prior document opened in italics/preview mode.
So VSCode ends up opening our preview URI in italics and closing the main JSON glTF if it was in italics.
I don't think we can effectively prevent this behavior, but, we could possibly replace the "can no longer find document" message with a file-load of the old document's path. This would allow the preview data to appear. The old glTF would still get closed, but that's editor behavior for documents in italics when you jump to an external definition.
Could external navigation event switch opened file from preview mode to regular?
As far as I know, the closing behavior is out of our control, and is intentional (for example when you use "Go to definition" multiple times in a row to jump from one file to the next, none of the intermediate files remain open). I'm curious if @najadojo knows more or has contacts that we should reach out to on this. But my thinking is we're kind of stuck with it.
The good news is, if a user makes any modifications to one of these name-in-italics documents, it immediately becomes a normal permanent document, so is not subject to auto-closing like this.
I have a fix for this issue; if the document isn't an open editor then read in the file directly.
Version 2.1.8 is published.
This check https://github.com/AnalyticalGraphicsInc/gltf-vscode/blob/e5ce897cff6d77c069e3202248a1fbffe2b4f334/server/src/server.ts#L432-L434 isn't precise enough so it leads to
These indices are Draco's internal pointers.