-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Description
Issue Type: Bug
I work on a team developing an extension that implements a FileSystemProvider and a DocumentSymbolProvider.
If the user opens file1 in preview mode (italic tab label), then used F12 when on a symbol defined in file2, this correctly loads file2 in the same tab. But the 'Back' option on the 'Go' menu doesn't get enabled.
I think it is caused by this code executing when file2 replaces file1 in the preview tab:
vscode/src/vs/workbench/services/history/browser/history.ts
Lines 508 to 512 in 0ea7e1c
| // Remove this from the stack unless the stack input is a resource | |
| // that can easily be restored even when the input gets disposed | |
| if (stackEditorInput instanceof EditorInput) { | |
| this.onEditorDispose(stackEditorInput, () => this.removeFromNavigationStack(stackEditorInput), this.editorStackListeners); | |
| } |
in combination with this logic which didn't turn the 'Go to Definition' history entry into one that points to a ResourceEditorInput because it only does that for a limited range of uri schemes:
vscode/src/vs/workbench/services/history/browser/history.ts
Lines 518 to 527 in 0ea7e1c
| private preferResourceEditorInput(input: IEditorInput): IEditorInput | IResourceEditorInput { | |
| const resource = EditorResourceAccessor.getOriginalUri(input); | |
| if (resource && (resource.scheme === Schemas.file || resource.scheme === Schemas.vscodeRemote || resource.scheme === Schemas.userData || resource.scheme === this.pathService.defaultUriScheme)) { | |
| // for now, only prefer well known schemes that we control to prevent | |
| // issues such as https://github.com/microsoft/vscode/issues/85204 | |
| return { resource }; | |
| } | |
| return input; | |
| } |
@bpasero is this your area?
I tried to devise a repro using fsprovider-sample by adding file2.ts to the workspace, exporting a function from it, then referencing it from file.ts. But the 'Initializing JS/TS language features' message never cleared, so I assume JS/TS language support can't handle files provided by the MemFS FileSystemProvider.
VS Code version: Code 1.50.1 (d2e414d, 2020-10-13T15:06:15.712Z)
OS version: Windows_NT x64 10.0.18363