Skip to content
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

Menu needs to be aware of what is going on inside current active workbench #991

Closed
gianugo opened this issue Dec 3, 2015 · 9 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders menus Menu items and widget issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@gianugo
Copy link

gianugo commented Dec 3, 2015

If the editor has no files open, choosing Find or Replace from the menu doesn't do anything and doesn't warn the user that this functionality requires an open file. A feedback to the user along the lines of "please open a file first" would point out the EBKAC more explicitly.

(as an aside, I tried doing that in the hope I could find a global, project-wide replace - since a global search is there, I was hoping a global replace would have been there)

@alexdima alexdima self-assigned this Dec 4, 2015
@egamma
Copy link
Member

egamma commented Dec 4, 2015

(as an aside, I tried doing that in the hope I could find a global, project-wide replace - since a global search is there, I was hoping a global replace would have been there)

Sorry not yet, but it is on our Roadmap.

@egamma egamma modified the milestone: Backlog Dec 10, 2015
@alexdima
Copy link
Member

alexdima commented Jan 9, 2016

@bpasero Some entries in the Edit menu should be disabled if no editor is open:

  • undo/redo
  • cut/copy/paste
  • select all, find/replace

@alexdima alexdima assigned bpasero and unassigned alexdima Jan 9, 2016
@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Jan 11, 2016
@bpasero bpasero changed the title Find/Replace menus fail silently if no files are open Some entries in the menu should be disabled when no editor is open Jan 11, 2016
@bpasero bpasero added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Apr 1, 2016
@bpasero
Copy link
Member

bpasero commented Apr 1, 2016

Marking as upstream for better menu API around enablement.

@bpasero bpasero added feature-request Request for new features or functionality workbench and removed bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Aug 31, 2016
@bpasero bpasero removed their assignment Aug 31, 2016
@bpasero
Copy link
Member

bpasero commented Jan 4, 2017

Also: the "Additional Views" entry under the view menu needs to update depending on the active window.

@bpasero bpasero changed the title Some entries in the menu should be disabled when no editor is open Menu needs to be aware of what is going on inside current active workbench Jan 4, 2017
@bpasero bpasero removed this from the Backlog milestone Nov 17, 2017
@sbatten sbatten added menus Menu items and widget issues and removed workbench-menu labels Oct 7, 2019
@sbatten sbatten self-assigned this Oct 25, 2019
@sbatten sbatten added this to the On Deck milestone Oct 25, 2019
@sbatten
Copy link
Member

sbatten commented Oct 25, 2019

@alexandrudima there were other issues before (though newer than this issue) that suggested even more fine-grained updating of menu items which were closed because the menu would have to be aware of too much. If the request is just whether or not an editor is open, we have that context key already. Is there something I should be concerned about just using that key for enablement?

@alexdima
Copy link
Member

@sbatten Please create a PR, I'm happy to review. When changing things in the editor, the only thing to be aware of is that we ship the editor standalone (outside of the workbench) and we should not assume workbench concepts in editor actions.

@sbatten sbatten modified the milestones: On Deck, October 2020 Oct 16, 2020
@sbatten
Copy link
Member

sbatten commented Oct 16, 2020

fix addresses the OP's example. since different commands require different level of granularity for context keys, they should be grouped according to interest and technical requirements. that is why, given the age of this issue, I have stopped at the OP's suggestion.

jmannanc pushed a commit to jmannanc/vscode that referenced this issue Oct 26, 2020
@sbatten sbatten added the verification-needed Verification of issue is requested label Oct 27, 2020
@rzhao271 rzhao271 added the verification-found Issue verification failed label Oct 27, 2020
@rzhao271
Copy link
Contributor

  1. Have VS Code open with no files open, try find/replace and get the warning message
  2. Open a single non-empty file
  3. The warning message is still there
  4. Do a search where there's a result in the opened file, and the search results show up properly
  5. Close that file and clear the search query, the warning message is gone even though no files are open now

I think it just has to do with file open/close events

@sbatten sbatten removed the verification-found Issue verification failed label Oct 27, 2020
@sbatten
Copy link
Member

sbatten commented Oct 27, 2020

this issue only deals with Find and Replace not Find in Files or Replace in Files

@rzhao271 rzhao271 added the verified Verification succeeded label Oct 28, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders menus Menu items and widget issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@egamma @bpasero @alexdima @gianugo @sbatten @rzhao271 and others