feat: location opened editor when open file #2853
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types
Background or solution
🤖 Generated by Copilot at bf53536
LOCATION
to locate a URI in the opened editors view (link)OPEN_EDITORS_COMMANDS
object and use theLOCATION
command in theEditorGroup
class (link)locationInTree
method in theopen
andopenToSide
methods of theEditorGroup
class (link, link)locationInTree
method to theEditorGroup
class to handle locating a URI in both the file tree and the opened editors view, depending on the options (link)locateInOpenedEditor
method to theEditorGroup
class to execute theLOCATION
command with a URI (link)disableNavigateOnOpendEditor
to theIResourceOpenOptions
interface to control whether to skip locating the URI in the opened editors view (link)LOCATION
command handler in theopened-editor.contribution.ts
file and call thelocation
method of theOpenedEditorModelService
with a URI (link, link)openResource
method of theOpenedEditorModelService
class to pass thedisableNavigateOnOpendEditor
option to theexecuteCommand
call (link)效果是点击 editor tab 后,opened editors 中文件同步选中状态 #2849
同时依赖 #2842 合并
Changelog
🤖 Generated by Copilot at bf53536
This pull request adds a new feature and a new command to locate a URI in the opened editors view. It also refactors some existing code to use a common method for locating a URI in different views. It introduces a new option to disable locating a URI in the opened editors view when opening a resource from the view itself. The affected files are
workbench-editor.service.ts
,opened-editor.contribution.ts
,common.command.ts
,editor.ts
, andopened-editor-model.service.ts
.