diff --git a/.github/CODENOTIFY b/.github/CODENOTIFY index eaf90f0dd1afd..3091e0050f047 100644 --- a/.github/CODENOTIFY +++ b/.github/CODENOTIFY @@ -41,8 +41,8 @@ src/vs/platform/secrets/** @TylerLeonhardt src/vs/platform/sharedProcess/** @bpasero src/vs/platform/state/** @bpasero src/vs/platform/storage/** @bpasero -src/vs/platform/terminal/electron-main/** @Tyriar -src/vs/platform/terminal/node/** @Tyriar +src/vs/platform/terminal/electron-main/** @anthonykim1 +src/vs/platform/terminal/node/** @anthonykim1 src/vs/platform/utilityProcess/** @bpasero src/vs/platform/window/** @bpasero src/vs/platform/windows/** @bpasero diff --git a/.github/classifier.json b/.github/classifier.json index 32b6880011395..39ebd9e38b222 100644 --- a/.github/classifier.json +++ b/.github/classifier.json @@ -16,7 +16,7 @@ "bracket-pair-guides": {"assign": ["hediet"]}, "breadcrumbs": {"assign": ["jrieken"]}, "callhierarchy": {"assign": ["jrieken"]}, - "chat-terminal": {"assign": ["Tyriar"]}, + "chat-terminal": {"assign": ["meganrogge"]}, "chat-terminal-output-monitor": {"assign": ["meganrogge"]}, "chrome-devtools": {"assign": ["deepak1556"]}, "cloud-changes": {"assign": ["joyceerhl"]}, @@ -228,18 +228,18 @@ "terminal-env-collection": {"assign": ["anthonykim1"]}, "terminal-external": {"assign": ["anthonykim1"]}, "terminal-find": {"assign": ["anthonykim1"]}, - "terminal-inline-chat": {"assign": ["Tyriar", "meganrogge"]}, - "terminal-input": {"assign": ["Tyriar"]}, + "terminal-inline-chat": {"assign": ["meganrogge"]}, + "terminal-input": {"assign": ["anthonykim1"]}, "terminal-layout": {"assign": ["anthonykim1"]}, - "terminal-ligatures": {"assign": ["Tyriar"]}, + "terminal-ligatures": {"assign": ["anthonykim1"]}, "terminal-links": {"assign": ["anthonykim1"]}, "terminal-local-echo": {"assign": ["anthonykim1"]}, - "terminal-parser": {"assign": ["Tyriar"]}, - "terminal-persistence": {"assign": ["Tyriar"]}, + "terminal-parser": {"assign": ["anthonykim1"]}, + "terminal-persistence": {"assign": ["anthonykim1"]}, "terminal-process": {"assign": ["anthonykim1"]}, "terminal-profiles": {"assign": ["meganrogge"]}, "terminal-quick-fix": {"assign": ["meganrogge"]}, - "terminal-rendering": {"assign": ["Tyriar"]}, + "terminal-rendering": {"assign": ["anthonykim1"]}, "terminal-shell-bash": {"assign": ["anthonykim1"]}, "terminal-shell-cmd": {"assign": ["anthonykim1"]}, "terminal-shell-fish": {"assign": ["anthonykim1"]}, @@ -283,7 +283,7 @@ "workbench-auxwindow": {"assign": ["bpasero"]}, "workbench-banner": {"assign": ["lszomoru", "sbatten"]}, "workbench-cli": {"assign": ["bpasero"]}, - "workbench-diagnostics": {"assign": ["Tyriar"]}, + "workbench-diagnostics": {"assign": ["rebornix"]}, "workbench-dnd": {"assign": ["bpasero"]}, "workbench-editor-grid": {"assign": ["benibenj"]}, "workbench-editor-groups": {"assign": ["bpasero"]}, @@ -293,7 +293,7 @@ "workbench-fonts": {"assign": []}, "workbench-history": {"assign": ["bpasero"]}, "workbench-hot-exit": {"assign": ["bpasero"]}, - "workbench-hover": {"assign": ["Tyriar", "benibenj"]}, + "workbench-hover": {"assign": ["benibenj"]}, "workbench-launch": {"assign": []}, "workbench-link": {"assign": []}, "workbench-multiroot": {"assign": ["bpasero"]}, diff --git a/.mailmap b/.mailmap index 4834393cff7ac..5bd99619330ac 100644 --- a/.mailmap +++ b/.mailmap @@ -1,4 +1,3 @@ -Daniel Imms Daniel Imms Raymond Zhao Tyler Leonhardt Tyler Leonhardt João Moreno João Moreno diff --git a/.vscode/notebooks/my-endgame.github-issues b/.vscode/notebooks/my-endgame.github-issues index b6e40685d5a6b..8ee3e6cbe3bb7 100644 --- a/.vscode/notebooks/my-endgame.github-issues +++ b/.vscode/notebooks/my-endgame.github-issues @@ -12,7 +12,7 @@ { "kind": 2, "language": "github-issues", - "value": "$NOT_TEAM_MEMBERS=-author:aeschli -author:alexdima -author:alexr00 -author:AmandaSilver -author:bamurtaugh -author:bpasero -author:chrmarti -author:Chuxel -author:claudiaregio -author:connor4312 -author:dbaeumer -author:deepak1556 -author:devinvalenciano -author:digitarald -author:DonJayamanne -author:egamma -author:fiveisprime -author:ntrogh -author:hediet -author:isidorn -author:joaomoreno -author:jrieken -author:kieferrm -author:lramos15 -author:lszomoru -author:meganrogge -author:mjbvz -author:rebornix -author:roblourens -author:rzhao271 -author:sandy081 -author:sbatten -author:stevencl -author:TylerLeonhardt -author:Tyriar -author:amunger -author:karthiknadig -author:eleanorjboyd -author:Yoyokrazy -author:ulugbekna -author:aiday-mar -author:bhavyaus -author:justschen -author:benibenj -author:luabud -author:anthonykim1 -author:joshspicer -author:osortega -author:hawkticehurst -author:pierceboggan -author:benvillalobos -author:dileepyavan -author:dmitrivMS -author:eli-w-king -author:jo-oikawa -author:jruales -author:jytjyt05 -author:kycutler -author:mrleemurray -author:pwang347 -author:vijayupadya -author:bryanchen-d -author:cwebster-99 -author:rwoll -author:lostintangent -author:jukasper -author:zhichli" + "value": "$NOT_TEAM_MEMBERS=-author:aeschli -author:alexdima -author:alexr00 -author:AmandaSilver -author:bamurtaugh -author:bpasero -author:chrmarti -author:Chuxel -author:claudiaregio -author:connor4312 -author:dbaeumer -author:deepak1556 -author:devinvalenciano -author:digitarald -author:DonJayamanne -author:egamma -author:fiveisprime -author:ntrogh -author:hediet -author:isidorn -author:joaomoreno -author:jrieken -author:kieferrm -author:lramos15 -author:lszomoru -author:meganrogge -author:mjbvz -author:rebornix -author:roblourens -author:rzhao271 -author:sandy081 -author:sbatten -author:stevencl -author:TylerLeonhardt -author:amunger -author:karthiknadig -author:eleanorjboyd -author:Yoyokrazy -author:ulugbekna -author:aiday-mar -author:bhavyaus -author:justschen -author:benibenj -author:luabud -author:anthonykim1 -author:joshspicer -author:osortega -author:hawkticehurst -author:pierceboggan -author:benvillalobos -author:dileepyavan -author:dmitrivMS -author:eli-w-king -author:jo-oikawa -author:jruales -author:jytjyt05 -author:kycutler -author:mrleemurray -author:pwang347 -author:vijayupadya -author:bryanchen-d -author:cwebster-99 -author:rwoll -author:lostintangent -author:jukasper -author:zhichli" }, { "kind": 1, diff --git a/.vscode/notebooks/verification.github-issues b/.vscode/notebooks/verification.github-issues index 1c7e9dc184378..84e36a975d52e 100644 --- a/.vscode/notebooks/verification.github-issues +++ b/.vscode/notebooks/verification.github-issues @@ -32,7 +32,7 @@ { "kind": 2, "language": "github-issues", - "value": "$repos $milestone is:closed reason:completed -assignee:@me label:bug -label:verified -label:*duplicate -author:@me -assignee:@me label:bug -label:verified -author:@me -author:aeschli -author:alexdima -author:alexr00 -author:bpasero -author:chrisdias -author:chrmarti -author:connor4312 -author:dbaeumer -author:deepak1556 -author:eamodio -author:egamma -author:gregvanl -author:isidorn -author:JacksonKearl -author:joaomoreno -author:jrieken -author:lramos15 -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:rebornix -author:RMacfarlane -author:roblourens -author:sana-ajani -author:sandy081 -author:sbatten -author:Tyriar -author:weinand -author:rzhao271 -author:kieferrm -author:TylerLeonhardt -author:bamurtaugh -author:hediet -author:joyceerhl -author:rchiodo" + "value": "$repos $milestone is:closed reason:completed -assignee:@me label:bug -label:verified -label:*duplicate -author:@me -assignee:@me label:bug -label:verified -author:@me -author:aeschli -author:alexdima -author:alexr00 -author:bpasero -author:chrisdias -author:chrmarti -author:connor4312 -author:dbaeumer -author:deepak1556 -author:eamodio -author:egamma -author:gregvanl -author:isidorn -author:JacksonKearl -author:joaomoreno -author:jrieken -author:lramos15 -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:rebornix -author:RMacfarlane -author:roblourens -author:sana-ajani -author:sandy081 -author:sbatten -author:weinand -author:rzhao271 -author:kieferrm -author:TylerLeonhardt -author:bamurtaugh -author:hediet -author:joyceerhl -author:rchiodo" }, { "kind": 1, diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 0922f4228cf68..c4883fd0ad036 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -524,6 +524,580 @@ Title to copyright in this work will at all times remain with copyright holders. --------------------------------------------------------- +dompurify 3.2.7 - Apache 2.0 +https://github.com/cure53/DOMPurify + +DOMPurify +Copyright 2025 Dr.-Ing. Mario Heiderich, Cure53 + +DOMPurify is free software; you can redistribute it and/or modify it under the +terms of either: + +a) the Apache License Version 2.0, or +b) the Mozilla Public License Version 2.0 + +----------------------------------------------------------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +----------------------------------------------------------------------------- +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. "Contribution" + + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. "Executable Form" + + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. "License" + + means this document. + +1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. "Modifications" + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible + With Secondary Licenses", as defined by + the Mozilla Public License, v. 2.0. +--------------------------------------------------------- + +--------------------------------------------------------- + dotenv-org/dotenv-vscode 0.26.0 - MIT License https://github.com/dotenv-org/dotenv-vscode diff --git a/cglicenses.json b/cglicenses.json index 48d2c3b093c9c..2793b7fe2d6be 100644 --- a/cglicenses.json +++ b/cglicenses.json @@ -209,21 +209,6 @@ "THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." ] }, - { - // Reason: Missing license file - "name": "readable-web-to-node-stream", - "fullLicenseText": [ - "(The MIT License)", - "", - "Copyright (c) 2019 Borewit", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - ] - }, { // Reason: The substack org has been deleted on GH "name": "concat-map", @@ -750,5 +735,64 @@ // Reason: mono-repo "name": "@jridgewell/trace-mapping", "fullLicenseTextUri": "https://raw.githubusercontent.com/jridgewell/sourcemaps/refs/heads/main/packages/trace-mapping/LICENSE" + }, + { + // Reason: License text from https://github.com/github/copilot-cli/blob/master/LICENSE.md + // does not include a copyright statement. + "name": "@github/copilot", + "prependLicenseText": [ + "Copyright (c) GitHub, Inc." + ] + }, + { + "name": "@github/copilot-darwin-arm64", + "prependLicenseText": [ + "Copyright (c) GitHub, Inc." + ] + }, + { + "name": "@github/copilot-darwin-x64", + "prependLicenseText": [ + "Copyright (c) GitHub, Inc." + ] + }, + { + "name": "@github/copilot-linux-arm64", + "prependLicenseText": [ + "Copyright (c) GitHub, Inc." + ] + }, + { + "name": "@github/copilot-linux-x64", + "prependLicenseText": [ + "Copyright (c) GitHub, Inc." + ] + }, + { + "name": "@github/copilot-win32-arm64", + "prependLicenseText": [ + "Copyright (c) GitHub, Inc." + ] + }, + { + "name": "@github/copilot-win32-x64", + "prependLicenseText": [ + "Copyright (c) GitHub, Inc." + ] + }, + { + // Reason: NPM package does not include repository URL + "name": "@vscode/fs-copyfile", + "fullLicenseText": [ + "Copyright (c) Microsoft Corporation.", + "", + "MIT License", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + ] } ] diff --git a/cli/ThirdPartyNotices.txt b/cli/ThirdPartyNotices.txt index 6e21ddb37297a..39091fdc1dbab 100644 --- a/cli/ThirdPartyNotices.txt +++ b/cli/ThirdPartyNotices.txt @@ -722,9 +722,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -1922,9 +1922,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5287,9 +5287,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5328,9 +5328,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5369,9 +5369,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5410,9 +5410,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5451,9 +5451,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5492,9 +5492,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5533,9 +5533,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5574,9 +5574,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5615,9 +5615,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5656,9 +5656,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5697,9 +5697,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5738,9 +5738,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5779,9 +5779,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -5820,9 +5820,9 @@ Furthermore, the crates are (usually automatically) derived from Apple SDKs, and that may have implications for licensing, see below for details. [#23]: https://github.com/madsmtm/objc2/issues/23 -[MIT]: https://opensource.org/license/MIT -[Zlib]: https://zlib.net/zlib_license.html -[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0 +[MIT]: ./LICENSE-MIT.txt +[Zlib]: ./LICENSE-ZLIB.txt +[Apache-2.0]: ./LICENSE-APACHE.txt ## Apple SDKs @@ -10137,7 +10137,7 @@ DEALINGS IN THE SOFTWARE. --------------------------------------------------------- -tar 0.4.44 - MIT OR Apache-2.0 +tar 0.4.45 - MIT OR Apache-2.0 https://github.com/alexcrichton/tar-rs Copyright (c) The tar-rs Project Contributors @@ -14089,9 +14089,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Some files in the "tests/data" subdirectory of this repository are under other -licences; see files named LICENSE.*.txt for details. --------------------------------------------------------- --------------------------------------------------------- diff --git a/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts b/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts index b4f95f7158ef9..eb126fa557e3e 100644 --- a/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts +++ b/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.ts @@ -32,6 +32,7 @@ export interface IGotoSymbolQuickPickItem extends IQuickPickItem { uri?: URI; symbolName?: string; range?: { decoration: IRange; selection: IRange }; + attach?(): void; } export interface IGotoSymbolQuickAccessProviderOptions extends IEditorNavigationQuickAccessOptions { @@ -164,6 +165,14 @@ export abstract class AbstractGotoSymbolQuickAccessProvider extends AbstractEdit } })); + // Attach the active symbol as context + disposables.add(picker.onDidAttach(() => { + const [item] = picker.activeItems; + if (typeof item?.attach === 'function') { + item.attach(); + } + })); + // Resolve symbols from document once and reuse this // request for all filtering and typing then on const symbolsPromise = this.getDocumentSymbols(model, token); diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index 539c9cfe1df0f..b835d1cdd087d 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -263,6 +263,8 @@ export class MenuId { static readonly ChatEditingWidgetToolbar = new MenuId('ChatEditingWidgetToolbar'); static readonly ChatEditingSessionChangesToolbar = new MenuId('ChatEditingSessionChangesToolbar'); static readonly ChatEditingSessionApplySubmenu = new MenuId('ChatEditingSessionApplySubmenu'); + static readonly ChatEditingSessionTitleToolbar = new MenuId('ChatEditingSessionTitleToolbar'); + static readonly ChatEditingSessionChangeToolbar = new MenuId('ChatEditingSessionChangeToolbar'); static readonly ChatEditingSessionChangesVersionsSubmenu = new MenuId('ChatEditingSessionChangesVersionsSubmenu'); static readonly ChatEditingEditorContent = new MenuId('ChatEditingEditorContent'); static readonly ChatEditingEditorHunk = new MenuId('ChatEditingEditorHunk'); diff --git a/src/vs/platform/quickinput/browser/pickerQuickAccess.ts b/src/vs/platform/quickinput/browser/pickerQuickAccess.ts index d200f15a66ede..f3f64c70e2b89 100644 --- a/src/vs/platform/quickinput/browser/pickerQuickAccess.ts +++ b/src/vs/platform/quickinput/browser/pickerQuickAccess.ts @@ -57,6 +57,12 @@ export interface IPickerQuickAccessItem extends IQuickPickItem { * which can be a `Promise` for long running operations. */ trigger?(buttonIndex: number, keyMods: IKeyMods): TriggerAction | Promise; + + /** + * A method that will be executed when the pick item should be attached + * as context, e.g. to a chat conversation. + */ + attach?(): void; } export interface IPickerQuickAccessSeparator extends IQuickPickSeparator { @@ -345,6 +351,14 @@ export abstract class PickerQuickAccessProvider { + const [item] = picker.activeItems; + if (typeof item?.attach === 'function') { + item.attach(); + } + })); + const buttonTrigger = async (button: IQuickInputButton, item: T | IPickerQuickAccessSeparator) => { if (typeof item.trigger !== 'function') { return; diff --git a/src/vs/platform/quickinput/browser/quickInput.ts b/src/vs/platform/quickinput/browser/quickInput.ts index 8996e42e1637a..d6b09fc78594b 100644 --- a/src/vs/platform/quickinput/browser/quickInput.ts +++ b/src/vs/platform/quickinput/browser/quickInput.ts @@ -532,6 +532,7 @@ export class QuickPick()); private readonly onDidAcceptEmitter = this._register(new Emitter()); private readonly onDidCustomEmitter = this._register(new Emitter()); + private readonly onDidAttachEmitter = this._register(new Emitter()); private _items: O extends { useSeparators: true } ? Array : Array = []; private itemsUpdated = false; private _canSelectMany = false; @@ -643,6 +644,8 @@ export class QuickPick { + const currentQuickPick = accessor.get(IQuickInputService).currentQuickInput as IQuickPick; + currentQuickPick?.attach(); + }, + }, +); + +//#endregion + //#region Hide registerQuickInputCommandAndKeybindingRule( diff --git a/src/vs/platform/quickinput/common/quickInput.ts b/src/vs/platform/quickinput/common/quickInput.ts index 04d91e66aa488..e56dfaa3e9c73 100644 --- a/src/vs/platform/quickinput/common/quickInput.ts +++ b/src/vs/platform/quickinput/common/quickInput.ts @@ -713,6 +713,16 @@ export interface IQuickPick; + + /** + * Programmatically triggers the attach action for the active item. + */ + attach(): void; } /** diff --git a/src/vs/platform/terminal/node/terminalProcess.ts b/src/vs/platform/terminal/node/terminalProcess.ts index e9f3a01b4f934..efb8c243bd37b 100644 --- a/src/vs/platform/terminal/node/terminalProcess.ts +++ b/src/vs/platform/terminal/node/terminalProcess.ts @@ -31,7 +31,7 @@ const enum ShutdownConstants { * on Windows under conpty, killing a process while data is being output will cause the [conhost * flush to hang the pty host][2] because [conhost should be hosted on another thread][3]. * - * [1]: https://github.com/Tyriar/node-pty/issues/72 + * [1]: https://github.com/microsoft/node-pty/issues/72 * [2]: https://github.com/microsoft/vscode/issues/71966 * [3]: https://github.com/microsoft/node-pty/pull/415 */ @@ -368,7 +368,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess } // Allow any trailing data events to be sent before the exit event is sent. - // See https://github.com/Tyriar/node-pty/issues/72 + // See https://github.com/microsoft/node-pty/issues/72 private _queueProcessExit() { if (this._logService.getLevel() === LogLevel.Trace) { this._logService.trace('TerminalProcess#_queueProcessExit', new Error().stack?.replace(/^Error/, '')); diff --git a/src/vs/platform/theme/common/colorUtils.ts b/src/vs/platform/theme/common/colorUtils.ts index f55c8aad640a9..6f725c9c9244a 100644 --- a/src/vs/platform/theme/common/colorUtils.ts +++ b/src/vs/platform/theme/common/colorUtils.ts @@ -126,6 +126,11 @@ export interface IColorRegistry { */ getColorReferenceSchema(): IJSONSchema; + /** + * Update the default color of a color identifier. + */ + updateDefaultColor(id: string, defaults: ColorDefaults | ColorValue | null): void; + /** * Notify when the color theme or settings change. */ @@ -186,6 +191,13 @@ class ColorRegistry extends Disposable implements IColorRegistry { } + public updateDefaultColor(id: string, defaults: ColorDefaults | ColorValue | null): void { + const existing = this.colorsById[id]; + if (existing) { + this.colorsById[id] = { ...existing, defaults }; + } + } + public deregisterColor(id: string): void { delete this.colorsById[id]; delete this.colorSchema.properties[id]; diff --git a/src/vs/sessions/browser/collapsedPartWidgets.ts b/src/vs/sessions/browser/collapsedPartWidgets.ts deleted file mode 100644 index e5c1789651b76..0000000000000 --- a/src/vs/sessions/browser/collapsedPartWidgets.ts +++ /dev/null @@ -1,313 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import './media/collapsedPanelWidget.css'; -import { $, addDisposableListener, append, EventType } from '../../base/browser/dom.js'; -import { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../base/common/lifecycle.js'; -import { IWorkbenchLayoutService, Parts } from '../../workbench/services/layout/browser/layoutService.js'; -import { IHoverService } from '../../platform/hover/browser/hover.js'; -import { createInstantHoverDelegate } from '../../base/browser/ui/hover/hoverDelegateFactory.js'; -import { localize } from '../../nls.js'; -import { ThemeIcon } from '../../base/common/themables.js'; -import { Codicon } from '../../base/common/codicons.js'; -import { IAgentSessionsService } from '../../workbench/contrib/chat/browser/agentSessions/agentSessionsService.js'; -import { AgentSessionStatus, getAgentChangesSummary, IAgentSession } from '../../workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js'; -import { ICommandService } from '../../platform/commands/common/commands.js'; -import { IPaneCompositePartService } from '../../workbench/services/panecomposite/browser/panecomposite.js'; -import { ViewContainerLocation } from '../../workbench/common/views.js'; -import { URI } from '../../base/common/uri.js'; -import { Event } from '../../base/common/event.js'; - -// Duplicated from vs/sessions/contrib/changes/browser/changesView.ts to avoid a layering import. -const CHANGES_VIEW_CONTAINER_ID = 'workbench.view.agentSessions.changesContainer'; - -/** - * Collapsed widget shown in the bottom-left corner when the sidebar is hidden. - * Shows session status counts (active, errors, completed) and a new session button. - */ -export class CollapsedSidebarWidget extends Disposable { - - private readonly element: HTMLElement; - private readonly indicatorContainer: HTMLElement; - private readonly indicatorDisposables = this._register(new DisposableStore()); - private readonly hoverDelegate = this._register(createInstantHoverDelegate()); - - constructor( - parent: HTMLElement, - @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, - @IHoverService private readonly hoverService: IHoverService, - @IAgentSessionsService private readonly agentSessionsService: IAgentSessionsService, - @ICommandService private readonly commandService: ICommandService, - ) { - super(); - - this.element = append(parent, $('.collapsed-panel-widget.collapsed-sidebar-widget')); - - // Sidebar toggle button (leftmost) - this._register(this.createSidebarToggleButton()); - - // New session button (next to panel toggle) - this._register(this.createNewSessionButton()); - - // Session status indicators (rightmost) - this.indicatorContainer = append(this.element, $('.collapsed-panel-button.collapsed-sidebar-status')); - - // Listen for session changes - this._register(this.agentSessionsService.model.onDidChangeSessions(() => this.rebuildIndicators())); - - // Initial build - this.rebuildIndicators(); - - this.hide(); - } - - private createNewSessionButton(): DisposableStore { - const store = new DisposableStore(); - const btn = append(this.element, $('.collapsed-panel-button.collapsed-sidebar-new-session')); - append(btn, $(ThemeIcon.asCSSSelector(Codicon.newSession))); - - store.add(this.hoverService.setupManagedHover(this.hoverDelegate, btn, localize('newSession', "New Session"))); - - store.add(addDisposableListener(btn, EventType.CLICK, () => { - this.commandService.executeCommand('workbench.action.sessions.newChat'); - })); - - return store; - } - - private createSidebarToggleButton(): DisposableStore { - const store = new DisposableStore(); - const btn = append(this.element, $('.collapsed-panel-button.collapsed-sidebar-panel-toggle')); - let iconElement: HTMLElement | undefined; - - const updateIcon = () => { - const sidebarVisible = this.layoutService.isVisible(Parts.SIDEBAR_PART); - const icon = sidebarVisible ? Codicon.layoutSidebarLeft : Codicon.layoutSidebarLeftOff; - iconElement?.remove(); - iconElement = append(btn, $(ThemeIcon.asCSSSelector(icon))); - }; - - updateIcon(); - - store.add(this.hoverService.setupManagedHover(this.hoverDelegate, btn, localize('toggleSidebar', "Toggle Side Bar"))); - - store.add(addDisposableListener(btn, EventType.CLICK, () => { - this.commandService.executeCommand('workbench.action.agentToggleSidebarVisibility'); - })); - - store.add(this.layoutService.onDidChangePartVisibility(e => { - if (e.partId === Parts.SIDEBAR_PART) { - updateIcon(); - } - })); - - return store; - } - - private rebuildIndicators(): void { - this.indicatorDisposables.clear(); - this.indicatorContainer.textContent = ''; - - const sessions = this.agentSessionsService.model.sessions; - const counts = this.countSessionsByStatus(sessions); - - const tooltipParts: string[] = []; - - // In-progress (matches agentSessionsViewer: sessionInProgress) - if (counts.inProgress > 0) { - this.appendStatusSegment(Codicon.sessionInProgress, `${counts.inProgress}`, 'collapsed-sidebar-indicator-active'); - tooltipParts.push(localize('sessionsInProgress', "{0} session(s) in progress", counts.inProgress)); - } - - // Needs input (matches agentSessionsViewer: circleFilled) - if (counts.needsInput > 0) { - this.appendStatusSegment(Codicon.circleFilled, `${counts.needsInput}`, 'collapsed-sidebar-indicator-input'); - tooltipParts.push(localize('sessionsNeedInput', "{0} session(s) need input", counts.needsInput)); - } - - // Failed (matches agentSessionsViewer: error) - if (counts.failed > 0) { - this.appendStatusSegment(Codicon.error, `${counts.failed}`, 'collapsed-sidebar-indicator-error'); - tooltipParts.push(localize('sessionsFailed', "{0} session(s) with errors", counts.failed)); - } - - // Unread (matches agentSessionsViewer: circleFilled with textLink-foreground) - if (counts.unread > 0) { - this.appendStatusSegment(Codicon.circleFilled, `${counts.unread}`, 'collapsed-sidebar-indicator-unread'); - tooltipParts.push(localize('sessionsUnread', "{0} unread session(s)", counts.unread)); - } - - // If no sessions at all - if (sessions.length === 0) { - this.appendStatusSegment(Codicon.commentDiscussion, '0', 'collapsed-sidebar-indicator-empty'); - tooltipParts.push(localize('noSessions', "No sessions")); - } - - if (tooltipParts.length > 0) { - this.indicatorDisposables.add(this.hoverService.setupManagedHover( - this.hoverDelegate, this.indicatorContainer, tooltipParts.join('\n') - )); - - this.indicatorDisposables.add(addDisposableListener(this.indicatorContainer, EventType.CLICK, () => { - this.layoutService.setPartHidden(false, Parts.SIDEBAR_PART); - })); - } - } - - private appendStatusSegment(icon: ThemeIcon, count: string, className: string): void { - const segment = append(this.indicatorContainer, $(`span.collapsed-sidebar-segment.${className}`)); - append(segment, $(ThemeIcon.asCSSSelector(icon))); - const label = append(segment, $('span.collapsed-sidebar-count')); - label.textContent = count; - } - - private countSessionsByStatus(sessions: IAgentSession[]): { inProgress: number; needsInput: number; failed: number; unread: number } { - let inProgress = 0; - let needsInput = 0; - let failed = 0; - let unread = 0; - - for (const session of sessions) { - if (session.isArchived()) { - continue; - } - switch (session.status) { - case AgentSessionStatus.InProgress: - inProgress++; - break; - case AgentSessionStatus.NeedsInput: - needsInput++; - break; - case AgentSessionStatus.Failed: - failed++; - break; - case AgentSessionStatus.Completed: - if (!session.isRead()) { - unread++; - } - break; - } - } - - return { inProgress, needsInput, failed, unread }; - } - - show(): void { - this.element.classList.remove('collapsed-panel-hidden'); - } - - hide(): void { - this.element.classList.add('collapsed-panel-hidden'); - } -} - -/** - * Widget shown in the titlebar right area showing file change counts - * (files, insertions, deletions) from the active session. - * Always visible — acts as a toggle for the auxiliary bar. - */ -export class CollapsedAuxiliaryBarWidget extends Disposable { - - private readonly element: HTMLElement; - private readonly changesBtn: HTMLElement; - private readonly indicatorDisposables = this._register(new DisposableStore()); - private readonly hoverDelegate = this._register(createInstantHoverDelegate()); - private activeSessionResource: (() => URI | undefined) | undefined; - private readonly activeSessionDisposable = this._register(new MutableDisposable()); - - constructor( - parent: HTMLElement, - windowControlsContainer: HTMLElement | undefined, - @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, - @IHoverService private readonly hoverService: IHoverService, - @IAgentSessionsService private readonly agentSessionsService: IAgentSessionsService, - @IPaneCompositePartService private readonly paneCompositeService: IPaneCompositePartService, - ) { - super(); - - this.element = $('div.collapsed-panel-widget.collapsed-auxbar-widget'); - - // Insert before the window-controls-container so the widget is not - // hidden behind the WCO on Windows. - if (windowControlsContainer && windowControlsContainer.parentElement === parent) { - parent.insertBefore(this.element, windowControlsContainer); - } else { - append(parent, this.element); - } - - this._register(toDisposable(() => this.element.remove())); - - const indicatorContainer = append(this.element, $('.collapsed-panel-buttons')); - this.changesBtn = append(indicatorContainer, $('.collapsed-panel-button.collapsed-auxbar-indicator')); - - // Click handler lives on the persistent button - this._register(addDisposableListener(this.changesBtn, EventType.CLICK, () => { - const isVisible = !this.layoutService.isVisible(Parts.AUXILIARYBAR_PART); - this.layoutService.setPartHidden(!isVisible, Parts.AUXILIARYBAR_PART); - if (isVisible) { - this.paneCompositeService.openPaneComposite(CHANGES_VIEW_CONTAINER_ID, ViewContainerLocation.AuxiliaryBar); - } - })); - - // Listen for session changes to update indicators - this._register(this.agentSessionsService.model.onDidChangeSessions(() => this.rebuildIndicators())); - - // Initial build - this.rebuildIndicators(); - } - - /** - * Bind an active-session provider so indicators reflect the currently - * selected session rather than aggregating all sessions. - */ - setActiveSessionProvider(getResource: () => URI | undefined, onDidChange: Event): void { - this.activeSessionResource = getResource; - this.activeSessionDisposable.value = onDidChange(() => this.rebuildIndicators()); - this.rebuildIndicators(); - } - - private rebuildIndicators(): void { - this.indicatorDisposables.clear(); - this.changesBtn.textContent = ''; - - // Get change summary from the active session - const resource = this.activeSessionResource?.(); - const session = resource ? this.agentSessionsService.getSession(resource) : undefined; - const summary = session ? getAgentChangesSummary(session.changes) : undefined; - - // Rebuild inner content: [diff icon] +insertions -deletions - append(this.changesBtn, $(ThemeIcon.asCSSSelector(Codicon.diffMultiple))); - - if (summary && summary.insertions > 0) { - const insLabel = append(this.changesBtn, $('span.collapsed-auxbar-count.collapsed-auxbar-insertions')); - insLabel.textContent = `+${summary.insertions}`; - } - - if (summary && summary.deletions > 0) { - const delLabel = append(this.changesBtn, $('span.collapsed-auxbar-count.collapsed-auxbar-deletions')); - delLabel.textContent = `-${summary.deletions}`; - } - - if (summary) { - this.indicatorDisposables.add(this.hoverService.setupManagedHover( - this.hoverDelegate, this.changesBtn, - localize('changesSummary', "{0} file(s) changed, {1} insertion(s), {2} deletion(s)", summary.files, summary.insertions, summary.deletions) - )); - } else { - this.indicatorDisposables.add(this.hoverService.setupManagedHover( - this.hoverDelegate, this.changesBtn, - localize('showChanges', "Show Changes") - )); - } - } - - /** - * Update the active visual state of the widget based on - * whether the auxiliary bar is currently visible. - */ - updateActiveState(auxiliaryBarVisible: boolean): void { - this.element.classList.toggle('active', auxiliaryBarVisible); - } -} diff --git a/src/vs/sessions/browser/layoutActions.ts b/src/vs/sessions/browser/layoutActions.ts index 8f6701aecb4a2..74e7b88061d78 100644 --- a/src/vs/sessions/browser/layoutActions.ts +++ b/src/vs/sessions/browser/layoutActions.ts @@ -14,7 +14,7 @@ import { Menus } from './menus.js'; import { ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; import { KeybindingWeight } from '../../platform/keybinding/common/keybindingsRegistry.js'; import { registerIcon } from '../../platform/theme/common/iconRegistry.js'; -import { AuxiliaryBarVisibleContext, IsAuxiliaryWindowContext, IsWindowAlwaysOnTopContext, SideBarVisibleContext } from '../../workbench/common/contextkeys.js'; +import { AuxiliaryBarVisibleContext, IsAuxiliaryWindowContext, IsWindowAlwaysOnTopContext } from '../../workbench/common/contextkeys.js'; import { IWorkbenchLayoutService, Parts } from '../../workbench/services/layout/browser/layoutService.js'; import { SessionsWelcomeVisibleContext } from '../common/contextkeys.js'; @@ -41,12 +41,6 @@ class ToggleSidebarVisibilityAction extends Action2 { primary: KeyMod.CtrlCmd | KeyCode.KeyB }, menu: [ - { - id: Menus.SidebarTitle, - group: 'navigation', - order: 100, - when: ContextKeyExpr.and(IsAuxiliaryWindowContext.toNegated(), SideBarVisibleContext, SessionsWelcomeVisibleContext.toNegated()) - }, { id: Menus.TitleBarContext, group: 'navigation', diff --git a/src/vs/sessions/browser/media/collapsedPanelWidget.css b/src/vs/sessions/browser/media/collapsedPanelWidget.css deleted file mode 100644 index b7d2d4e78c411..0000000000000 --- a/src/vs/sessions/browser/media/collapsedPanelWidget.css +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/* ---- Collapsed Part Widgets (shared, inline in titlebar) ---- */ - -.agent-sessions-workbench .collapsed-panel-widget { - display: flex; - flex-direction: row; - align-items: center; - gap: 2px; - padding: 0 4px; - height: 100%; - position: relative; - z-index: 2500; /* Above titlebar toolbar actions so widgets remain clickable */ - -webkit-app-region: no-drag; -} - -.agent-sessions-workbench .collapsed-panel-widget.collapsed-panel-hidden { - display: none; -} - -/* ---- Sidebar widget (in titlebar-left) ---- */ - -.agent-sessions-workbench .collapsed-sidebar-widget { - order: 10; - padding-left: 8px; -} - -/* ---- Auxiliary Bar widget (in titlebar-right) ---- */ - -.agent-sessions-workbench .collapsed-auxbar-widget { - order: 1; -} - -.agent-sessions-workbench .collapsed-auxbar-widget.active .collapsed-panel-button { - background: var(--vscode-toolbar-activeBackground); - border-radius: var(--vscode-cornerRadius-medium); -} - -/* ---- Buttons (match titlebar action-item sizing) ---- */ - -.agent-sessions-workbench .collapsed-panel-widget .collapsed-panel-buttons { - display: flex; - flex-direction: row; - align-items: center; - gap: 0; - height: 100%; -} - -.agent-sessions-workbench .collapsed-panel-widget .collapsed-panel-button { - display: flex; - align-items: center; - justify-content: center; - height: 22px; - padding: 0 4px; - border-radius: var(--vscode-cornerRadius-medium); - cursor: pointer; - color: inherit; - gap: 3px; -} - -.agent-sessions-workbench .collapsed-panel-widget .collapsed-panel-button:hover { - background: var(--vscode-toolbar-hoverBackground); -} - -.agent-sessions-workbench .collapsed-panel-widget .collapsed-panel-button:active { - background: var(--vscode-toolbar-activeBackground); -} - -.agent-sessions-workbench .collapsed-panel-widget .collapsed-panel-button .codicon { - font-size: 16px; - color: inherit; -} - -/* ---- Consolidated session status button ---- */ - -.agent-sessions-workbench .collapsed-panel-button.collapsed-sidebar-status { - gap: 6px; -} - -.agent-sessions-workbench .collapsed-sidebar-segment { - display: inline-flex; - align-items: center; - gap: 2px; -} - -.agent-sessions-workbench .collapsed-panel-button .collapsed-sidebar-segment .codicon { - font-size: 14px; -} - -/* ---- Sidebar indicators ---- */ - -.agent-sessions-workbench .collapsed-sidebar-count, -.agent-sessions-workbench .collapsed-auxbar-count { - font-size: 11px; - font-variant-numeric: tabular-nums; - line-height: 16px; - color: inherit; -} - -.agent-sessions-workbench .collapsed-sidebar-segment.collapsed-sidebar-indicator-active .codicon { - color: var(--vscode-textLink-foreground); -} - -.agent-sessions-workbench .collapsed-sidebar-segment.collapsed-sidebar-indicator-error { - color: var(--vscode-errorForeground); -} - -.agent-sessions-workbench .collapsed-sidebar-segment.collapsed-sidebar-indicator-input { - color: var(--vscode-list-warningForeground); -} - -.agent-sessions-workbench .collapsed-sidebar-segment.collapsed-sidebar-indicator-input .codicon { - animation: collapsed-sidebar-needs-input-pulse 2s ease-in-out infinite; -} - -@keyframes collapsed-sidebar-needs-input-pulse { - 0%, 100% { - opacity: 1; - } - 50% { - opacity: 0.4; - } -} - -@media (prefers-reduced-motion: reduce) { - .agent-sessions-workbench .collapsed-sidebar-segment.collapsed-sidebar-indicator-input .codicon { - animation: none; - } -} - -.agent-sessions-workbench .collapsed-sidebar-segment.collapsed-sidebar-indicator-unread { - color: var(--vscode-textLink-foreground); -} - -/* ---- Panel toggle button ---- */ - -.agent-sessions-workbench .collapsed-sidebar-panel-toggle { - opacity: 0.7; -} - -.agent-sessions-workbench .collapsed-sidebar-panel-toggle:hover { - opacity: 1; -} - -/* ---- Auxiliary bar indicators ---- */ - -.agent-sessions-workbench .collapsed-auxbar-insertions { - color: var(--vscode-gitDecoration-addedResourceForeground); -} - -.agent-sessions-workbench .collapsed-auxbar-deletions { - color: var(--vscode-gitDecoration-deletedResourceForeground); -} - -.agent-sessions-workbench span.collapsed-auxbar-count.collapsed-auxbar-insertions, -.agent-sessions-workbench span.collapsed-auxbar-count.collapsed-auxbar-deletions { - font-weight: 600; -} diff --git a/src/vs/sessions/browser/media/style.css b/src/vs/sessions/browser/media/style.css index c029113b4ea2a..16373c8c63ffb 100644 --- a/src/vs/sessions/browser/media/style.css +++ b/src/vs/sessions/browser/media/style.css @@ -15,7 +15,6 @@ * * Margin values (must match the constants in the Part classes): * Sidebar: no card (flush, spans full height) - * Chat bar: top=16, bottom=2, left=16, right=16 * Auxiliary bar: top=16, bottom=18, right=16 * Panel: bottom=18, left=16, right=16 */ @@ -88,7 +87,7 @@ margin: 0 auto !important; display: inherit !important; /* Align with panel (terminal) card margin */ - padding: 4px 16px !important; + padding: 4px 16px 16px 16px !important; box-sizing: border-box; } diff --git a/src/vs/sessions/browser/parts/media/sidebarPart.css b/src/vs/sessions/browser/parts/media/sidebarPart.css index 0162bcb26d036..1b68c782f8471 100644 --- a/src/vs/sessions/browser/parts/media/sidebarPart.css +++ b/src/vs/sessions/browser/parts/media/sidebarPart.css @@ -24,7 +24,8 @@ } /* Interactive elements in the title area must not be draggable */ -.agent-sessions-workbench .part.sidebar > .composite.title .action-item { +.agent-sessions-workbench .part.sidebar > .composite.title .action-item, +.agent-sessions-workbench .part.sidebar > .composite.title > .session-status-toggle { -webkit-app-region: no-drag; } @@ -56,3 +57,38 @@ max-width: 100%; cursor: default; } + +/* Session status toggle — standalone button in sidebar title area */ +.agent-sessions-workbench .part.sidebar .session-status-toggle { + display: flex; + align-items: center; + align-self: center; + gap: 3px; + height: 22px; + padding: 0 4px; + margin-right: 4px; + border: none; + border-radius: 4px; + cursor: pointer; + color: inherit; + font: inherit; + background: var(--vscode-toolbar-activeBackground); + outline: none; + position: relative; + z-index: 1; +} + +.agent-sessions-workbench .part.sidebar .session-status-toggle:hover { + background-color: var(--vscode-toolbar-hoverBackground); +} + +.agent-sessions-workbench .part.sidebar .session-status-toggle .codicon { + font-size: 16px; +} + +.agent-sessions-workbench .part.sidebar .session-status-toggle-badge { + font-size: 12px; + font-variant-numeric: tabular-nums; + line-height: 16px; + color: inherit; +} diff --git a/src/vs/sessions/browser/parts/media/titlebarpart.css b/src/vs/sessions/browser/parts/media/titlebarpart.css index 40b686b5c4d3a..e418faa7aff2d 100644 --- a/src/vs/sessions/browser/parts/media/titlebarpart.css +++ b/src/vs/sessions/browser/parts/media/titlebarpart.css @@ -38,7 +38,7 @@ margin: unset; } -.agent-sessions-workbench.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right { +.agent-sessions-workbench.monaco-workbench.mac .part.titlebar > .sessions-titlebar-container > .titlebar-right { order: 2; width: fit-content; flex-grow: 0; @@ -54,37 +54,13 @@ height: 100%; } -/* Layout actions toolbar appears after the diff widget */ -.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-layout-actions-container { - order: 2; - /* Always render so we can animate in/out instead of display:none */ - display: flex !important; - align-items: center; - overflow: hidden; - width: 0; - opacity: 0; -} - -.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-layout-actions-container:not(.has-no-actions) { - /* TODO: Hardcoded to separator (9px) + single action button (28px). - Update if more actions are added to TitleBarRightLayout. */ - width: 37px; - opacity: 1; -} - -@media (prefers-reduced-motion: no-preference) { - .monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-layout-actions-container { - transition: width 0.15s ease-out, opacity 0.15s ease-out; - } -} - .monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-actions-container:not(.has-no-actions) { display: flex; align-items: center; } -/* Separator before layout actions toolbar */ -.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-layout-actions-container:not(.has-no-actions)::before { +/* Separator before right layout toolbar */ +.monaco-workbench .part.titlebar > .sessions-titlebar-container > .titlebar-right > .titlebar-right-layout-container:not(.has-no-actions)::before { content: ''; width: 1px; height: 16px; diff --git a/src/vs/sessions/browser/parts/sidebarPart.ts b/src/vs/sessions/browser/parts/sidebarPart.ts index 75eb74869ddc4..2b03d46e25e32 100644 --- a/src/vs/sessions/browser/parts/sidebarPart.ts +++ b/src/vs/sessions/browser/parts/sidebarPart.ts @@ -33,13 +33,19 @@ import { Separator } from '../../../base/common/actions.js'; import { IHoverService } from '../../../platform/hover/browser/hover.js'; import { Extensions } from '../../../workbench/browser/panecomposite.js'; import { Menus } from '../menus.js'; -import { $, append, getWindowId, prepend } from '../../../base/browser/dom.js'; +import { $, addDisposableListener, append, EventType, getWindowId, prepend } from '../../../base/browser/dom.js'; import { HiddenItemStrategy, MenuWorkbenchToolBar } from '../../../platform/actions/browser/toolbar.js'; import { isMacintosh, isNative } from '../../../base/common/platform.js'; import { isFullscreen, onDidChangeFullscreen } from '../../../base/browser/browser.js'; import { mainWindow } from '../../../base/browser/window.js'; import { IConfigurationService } from '../../../platform/configuration/common/configuration.js'; import { hasNativeTitlebar, getTitleBarStyle } from '../../../platform/window/common/window.js'; +import { ThemeIcon } from '../../../base/common/themables.js'; +import { Codicon } from '../../../base/common/codicons.js'; +import { DisposableStore } from '../../../base/common/lifecycle.js'; +import { IAgentSessionsService } from '../../../workbench/contrib/chat/browser/agentSessions/agentSessionsService.js'; +import { countUnreadSessions } from '../../../workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js'; +import { localize } from '../../../nls.js'; /** * Sidebar part specifically for agent sessions workbench. @@ -151,6 +157,11 @@ export class SidebarPart extends AbstractPaneCompositePart { prepend(titleArea, $('div.titlebar-drag-region')); } + // Session toggle widget (right side of title area) + if (titleArea) { + this.createSessionsToggle(titleArea); + } + // macOS native: the sidebar spans full height and the traffic lights // overlay the top-left corner. Add a fixed-width spacer inside the // title area to push content horizontally past the traffic lights. @@ -177,6 +188,49 @@ export class SidebarPart extends AbstractPaneCompositePart { return titleArea; } + /** + * Creates a standalone session toggle widget appended to the sidebar title area. + * Displays a tasklist icon with an optional unread badge. Clicking hides the sidebar. + */ + private createSessionsToggle(titleArea: HTMLElement): void { + const widgetDisposables = this._register(new DisposableStore()); + + const widget = append(titleArea, $('button.session-status-toggle')) as HTMLButtonElement; + widget.type = 'button'; + widget.tabIndex = 0; + widget.setAttribute('aria-label', localize('hideSidebar', "Hide Side Bar")); + append(widget, $(ThemeIcon.asCSSSelector(Codicon.tasklist))); + const badge = append(widget, $('span.session-status-toggle-badge')); + + // Toggle sidebar on click + widgetDisposables.add(addDisposableListener(widget, EventType.CLICK, (e) => { + e.preventDefault(); + e.stopPropagation(); + this.layoutService.setPartHidden(true, Parts.SIDEBAR_PART); + })); + + // Update badge on session changes (deferred to avoid service unavailability) + const updateBadge = (svc: IAgentSessionsService) => { + const unread = countUnreadSessions(svc.model.sessions); + badge.textContent = unread > 0 ? `${unread}` : ''; + badge.style.display = unread > 0 ? '' : 'none'; + widget.setAttribute('aria-label', unread > 0 + ? localize('hideSidebarUnread', "Hide Side Bar, {0} unread session(s)", unread) + : localize('hideSidebar', "Hide Side Bar")); + }; + + setTimeout(() => { + try { + const svc = this.instantiationService.invokeFunction(accessor => accessor.get(IAgentSessionsService)); + updateBadge(svc); + widgetDisposables.add(svc.model.onDidChangeSessions(() => updateBadge(svc))); + } catch { + // Service not yet available + badge.style.display = 'none'; + } + }, 0); + } + private createFooter(parent: HTMLElement): void { const footer = append(parent, $('.sidebar-footer.sidebar-action-list')); this.footerContainer = footer; diff --git a/src/vs/sessions/browser/parts/titlebarPart.ts b/src/vs/sessions/browser/parts/titlebarPart.ts index 736b483b5d8ba..c6895116d9c72 100644 --- a/src/vs/sessions/browser/parts/titlebarPart.ts +++ b/src/vs/sessions/browser/parts/titlebarPart.ts @@ -207,8 +207,8 @@ export class TitlebarPart extends Part implements ITitlebarPart { toolbarOptions: { primaryGroup: () => true }, })); - // Right toolbar (driven by Menus.TitleBarRight - includes account submenu) - const rightToolbarContainer = prepend(this.rightContent, $('div.titlebar-actions-container.titlebar-layout-actions-container')); + // Right toolbar (driven by Menus.TitleBarRightLayout - includes layout actions) + const rightToolbarContainer = prepend(this.rightContent, $('div.titlebar-actions-container.titlebar-right-layout-container')); this._register(this.instantiationService.createInstance(MenuWorkbenchToolBar, rightToolbarContainer, Menus.TitleBarRightLayout, { contextMenu: Menus.TitleBarContext, hiddenItemStrategy: HiddenItemStrategy.NoHide, diff --git a/src/vs/sessions/browser/workbench.ts b/src/vs/sessions/browser/workbench.ts index 2436595fd594b..3ebbfbf7da0e6 100644 --- a/src/vs/sessions/browser/workbench.ts +++ b/src/vs/sessions/browser/workbench.ts @@ -5,7 +5,6 @@ import '../../workbench/browser/style.js'; import './media/style.css'; -import { CollapsedSidebarWidget, CollapsedAuxiliaryBarWidget } from './collapsedPartWidgets.js'; import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../base/common/lifecycle.js'; import { Emitter, Event, setGlobalLeakWarningThreshold } from '../../base/common/event.js'; import { getActiveDocument, getActiveElement, getClientArea, getWindowId, getWindows, IDimension, isAncestorUsingFlowTo, size, Dimension, runWhenWindowIdle } from '../../base/browser/dom.js'; @@ -23,7 +22,7 @@ import { IEditorService } from '../../workbench/services/editor/common/editorSer import { IPaneCompositePartService } from '../../workbench/services/panecomposite/browser/panecomposite.js'; import { IViewDescriptorService, ViewContainerLocation } from '../../workbench/common/views.js'; import { ILogService } from '../../platform/log/common/log.js'; -import { IInstantiationService, ServicesAccessor, createDecorator } from '../../platform/instantiation/common/instantiation.js'; +import { IInstantiationService, ServicesAccessor } from '../../platform/instantiation/common/instantiation.js'; import { ITitleService } from '../../workbench/services/title/browser/titleService.js'; import { mainWindow, CodeWindow } from '../../base/browser/window.js'; import { coalesce } from '../../base/common/arrays.js'; @@ -61,19 +60,7 @@ import { NotificationsToasts } from '../../workbench/browser/parts/notifications import { IMarkdownRendererService } from '../../platform/markdown/browser/markdownRenderer.js'; import { EditorMarkdownCodeBlockRenderer } from '../../editor/browser/widget/markdownRenderer/browser/editorMarkdownCodeBlockRenderer.js'; import { SyncDescriptor } from '../../platform/instantiation/common/descriptors.js'; -import { TitleService, TitlebarPart } from './parts/titlebarPart.js'; -import { URI } from '../../base/common/uri.js'; -import { IObservable } from '../../base/common/observable.js'; - -/** - * Minimal typing for ISessionsManagementService resolved dynamically to avoid - * a layering import from vs/sessions/contrib/. - */ -interface IMinimalSessionsManagementService { - getActiveSession(): { resource: URI } | undefined; - readonly activeSession: IObservable; -} -const _ISessionsManagementService = createDecorator('sessionsManagementService'); +import { TitleService } from './parts/titlebarPart.js'; //#region Workbench Options @@ -244,9 +231,6 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService { private chatBarPartView!: ISerializableView; - private collapsedSidebarWidget: CollapsedSidebarWidget | undefined; - private collapsedAuxiliaryBarWidget: CollapsedAuxiliaryBarWidget | undefined; - private readonly partVisibility: IPartVisibilityState = { sidebar: true, auxiliaryBar: false, @@ -385,35 +369,6 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService { // Layout this.layout(); - // Collapsed Sidebar Widget (shown when sidebar is hidden) - const titlebarPart = this.getPart(Parts.TITLEBAR_PART) as TitlebarPart; - this.collapsedSidebarWidget = this._register(instantiationService.createInstance(CollapsedSidebarWidget, titlebarPart.leftContainer)); - if (!this.partVisibility.sidebar) { - this.collapsedSidebarWidget.show(); - } - - // Auxiliary bar changes widget (always visible, acts as a toggle) - this.collapsedAuxiliaryBarWidget = this._register(instantiationService.createInstance(CollapsedAuxiliaryBarWidget, titlebarPart.rightContainer, titlebarPart.rightWindowControlsContainer)); - this.collapsedAuxiliaryBarWidget.updateActiveState(this.partVisibility.auxiliaryBar); - - // Wire active session provider after restore, when ISessionsManagementService is available. - // Resolved via createDecorator to avoid a layering import from vs/sessions/contrib/. - // Note: whenRestored is a deferred promise that resolves inside restore() below. - const auxWidget = this.collapsedAuxiliaryBarWidget; - this.whenRestored.then(() => { - instantiationService.invokeFunction(accessor => { - try { - const svc = accessor.get(_ISessionsManagementService); - auxWidget.setActiveSessionProvider( - () => svc.getActiveSession()?.resource, - Event.fromObservableLight(svc.activeSession) - ); - } catch { - // Service not registered — indicators will remain empty - } - }); - }); - // Restore this.restore(lifecycleService); }); @@ -1105,13 +1060,6 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService { !hidden, ); - // Toggle collapsed sidebar widget - if (hidden) { - this.collapsedSidebarWidget?.show(); - } else { - this.collapsedSidebarWidget?.hide(); - } - // If sidebar becomes hidden, also hide the current active pane composite if (hidden && this.paneCompositeService.getActivePaneComposite(ViewContainerLocation.Sidebar)) { this.paneCompositeService.hideActivePaneComposite(ViewContainerLocation.Sidebar); @@ -1141,9 +1089,6 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService { !hidden, ); - // Update collapsed auxiliary bar widget active state - this.collapsedAuxiliaryBarWidget?.updateActiveState(!hidden); - // If auxiliary bar becomes hidden, also hide the current active pane composite if (hidden && this.paneCompositeService.getActivePaneComposite(ViewContainerLocation.AuxiliaryBar)) { this.paneCompositeService.hideActivePaneComposite(ViewContainerLocation.AuxiliaryBar); diff --git a/src/vs/sessions/common/theme.ts b/src/vs/sessions/common/theme.ts index 2f928d12aecbb..1f97fa316a167 100644 --- a/src/vs/sessions/common/theme.ts +++ b/src/vs/sessions/common/theme.ts @@ -4,11 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from '../../nls.js'; -import { registerColor, transparent } from '../../platform/theme/common/colorUtils.js'; +import { getColorRegistry, registerColor, transparent } from '../../platform/theme/common/colorUtils.js'; import { contrastBorder, iconForeground } from '../../platform/theme/common/colorRegistry.js'; import { Color } from '../../base/common/color.js'; import { buttonBackground } from '../../platform/theme/common/colors/inputColors.js'; -import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from '../../workbench/common/theme.js'; +import { editorBackground } from '../../platform/theme/common/colors/editorColors.js'; +import { PANEL_BACKGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from '../../workbench/common/theme.js'; // Sessions sidebar background color export const sessionsSidebarBackground = registerColor( @@ -69,3 +70,8 @@ export const sessionsUpdateButtonDownloadedBackground = registerColor( transparent(buttonBackground, 0.7), localize('sessionsUpdateButton.downloadedBackground', 'Background color of the update button when download is complete in the agent sessions window.') ); + +const colorRegistry = getColorRegistry(); + +// Override panel background to use editor background in sessions window +colorRegistry.updateDefaultColor(PANEL_BACKGROUND, editorBackground); diff --git a/src/vs/sessions/contrib/changes/browser/changesTitleBarWidget.ts b/src/vs/sessions/contrib/changes/browser/changesTitleBarWidget.ts new file mode 100644 index 0000000000000..5519f5024f7eb --- /dev/null +++ b/src/vs/sessions/contrib/changes/browser/changesTitleBarWidget.ts @@ -0,0 +1,193 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import './media/changesTitleBarWidget.css'; + +import { $, append } from '../../../../base/browser/dom.js'; +import { BaseActionViewItem, IBaseActionViewItemOptions } from '../../../../base/browser/ui/actionbar/actionViewItems.js'; +import { createInstantHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js'; +import { IAction } from '../../../../base/common/actions.js'; +import { Codicon } from '../../../../base/common/codicons.js'; +import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; +import { autorun } from '../../../../base/common/observable.js'; +import { ThemeIcon } from '../../../../base/common/themables.js'; +import { localize } from '../../../../nls.js'; +import { Action2, MenuRegistry, registerAction2 } from '../../../../platform/actions/common/actions.js'; +import { IActionViewItemService } from '../../../../platform/actions/browser/actionViewItemService.js'; +import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; +import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; +import { IHoverService } from '../../../../platform/hover/browser/hover.js'; +import { IWorkbenchContribution } from '../../../../workbench/common/contributions.js'; +import { IsAuxiliaryWindowContext, AuxiliaryBarVisibleContext } from '../../../../workbench/common/contextkeys.js'; +import { IAgentSessionsService } from '../../../../workbench/contrib/chat/browser/agentSessions/agentSessionsService.js'; +import { getAgentChangesSummary } from '../../../../workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js'; +import { IWorkbenchLayoutService, Parts } from '../../../../workbench/services/layout/browser/layoutService.js'; +import { IPaneCompositePartService } from '../../../../workbench/services/panecomposite/browser/panecomposite.js'; +import { ViewContainerLocation } from '../../../../workbench/common/views.js'; +import { Menus } from '../../../browser/menus.js'; +import { SessionsWelcomeVisibleContext } from '../../../common/contextkeys.js'; +import { ISessionsManagementService } from '../../sessions/browser/sessionsManagementService.js'; +import { CHANGES_VIEW_CONTAINER_ID } from './changesView.js'; + +const TOGGLE_CHANGES_VIEW_ID = 'workbench.action.agentSessions.toggleChangesView'; + +/** + * Action view item that renders the diff stats indicator (file change counts) + * in the titlebar session toolbar. Shows [diff icon] +insertions -deletions. + * Clicking toggles the auxiliary bar with the Changes view. + */ +class ChangesTitleBarActionViewItem extends BaseActionViewItem { + + private _container: HTMLElement | undefined; + private readonly _indicatorDisposables = this._register(new DisposableStore()); + private readonly _hoverDelegate = this._register(createInstantHoverDelegate()); + + constructor( + action: IAction, + options: IBaseActionViewItemOptions | undefined, + @IHoverService private readonly hoverService: IHoverService, + @IAgentSessionsService private readonly agentSessionsService: IAgentSessionsService, + @ISessionsManagementService private readonly activeSessionService: ISessionsManagementService, + @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, + ) { + super(undefined, action, options); + + // Re-render when the active session changes + this._register(autorun(reader => { + this.activeSessionService.activeSession.read(reader); + this._rebuildIndicators(); + })); + + // Re-render when sessions data changes + this._register(this.agentSessionsService.model.onDidChangeSessions(() => { + this._rebuildIndicators(); + })); + + // Update active state when auxiliary bar visibility changes + this._register(this.layoutService.onDidChangePartVisibility(e => { + if (e.partId === Parts.AUXILIARYBAR_PART) { + this._updateActiveState(); + } + })); + } + + override render(container: HTMLElement): void { + super.render(container); + + this._container = container; + container.classList.add('changes-titlebar-indicator'); + + this._rebuildIndicators(); + this._updateActiveState(); + } + + override onClick(): void { + this._action.run(); + } + + private _updateActiveState(): void { + this._container?.classList.toggle('active', this.layoutService.isVisible(Parts.AUXILIARYBAR_PART)); + } + + private _rebuildIndicators(): void { + if (!this._container) { + return; + } + + this._indicatorDisposables.clear(); + + const btn = this._container; + btn.textContent = ''; + + // Get change summary from the active session + const activeSession = this.activeSessionService.activeSession.get(); + const resource = activeSession?.resource; + const session = resource ? this.agentSessionsService.getSession(resource) : undefined; + const summary = session ? getAgentChangesSummary(session.changes) : undefined; + + // Rebuild inner content: [diff icon] +insertions -deletions + append(btn, $(ThemeIcon.asCSSSelector(Codicon.diffMultiple))); + + if (summary && summary.insertions > 0) { + const insLabel = append(btn, $('span.changes-titlebar-count.changes-titlebar-insertions')); + insLabel.textContent = `+${summary.insertions}`; + } + + if (summary && summary.deletions > 0) { + const delLabel = append(btn, $('span.changes-titlebar-count.changes-titlebar-deletions')); + delLabel.textContent = `-${summary.deletions}`; + } + + if (summary) { + this._indicatorDisposables.add(this.hoverService.setupManagedHover( + this._hoverDelegate, btn, + localize('changesSummary', "{0} file(s) changed, {1} insertion(s), {2} deletion(s)", summary.files, summary.insertions, summary.deletions) + )); + } else { + this._indicatorDisposables.add(this.hoverService.setupManagedHover( + this._hoverDelegate, btn, + localize('showChanges', "Show Changes") + )); + } + } +} + +/** + * Registers the changes indicator action in the titlebar session toolbar + * (`TitleBarSessionMenu`) and provides a custom action view item to render + * the diff stats widget. + */ +export class ChangesTitleBarContribution extends Disposable implements IWorkbenchContribution { + + static readonly ID = 'workbench.contrib.changesTitleBar'; + + constructor( + @IActionViewItemService actionViewItemService: IActionViewItemService, + @IInstantiationService instantiationService: IInstantiationService, + ) { + super(); + + // Register the toggle action in the session toolbar + this._register(MenuRegistry.appendMenuItem(Menus.TitleBarSessionMenu, { + command: { + id: TOGGLE_CHANGES_VIEW_ID, + title: localize('toggleChanges', "Toggle Changes"), + icon: Codicon.diffMultiple, + toggled: AuxiliaryBarVisibleContext, + }, + group: 'navigation', + order: 10, // After Run Script (8) and Terminal toggle (9) + when: ContextKeyExpr.and(IsAuxiliaryWindowContext.toNegated(), SessionsWelcomeVisibleContext.toNegated()), + })); + + // Provide a custom action view item that renders the diff stats + this._register(actionViewItemService.register(Menus.TitleBarSessionMenu, TOGGLE_CHANGES_VIEW_ID, (action, options) => { + return instantiationService.createInstance(ChangesTitleBarActionViewItem, action, options); + })); + } +} + +// Register the toggle action +registerAction2(class extends Action2 { + constructor() { + super({ + id: TOGGLE_CHANGES_VIEW_ID, + title: localize('toggleChanges', "Toggle Changes"), + icon: Codicon.diffMultiple, + precondition: ContextKeyExpr.and(IsAuxiliaryWindowContext.toNegated(), SessionsWelcomeVisibleContext.toNegated()), + }); + } + + run(accessor: ServicesAccessor): void { + const layoutService = accessor.get(IWorkbenchLayoutService); + const paneCompositeService = accessor.get(IPaneCompositePartService); + + const isVisible = !layoutService.isVisible(Parts.AUXILIARYBAR_PART); + layoutService.setPartHidden(!isVisible, Parts.AUXILIARYBAR_PART); + if (isVisible) { + paneCompositeService.openPaneComposite(CHANGES_VIEW_CONTAINER_ID, ViewContainerLocation.AuxiliaryBar); + } + } +}); diff --git a/src/vs/sessions/contrib/changes/browser/changesView.contribution.ts b/src/vs/sessions/contrib/changes/browser/changesView.contribution.ts index 6eae1fdb97946..d365c787507ea 100644 --- a/src/vs/sessions/contrib/changes/browser/changesView.contribution.ts +++ b/src/vs/sessions/contrib/changes/browser/changesView.contribution.ts @@ -14,6 +14,7 @@ import { CHANGES_VIEW_CONTAINER_ID, CHANGES_VIEW_ID, ChangesViewPane, ChangesVie import './changesViewActions.js'; import './fixCIChecksAction.js'; import { ChangesViewController } from './changesViewController.js'; +import { ChangesTitleBarContribution } from './changesTitleBarWidget.js'; const changesViewIcon = registerIcon('changes-view-icon', Codicon.gitCompare, localize2('changesViewIcon', 'View icon for the Changes view.').value); @@ -44,3 +45,4 @@ viewsRegistry.registerViews([{ }], changesViewContainer); registerWorkbenchContribution2(ChangesViewController.ID, ChangesViewController, WorkbenchPhase.BlockRestore); +registerWorkbenchContribution2(ChangesTitleBarContribution.ID, ChangesTitleBarContribution, WorkbenchPhase.AfterRestored); diff --git a/src/vs/sessions/contrib/changes/browser/changesView.ts b/src/vs/sessions/contrib/changes/browser/changesView.ts index bde0d7268be49..662ffbe189fa6 100644 --- a/src/vs/sessions/contrib/changes/browser/changesView.ts +++ b/src/vs/sessions/contrib/changes/browser/changesView.ts @@ -342,7 +342,10 @@ export class ChangesViewPane extends ViewPane { @ICodeReviewService private readonly codeReviewService: ICodeReviewService, @IGitHubService private readonly gitHubService: IGitHubService, ) { - super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService); + super({ + ...options, + titleMenuId: MenuId.ChatEditingSessionTitleToolbar, + }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService); this.viewModel = this.instantiationService.createInstance(ChangesViewModel); this._register(this.viewModel); @@ -770,7 +773,7 @@ export class ChangesViewPane extends ViewPane { 'ChangesViewTree', this.listContainer, new ChangesTreeDelegate(), - [this.instantiationService.createInstance(ChangesTreeRenderer, resourceLabels, MenuId.ChatEditingWidgetModifiedFilesToolbar)], + [this.instantiationService.createInstance(ChangesTreeRenderer, resourceLabels, MenuId.ChatEditingSessionChangesToolbar)], { alwaysConsumeMouseWheel: false, accessibilityProvider: { @@ -1240,8 +1243,7 @@ class SetChangesListViewModeAction extends ViewAction { icon: Codicon.listTree, toggled: changesViewModeContextKey.isEqualTo(ChangesViewMode.List), menu: { - id: MenuId.ViewTitle, - when: ContextKeyExpr.equals('view', CHANGES_VIEW_ID), + id: MenuId.ChatEditingSessionTitleToolbar, group: '1_viewmode', order: 1 } @@ -1263,8 +1265,7 @@ class SetChangesTreeViewModeAction extends ViewAction { icon: Codicon.listFlat, toggled: changesViewModeContextKey.isEqualTo(ChangesViewMode.Tree), menu: { - id: MenuId.ViewTitle, - when: ContextKeyExpr.equals('view', CHANGES_VIEW_ID), + id: MenuId.ChatEditingSessionTitleToolbar, group: '1_viewmode', order: 2 } @@ -1281,7 +1282,7 @@ registerAction2(SetChangesTreeViewModeAction); // --- Versions Submenu -MenuRegistry.appendMenuItem(MenuId.ViewTitle, { +MenuRegistry.appendMenuItem(MenuId.ChatEditingSessionTitleToolbar, { submenu: MenuId.ChatEditingSessionChangesVersionsSubmenu, title: localize2('versionsActions', 'Versions'), icon: Codicon.versions, diff --git a/src/vs/sessions/contrib/changes/browser/media/changesTitleBarWidget.css b/src/vs/sessions/contrib/changes/browser/media/changesTitleBarWidget.css new file mode 100644 index 0000000000000..a8a456ab4aaa9 --- /dev/null +++ b/src/vs/sessions/contrib/changes/browser/media/changesTitleBarWidget.css @@ -0,0 +1,48 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/* ---- Changes Titlebar Indicator (in right toolbar) ---- */ + +.agent-sessions-workbench .changes-titlebar-indicator { + display: flex; + align-items: center; + justify-content: center; + height: 22px; + padding: 0 4px; + border-radius: var(--vscode-cornerRadius-medium); + cursor: pointer; + color: inherit; + gap: 3px; +} + +.agent-sessions-workbench .changes-titlebar-indicator:hover { + background: var(--vscode-toolbar-hoverBackground); +} + +.agent-sessions-workbench .changes-titlebar-indicator.active { + background: var(--vscode-toolbar-activeBackground); +} + +.agent-sessions-workbench .changes-titlebar-indicator .codicon { + font-size: 16px; + color: inherit; +} + +.agent-sessions-workbench .changes-titlebar-count { + font-size: 11px; + font-variant-numeric: tabular-nums; + line-height: 16px; + color: inherit; +} + +.agent-sessions-workbench .changes-titlebar-insertions { + color: var(--vscode-gitDecoration-addedResourceForeground); + font-weight: 600; +} + +.agent-sessions-workbench .changes-titlebar-deletions { + color: var(--vscode-gitDecoration-deletedResourceForeground); + font-weight: 600; +} diff --git a/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css b/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css index 6a5ea2b3e825b..567da1a2e66a8 100644 --- a/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css +++ b/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css @@ -77,4 +77,33 @@ flex-shrink: 0; } +/* Session count widget (tasklist icon + unread count, left of pill) */ +.command-center .agent-sessions-titlebar-container .agent-sessions-titlebar-count { + display: flex; + align-items: center; + gap: 3px; + flex-shrink: 0; + cursor: pointer; + padding: 0 4px; + height: 22px; + border: none; + border-radius: 4px; + background: transparent; + color: inherit; + font: inherit; + outline: none; +} + +.command-center .agent-sessions-titlebar-container .agent-sessions-titlebar-count:hover { + background-color: var(--vscode-toolbar-hoverBackground); +} +.command-center .agent-sessions-titlebar-container .agent-sessions-titlebar-count .codicon { + font-size: 16px; +} + +.command-center .agent-sessions-titlebar-container .agent-sessions-titlebar-count-label { + font-size: 12px; + font-variant-numeric: tabular-nums; + line-height: 16px; +} diff --git a/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts b/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts index 774577eeb23d6..d568036ca5466 100644 --- a/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts +++ b/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts @@ -19,8 +19,9 @@ import { IMenuService, MenuId, MenuRegistry, SubmenuItemAction } from '../../../ import { IContextKeyService, ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; import { ChatContextKeys } from '../../../../workbench/contrib/chat/common/actions/chatContextKeys.js'; -import { IMarshalledAgentSessionContext } from '../../../../workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js'; +import { IMarshalledAgentSessionContext, countUnreadSessions } from '../../../../workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js'; import { IChatSessionsService } from '../../../../workbench/contrib/chat/common/chatSessionsService.js'; +import { IWorkbenchLayoutService, Parts } from '../../../../workbench/services/layout/browser/layoutService.js'; import { Menus } from '../../../browser/menus.js'; import { IWorkbenchContribution } from '../../../../workbench/common/contributions.js'; import { IActionViewItemService } from '../../../../platform/actions/browser/actionViewItemService.js'; @@ -76,6 +77,7 @@ export class SessionsTitleBarWidget extends BaseActionViewItem { @IMenuService private readonly menuService: IMenuService, @IContextKeyService private readonly contextKeyService: IContextKeyService, @IChatSessionsService private readonly chatSessionsService: IChatSessionsService, + @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, ) { super(undefined, action, options); @@ -128,8 +130,9 @@ export class SessionsTitleBarWidget extends BaseActionViewItem { const label = this._getActiveSessionLabel(); const icon = this._getActiveSessionIcon(); const repoLabel = this._getRepositoryLabel(); + const unreadCount = this._countUnreadSessions(); // Build a render-state key from all displayed data - const renderState = `${icon?.id ?? ''}|${label}|${repoLabel ?? ''}`; + const renderState = `${icon?.id ?? ''}|${label}|${repoLabel ?? ''}|${unreadCount}`; // Skip re-render if state hasn't changed if (this._lastRenderState === renderState) { @@ -194,6 +197,37 @@ export class SessionsTitleBarWidget extends BaseActionViewItem { this._container.appendChild(sessionPill); + // Session count widget (to the left of the pill) — toggles sidebar + const countWidget = $('button.agent-sessions-titlebar-count') as HTMLButtonElement; + countWidget.type = 'button'; + countWidget.tabIndex = 0; + const countIcon = $(ThemeIcon.asCSSSelector(Codicon.tasklist)); + countWidget.appendChild(countIcon); + if (unreadCount > 0) { + const countLabel = $('span.agent-sessions-titlebar-count-label'); + countLabel.textContent = `${unreadCount}`; + countWidget.appendChild(countLabel); + countWidget.setAttribute('aria-label', localize('showSidebarUnread', "Show Side Bar, {0} unread session(s)", unreadCount)); + } else { + countWidget.setAttribute('aria-label', localize('showSidebar', "Show Side Bar")); + } + // Hide when sidebar is visible (only shown when sidebar is hidden) + const updateVisibility = () => { + countWidget.style.display = this.layoutService.isVisible(Parts.SIDEBAR_PART) ? 'none' : ''; + }; + updateVisibility(); + this._dynamicDisposables.add(this.layoutService.onDidChangePartVisibility(e => { + if (e.partId === Parts.SIDEBAR_PART) { + updateVisibility(); + } + })); + this._dynamicDisposables.add(addDisposableListener(countWidget, EventType.CLICK, (e) => { + e.preventDefault(); + e.stopPropagation(); + this.layoutService.setPartHidden(false, Parts.SIDEBAR_PART); + })); + this._container.insertBefore(countWidget, sessionPill); + // Hover this._dynamicDisposables.add(this.hoverService.setupManagedHover( getDefaultHoverDelegate('mouse'), @@ -305,6 +339,10 @@ export class SessionsTitleBarWidget extends BaseActionViewItem { return basename(uri); } + private _countUnreadSessions(): number { + return countUnreadSessions(this.agentSessionsService.model.sessions); + } + private _showContextMenu(e: MouseEvent): void { const activeSession = this.activeSessionService.getActiveSession(); if (!activeSession) { diff --git a/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts b/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts index b0befd9b02ba7..b56047d66e1f8 100644 --- a/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts +++ b/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts @@ -1104,7 +1104,17 @@ export class MultiEditorTabsControl extends EditorTabsControl { const label = `${editor.getName()} + ${selectedEditors.length - 1}`; applyDragImage(e, tab, label); } else { - e.dataTransfer.setDragImage(tab, 0, 0); // top left corner of dragged tab set to cursor position to make room for drop-border feedback + const options = this.groupsView.partOptions; + const isTabSticky = this.tabsModel.isSticky(tabIndex); + const isShrinkSizing = options.tabSizing === 'shrink' || (isTabSticky && options.pinnedTabSizing === 'shrink'); + if (isShrinkSizing) { + // When tab sizing is 'shrink', the tab label may be truncated. Using the tab DOM element + // as a drag image can cause parts of the tab header UI to visually drag along. + // Instead, use a clean text-only drag image with the editor name. + applyDragImage(e, tab, editor.getName()); + } else { + e.dataTransfer.setDragImage(tab, 0, 0); // top left corner of dragged tab set to cursor position to make room for drop-border feedback + } } } diff --git a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts index b98bfa148afe5..05de1113bf4a2 100644 --- a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts +++ b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts @@ -158,6 +158,16 @@ export function isAgentSessionsModel(obj: unknown): obj is IAgentSessionsModel { return Array.isArray(sessionsModel?.sessions) && typeof sessionsModel?.getSession === 'function'; } +export function countUnreadSessions(sessions: IAgentSession[]): number { + let unread = 0; + for (const session of sessions) { + if (!session.isArchived() && session.status === AgentSessionStatus.Completed && !session.isRead()) { + unread++; + } + } + return unread; +} + interface IAgentSessionState { readonly archived?: boolean; readonly pinned?: boolean; diff --git a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts index ae428bc9fd746..044678a421afd 100644 --- a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts +++ b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts @@ -1314,12 +1314,11 @@ configurationRegistry.registerConfiguration({ mode: 'auto' } }, - [ChatConfiguration.SubagentsMaxDepth]: { - type: 'number', - description: nls.localize('chat.subagents.maxDepth', "Maximum nesting depth for subagents. Set to 0 to disable nested subagents. A subagent at this depth will not be able to launch further subagents."), - default: 0, - minimum: 0, - maximum: 20, + [ChatConfiguration.SubagentsAllowInvocationsFromSubagents]: { + type: 'boolean', + description: nls.localize('chat.subagents.allowInvocationsFromSubagents', "Allow subagents to invoke subagents."), + markdownDescription: nls.localize('chat.subagents.allowInvocationsFromSubagents.md', "Controls whether subagents can invoke other subagents. When enabled, nesting is limited to a maximum depth of 5."), + default: false, experiment: { mode: 'auto' } diff --git a/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts b/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts index eed955d90f45a..868a46c833905 100644 --- a/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts +++ b/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts @@ -38,7 +38,7 @@ import { IChatEditorOptions } from '../widgetHosts/editor/chatEditor.js'; import { IChatModel } from '../../common/model/chatModel.js'; import { IChatService, IChatToolInvocation } from '../../common/chatService/chatService.js'; import { autorun, observableFromEvent } from '../../../../../base/common/observable.js'; -import { IChatRequestVariableEntry } from '../../common/attachments/chatVariableEntries.js'; +import { IChatRequestVariableEntry, PromptFileVariableKind, toPromptFileVariableEntry } from '../../common/attachments/chatVariableEntries.js'; import { renderAsPlaintext } from '../../../../../base/browser/markdownRenderer.js'; import { IMarkdownString } from '../../../../../base/common/htmlContent.js'; import { IViewsService } from '../../../../services/views/common/viewsService.js'; @@ -51,6 +51,10 @@ import { isUntitledChatSession, LocalChatSessionUri } from '../../common/model/c import { assertNever } from '../../../../../base/common/assert.js'; import { ICommandService } from '../../../../../platform/commands/common/commands.js'; import { Target } from '../../common/promptSyntax/promptTypes.js'; +import { slashReg } from '../../common/requestParser/chatRequestParser.js'; +import { IPromptsService } from '../../common/promptSyntax/service/promptsService.js'; +import { OffsetRange } from '../../../../../editor/common/core/ranges/offsetRange.js'; +import { ILanguageModelToolsService } from '../../common/tools/languageModelToolsService.js'; const extensionPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'chatSessions', @@ -525,13 +529,22 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ async run(accessor: ServicesAccessor, chatOptions?: { resource: UriComponents; prompt: string; attachedContext?: IChatRequestVariableEntry[] }): Promise { const chatService = accessor.get(IChatService); + const promptsService = accessor.get(IPromptsService); + const toolsService = accessor.get(ILanguageModelToolsService); const { type } = contribution; if (chatOptions) { + let attachedContext = chatOptions.attachedContext; + const resource = URI.revive(chatOptions.resource); const ref = await chatService.acquireOrLoadSession(resource, ChatAgentLocation.Chat, CancellationToken.None); try { - const result = await chatService.sendRequest(resource, chatOptions.prompt, { agentIdSilent: type, attachedContext: chatOptions.attachedContext }); + const promptFile = await resolvePromptSlashCommand(chatOptions.prompt, promptsService, toolsService); + if (promptFile) { + attachedContext = [promptFile, ...(attachedContext ?? [])]; + } + + const result = await chatService.sendRequest(resource, chatOptions.prompt, { agentIdSilent: type, attachedContext }); if (result.kind === 'queued') { await result.deferred; } else if (result.kind === 'sent') { @@ -1288,6 +1301,8 @@ async function openChatSession(accessor: ServicesAccessor, openOptions: NewChatS const logService = accessor.get(ILogService); const editorGroupService = accessor.get(IEditorGroupsService); const editorService = accessor.get(IEditorService); + const promptsService = accessor.get(IPromptsService); + const toolsService = accessor.get(ILanguageModelToolsService); // Determine resource to open const resource = getResourceForNewChatSession(openOptions); @@ -1346,13 +1361,38 @@ async function openChatSession(accessor: ServicesAccessor, openOptions: NewChatS }); } } - await chatService.sendRequest(resource, chatSendOptions.prompt, { agentIdSilent: openOptions.type, attachedContext: chatSendOptions.attachedContext }); + let attachedContext = chatSendOptions.attachedContext; + const promptFile = await resolvePromptSlashCommand(chatSendOptions.prompt, promptsService, toolsService); + if (promptFile) { + attachedContext = [promptFile, ...(attachedContext ?? [])]; + } + await chatService.sendRequest(resource, chatSendOptions.prompt, { agentIdSilent: openOptions.type, attachedContext }); } catch (e) { logService.error(`Failed to send initial request to '${openOptions.type}' chat session with contextOptions: ${JSON.stringify(chatSendOptions)}`, e); } } } +/** + * Returns the variable entry for a slash command if the prompt starts with a slash command that can be resolved to a prompt file, otherwise returns undefined. + */ +async function resolvePromptSlashCommand(prompt: string, promptsService: IPromptsService, toolsService: ILanguageModelToolsService): Promise { + const slashMatch = prompt.match(slashReg); + // starts with a slash command, add the corresponding prompt file to the context if it exists + if (slashMatch) { + // need to resolve the slash command to get the prompt file + const slashCommand = await promptsService.resolvePromptSlashCommand(slashMatch[1], CancellationToken.None); + if (slashCommand) { + const parseResult = slashCommand.parsedPromptFile; + // add the prompt file to the context + const refs = parseResult.body?.variableReferences.map(({ name, offset }) => ({ name, range: new OffsetRange(offset, offset + name.length + 1) })) ?? []; + const toolReferences = toolsService.toToolReferences(refs); + return toPromptFileVariableEntry(parseResult.uri, PromptFileVariableKind.PromptFile, undefined, true, toolReferences); + } + } + return undefined; +} + export function getResourceForNewChatSession(options: NewChatSessionOpenOptions): URI { const isRemoteSession = options.type !== AgentSessionProviders.Local; if (isRemoteSession) { diff --git a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts index c4d66671c218c..8b780c2a92462 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts @@ -7,7 +7,7 @@ import { $, clearNode, getWindow, hide, scheduleAtNextAnimationFrame } from '../ import { alert } from '../../../../../../base/browser/ui/aria/aria.js'; import { DomScrollableElement } from '../../../../../../base/browser/ui/scrollbar/scrollableElement.js'; import { ScrollbarVisibility } from '../../../../../../base/common/scrollable.js'; -import { IChatMarkdownContent, IChatThinkingPart, IChatToolInvocation, IChatToolInvocationSerialized } from '../../../common/chatService/chatService.js'; +import { IChatMarkdownContent, IChatTerminalToolInvocationData, IChatThinkingPart, IChatToolInvocation, IChatToolInvocationSerialized } from '../../../common/chatService/chatService.js'; import { IChatContentPartRenderContext, IChatContentPart } from './chatContentParts.js'; import { IChatRendererContent } from '../../../common/model/chatViewModel.js'; import { ChatConfiguration, ThinkingDisplayMode } from '../../../common/constants.js'; @@ -228,6 +228,7 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen private workingSpinnerLabel: HTMLElement | undefined; private availableMessagesByCategory = new Map(); private readonly toolWrappersByCallId = new Map(); + private readonly toolIconsByCallId = new Map(); private readonly toolLabelsByCallId = new Map(); private readonly toolDisposables = this._register(new DisposableMap()); private readonly ownedToolParts = new Map(); @@ -1224,6 +1225,7 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks): const wrapper = this.toolWrappersByCallId.get(toolCallId); if (wrapper) { this.toolWrappersByCallId.delete(toolCallId); + this.toolIconsByCallId.delete(toolCallId); } this.appendedItemCount = Math.max(0, this.appendedItemCount - 1); @@ -1342,6 +1344,7 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks): if (wrapper) { wrapper.remove(); this.toolWrappersByCallId.delete(toolCallId); + this.toolIconsByCallId.delete(toolCallId); } // make sure to remove any lazy item as well @@ -1470,6 +1473,18 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks): // queue item to be removed if it was streaming and presentation is hidden if (isStreaming && currentState.type !== IChatToolInvocation.StateKind.Streaming) { isStreaming = false; + + // Update terminal tool icon based on sandbox wrapping state + const termData = toolInvocationOrMarkdown.toolSpecificData as IChatTerminalToolInvocationData | undefined; + if (termData?.kind === 'terminal') { + const iconEl = this.toolIconsByCallId.get(toolCallId); + if (iconEl) { + const newIcon = termData.commandLine?.isSandboxWrapped ? Codicon.terminalSecure : Codicon.terminal; + iconEl.className = 'chat-thinking-icon'; + iconEl.classList.add(...ThemeIcon.asClassNameArray(newIcon)); + } + } + if (toolInvocationOrMarkdown.presentation === 'hidden') { this.pendingRemovals.push({ toolCallId: toolInvocationOrMarkdown.toolCallId, toolLabel: currentToolLabel }); this.schedulePendingRemovalsFlush(); @@ -1628,6 +1643,7 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks): const isToolInvocation = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === 'toolInvocation' || toolInvocationOrMarkdown.kind === 'toolInvocationSerialized'); if (isToolInvocation && toolInvocationOrMarkdown.toolCallId) { this.toolWrappersByCallId.set(toolInvocationOrMarkdown.toolCallId, itemWrapper); + this.toolIconsByCallId.set(toolInvocationOrMarkdown.toolCallId, iconElement); } this.appendToWrapper(itemWrapper); diff --git a/src/vs/workbench/contrib/chat/common/constants.ts b/src/vs/workbench/contrib/chat/common/constants.ts index 75d30b88a44b7..735d8217d43d9 100644 --- a/src/vs/workbench/contrib/chat/common/constants.ts +++ b/src/vs/workbench/contrib/chat/common/constants.ts @@ -48,7 +48,7 @@ export enum ChatConfiguration { ChatViewProgressBadgeEnabled = 'chat.viewProgressBadge.enabled', ChatContextUsageEnabled = 'chat.contextUsage.enabled', SubagentToolCustomAgents = 'chat.customAgentInSubagent.enabled', - SubagentsMaxDepth = 'chat.subagents.maxDepth', + SubagentsAllowInvocationsFromSubagents = 'chat.subagents.allowInvocationsFromSubagents', ShowCodeBlockProgressAnimation = 'chat.agent.codeBlockProgress', RestoreLastPanelSession = 'chat.restoreLastPanelSession', ExitAfterDelegation = 'chat.exitAfterDelegation', diff --git a/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.ts b/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.ts index 30cad1ba8fe1c..3eadf14d4055d 100644 --- a/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.ts +++ b/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.ts @@ -9,10 +9,11 @@ import { Range } from '../../../../../../editor/common/core/range.js'; import { ITextModel } from '../../../../../../editor/common/model.js'; import { IModelService } from '../../../../../../editor/common/services/model.js'; import { localize } from '../../../../../../nls.js'; +import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.js'; import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js'; import { IMarkerData, IMarkerService, MarkerSeverity } from '../../../../../../platform/markers/common/markers.js'; import { ChatMode, IChatMode, IChatModeService } from '../../chatModes.js'; -import { ChatModeKind } from '../../constants.js'; +import { ChatConfiguration, ChatModeKind } from '../../constants.js'; import { ILanguageModelChatMetadata, ILanguageModelsService } from '../../languageModels.js'; import { ILanguageModelToolsService, SpecedToolAliases } from '../../tools/languageModelToolsService.js'; import { getPromptsTypeForLanguageId, PromptsType, Target } from '../promptTypes.js'; @@ -21,7 +22,6 @@ import { Disposable, DisposableStore, toDisposable } from '../../../../../../bas import { Delayer } from '../../../../../../base/common/async.js'; import { ResourceMap } from '../../../../../../base/common/map.js'; import { IFileService } from '../../../../../../platform/files/common/files.js'; -import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.js'; import { IPromptsService } from '../service/promptsService.js'; import { ILabelService } from '../../../../../../platform/label/common/label.js'; import { AGENTS_SOURCE_FOLDER, CLAUDE_AGENTS_SOURCE_FOLDER, isInClaudeRulesFolder, LEGACY_MODE_FILE_EXTENSION, VALID_SKILL_NAME_REGEX } from '../config/promptFileLocations.js'; @@ -828,6 +828,12 @@ export class PromptValidator { report(toMarker(localize('promptValidator.disableModelInvocationMustBeBoolean', "The 'disable-model-invocation' attribute must be 'true' or 'false'."), attribute.value.range, MarkerSeverity.Error)); return; } + + if (attribute.value.type === 'scalar' && attribute.value.value === 'false') { + if (!this.isCustomAgentInSubagentEnabled()) { + report(toMarker(localize('promptValidator.inferRequiresConfig', "For agents to be used as subagent you also need to enable the 'chat.customAgentInSubagent.enabled' setting."), attribute.value.range, MarkerSeverity.Warning)); + } + } } private async validateAgentsAttribute(attributes: IHeaderAttribute[], header: PromptHeader, report: (markers: IMarkerData) => void): Promise { @@ -840,6 +846,11 @@ export class PromptValidator { return; } + // Check if the configuration setting is enabled + if (!this.isCustomAgentInSubagentEnabled()) { + report(toMarker(localize('promptValidator.agentsRequiresConfig', "For agents to be used as subagent you also need to enable the 'chat.customAgentInSubagent.enabled' setting."), attribute.range, MarkerSeverity.Warning)); + } + // Collect available agent names const agents = await this.promptsService.getCustomAgents(CancellationToken.None); const availableAgentNames = new Set(agents.map(agent => agent.name)); @@ -867,6 +878,10 @@ export class PromptValidator { } } + private isCustomAgentInSubagentEnabled(): boolean { + return !!this.configurationService.getValue(ChatConfiguration.SubagentToolCustomAgents); + } + private validateGithubPermissions(attributes: IHeaderAttribute[], report: (markers: IMarkerData) => void): void { const attribute = attributes.find(attr => attr.key === GithubPromptHeaderAttributes.github); if (!attribute) { diff --git a/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.ts b/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.ts index f46a41640055d..2e3466f1edad0 100644 --- a/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.ts +++ b/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.ts @@ -17,7 +17,7 @@ import { ChatRequestAgentPart, ChatRequestAgentSubcommandPart, ChatRequestDynami const agentReg = /^@([\w_\-\.]+)(?=(\s|$|\b))/i; // An @-agent const variableReg = /^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i; // A #-variable with an optional numeric : arg (@response:2) -const slashReg = /^\/([\p{L}\d_\-\.:]+)(?=(\s|$|\b))/iu; // A / command +export const slashReg = /^\/([\p{L}\d_\-\.:]+)(?=(\s|$|\b))/iu; // A / command export interface IChatParserContext { /** Used only as a disambiguator, when the query references an agent that has a duplicate with the same name. */ diff --git a/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.ts b/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.ts index 12daaa059da4a..af4de401d078f 100644 --- a/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.ts +++ b/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.ts @@ -58,6 +58,8 @@ export interface IRunSubagentToolInputParams { agentName?: string; } +export const RUN_SUBAGENT_MAX_NESTING_DEPTH = 5; + export class RunSubagentTool extends Disposable implements IToolImpl { static readonly Id = 'runSubagent'; @@ -250,7 +252,8 @@ export class RunSubagentTool extends Disposable implements IToolImpl { }; // Determine whether the subagent should be allowed to spawn its own subagents. - const maxDepth = this.configurationService.getValue(ChatConfiguration.SubagentsMaxDepth) ?? 0; + const allowInvocationsFromSubagents = this.configurationService.getValue(ChatConfiguration.SubagentsAllowInvocationsFromSubagents) ?? false; + const maxDepth = allowInvocationsFromSubagents ? RUN_SUBAGENT_MAX_NESTING_DEPTH : 0; const sessionKey = invocation.context.sessionResource.toString(); const currentDepth = this._sessionDepth.get(sessionKey) ?? 0; const depthAllowed = currentDepth + 1 <= maxDepth; @@ -270,7 +273,7 @@ export class RunSubagentTool extends Disposable implements IToolImpl { modeTools['copilot_askQuestions'] = false; if (maxDepth > 0) { - this.logService.debug(`RunSubagentTool: Nested subagents enabling ${modeTools[RunSubagentTool.Id]}: session ${sessionKey}, currentDepth: ${currentDepth}, maxDepth: ${maxDepth}`); + this.logService.debug(`RunSubagentTool: Nested subagents enabling ${modeTools[RunSubagentTool.Id]}: session ${sessionKey}, currentDepth: ${currentDepth}, maxDepth: ${maxDepth}, allowInvocationsFromSubagents: ${allowInvocationsFromSubagents}`); } const variableSet = new ChatRequestVariableSet(); diff --git a/src/vs/workbench/contrib/chat/test/browser/promptSyntax/languageProviders/promptValidator.test.ts b/src/vs/workbench/contrib/chat/test/browser/promptSyntax/languageProviders/promptValidator.test.ts index b16251caf3353..56d51978cfe4d 100644 --- a/src/vs/workbench/contrib/chat/test/browser/promptSyntax/languageProviders/promptValidator.test.ts +++ b/src/vs/workbench/contrib/chat/test/browser/promptSyntax/languageProviders/promptValidator.test.ts @@ -28,20 +28,23 @@ import { PromptFileParser } from '../../../../common/promptSyntax/promptFilePars import { ICustomAgent, IPromptsService, PromptsStorage } from '../../../../common/promptSyntax/service/promptsService.js'; import { MockChatModeService } from '../../../common/mockChatModeService.js'; import { MockPromptsService } from '../../../common/promptSyntax/service/mockPromptsService.js'; +import { PromptsConfig } from '../../../../common/promptSyntax/config/config.js'; suite('PromptValidator', () => { const disposables = ensureNoDisposablesAreLeakedInTestSuite(); let instaService: TestInstantiationService; + let testConfigService: TestConfigurationService; const existingRef1 = URI.parse('myFs://test/reference1.md'); const existingRef2 = URI.parse('myFs://test/reference2.md'); setup(async () => { - const testConfigService = new TestConfigurationService(); + testConfigService = new TestConfigurationService(); testConfigService.setUserConfiguration(ChatConfiguration.ExtensionToolsEnabled, true); - testConfigService.setUserConfiguration('chat.useCustomAgentHooks', true); + testConfigService.setUserConfiguration(PromptsConfig.USE_CUSTOM_AGENT_HOOKS, true); + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); instaService = workbenchInstantiationService({ contextKeyService: () => disposables.add(new ContextKeyService(testConfigService)), configurationService: () => testConfigService @@ -1098,6 +1101,7 @@ suite('PromptValidator', () => { // Valid infer: true (maps to 'all') - shows deprecation warning { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); const content = [ '---', 'name: "TestAgent"', @@ -1128,70 +1132,6 @@ suite('PromptValidator', () => { assert.strictEqual(markers[0].severity, MarkerSeverity.Error); } - // Valid infer: 'all' - shows deprecation warning - { - const content = [ - '---', - 'name: "TestAgent"', - 'description: "Test agent"', - 'infer: all', - '---', - 'Body', - ].join('\n'); - const markers = await validate(content, PromptsType.agent); - assert.strictEqual(markers.length, 1, 'infer: all should produce deprecation warning'); - assert.strictEqual(markers[0].message, deprecationMessage); - assert.strictEqual(markers[0].severity, MarkerSeverity.Error); - } - - // Valid infer: 'user' - shows deprecation warning - { - const content = [ - '---', - 'name: "TestAgent"', - 'description: "Test agent"', - 'infer: user', - '---', - 'Body', - ].join('\n'); - const markers = await validate(content, PromptsType.agent); - assert.strictEqual(markers.length, 1, 'infer: user should produce deprecation warning'); - assert.strictEqual(markers[0].message, deprecationMessage); - assert.strictEqual(markers[0].severity, MarkerSeverity.Error); - } - - // Valid infer: 'agent' - shows deprecation warning - { - const content = [ - '---', - 'name: "TestAgent"', - 'description: "Test agent"', - 'infer: agent', - '---', - 'Body', - ].join('\n'); - const markers = await validate(content, PromptsType.agent); - assert.strictEqual(markers.length, 1, 'infer: agent should produce deprecation warning'); - assert.strictEqual(markers[0].message, deprecationMessage); - assert.strictEqual(markers[0].severity, MarkerSeverity.Error); - } - - // Valid infer: 'hidden' - shows deprecation warning - { - const content = [ - '---', - 'name: "TestAgent"', - 'description: "Test agent"', - 'infer: hidden', - '---', - 'Body', - ].join('\n'); - const markers = await validate(content, PromptsType.agent); - assert.strictEqual(markers.length, 1, 'infer: hidden should produce deprecation warning'); - assert.strictEqual(markers[0].message, deprecationMessage); - assert.strictEqual(markers[0].severity, MarkerSeverity.Error); - } - // Invalid infer: unknown string value - shows deprecation warning (validation removed for deprecated attribute) { const content = [ @@ -1208,37 +1148,42 @@ suite('PromptValidator', () => { assert.strictEqual(markers[0].severity, MarkerSeverity.Error); } - // Invalid infer: number value - shows deprecation warning (validation removed for deprecated attribute) + // Missing infer attribute (should be optional) { const content = [ '---', 'name: "TestAgent"', 'description: "Test agent"', - 'infer: 1', '---', 'Body', ].join('\n'); const markers = await validate(content, PromptsType.agent); - assert.strictEqual(markers.length, 1, 'infer: 1 should produce deprecation warning'); - assert.strictEqual(markers[0].message, deprecationMessage); - assert.strictEqual(markers[0].severity, MarkerSeverity.Error); + assert.deepStrictEqual(markers, [], 'Missing infer attribute should be allowed'); } + }); - // Missing infer attribute (should be optional) + test('disable-model-invocation: false warns when customAgentInSubagent.enabled is disabled', async () => { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, false); + + // disable-model-invocation: false should warn when config is disabled { const content = [ '---', 'name: "TestAgent"', 'description: "Test agent"', + 'disable-model-invocation: false', '---', 'Body', ].join('\n'); const markers = await validate(content, PromptsType.agent); - assert.deepStrictEqual(markers, [], 'Missing infer attribute should be allowed'); + assert.strictEqual(markers.length, 1); + assert.strictEqual(markers[0].severity, MarkerSeverity.Warning); + assert.strictEqual(markers[0].message, `For agents to be used as subagent you also need to enable the 'chat.customAgentInSubagent.enabled' setting.`); } }); test('agents attribute must be an array', async () => { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); const content = [ '---', 'description: "Test"', @@ -1250,6 +1195,7 @@ suite('PromptValidator', () => { }); test('each agent name in agents attribute must be a string', async () => { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); const content = [ '---', 'description: "Test"', @@ -1276,6 +1222,7 @@ suite('PromptValidator', () => { }); test('agents attribute with non-empty value requires agent tool 1', async () => { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); const content = [ '---', 'description: "Test"', @@ -1287,6 +1234,7 @@ suite('PromptValidator', () => { }); test('agents attribute with non-empty value requires agent tool 2', async () => { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); const content = [ '---', 'description: "Test"', @@ -1299,6 +1247,7 @@ suite('PromptValidator', () => { }); test('agents attribute with non-empty value requires agent tool 3', async () => { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); const content = [ '---', 'description: "Test"', @@ -1311,6 +1260,7 @@ suite('PromptValidator', () => { }); test('agents attribute with non-empty value requires agent tool 4', async () => { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); const content = [ '---', 'description: "Test"', @@ -1323,6 +1273,7 @@ suite('PromptValidator', () => { }); test('agents attribute with empty array does not require agent tool', async () => { + testConfigService.setUserConfiguration(ChatConfiguration.SubagentToolCustomAgents, true); const content = [ '---', 'description: "Test"', diff --git a/src/vs/workbench/contrib/chat/test/common/tools/builtinTools/runSubagentTool.test.ts b/src/vs/workbench/contrib/chat/test/common/tools/builtinTools/runSubagentTool.test.ts index 61035aeab15af..fdc8346147587 100644 --- a/src/vs/workbench/contrib/chat/test/common/tools/builtinTools/runSubagentTool.test.ts +++ b/src/vs/workbench/contrib/chat/test/common/tools/builtinTools/runSubagentTool.test.ts @@ -9,7 +9,7 @@ import { URI } from '../../../../../../../base/common/uri.js'; import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../../../base/test/common/utils.js'; import { NullLogService } from '../../../../../../../platform/log/common/log.js'; import { TestConfigurationService } from '../../../../../../../platform/configuration/test/common/testConfigurationService.js'; -import { RunSubagentTool } from '../../../../common/tools/builtinTools/runSubagentTool.js'; +import { RUN_SUBAGENT_MAX_NESTING_DEPTH, RunSubagentTool } from '../../../../common/tools/builtinTools/runSubagentTool.js'; import { MockLanguageModelToolsService } from '../mockLanguageModelToolsService.js'; import { IChatAgentHistoryEntry, IChatAgentRequest, IChatAgentResult, IChatAgentService, UserSelectedTools } from '../../../../common/participants/chatAgents.js'; import { IChatProgress, IChatService } from '../../../../common/chatService/chatService.js'; @@ -502,12 +502,12 @@ suite('RunSubagentTool', () => { */ let callIdCounter = 0; function createInvokableTool(opts: { - maxDepth: number; + allowInvocationsFromSubagents: boolean; capturedRequests: IChatAgentRequest[]; }) { const mockToolsService = testDisposables.add(new MockLanguageModelToolsService()); const configService = new TestConfigurationService({ - [ChatConfiguration.SubagentsMaxDepth]: opts.maxDepth, + [ChatConfiguration.SubagentsAllowInvocationsFromSubagents]: opts.allowInvocationsFromSubagents, }); const promptsService = new MockPromptsService(); @@ -565,9 +565,9 @@ suite('RunSubagentTool', () => { const countTokens = async () => 0; const noProgress: ToolProgress = { report() { } }; - test('disables runSubagent tool when maxDepth is 0', async () => { + test('disables runSubagent tool when nesting is disabled', async () => { const capturedRequests: IChatAgentRequest[] = []; - const { tool } = createInvokableTool({ maxDepth: 0, capturedRequests }); + const { tool } = createInvokableTool({ allowInvocationsFromSubagents: false, capturedRequests }); const sessionUri = URI.parse('test://session/depth0'); await tool.invoke(createInvocation(sessionUri), countTokens, noProgress, CancellationToken.None); @@ -576,9 +576,9 @@ suite('RunSubagentTool', () => { assert.strictEqual(capturedRequests[0].userSelectedTools?.['runSubagent'], false); }); - test('enables runSubagent tool at depth 0 when maxDepth >= 1', async () => { + test('enables runSubagent tool at depth 0 when nesting is enabled', async () => { const capturedRequests: IChatAgentRequest[] = []; - const { tool } = createInvokableTool({ maxDepth: 3, capturedRequests }); + const { tool } = createInvokableTool({ allowInvocationsFromSubagents: true, capturedRequests }); const sessionUri = URI.parse('test://session/depth-enabled'); await tool.invoke(createInvocation(sessionUri), countTokens, noProgress, CancellationToken.None); @@ -587,21 +587,22 @@ suite('RunSubagentTool', () => { assert.strictEqual(capturedRequests[0].userSelectedTools?.['runSubagent'], true); }); - test('disables runSubagent tool when depth reaches maxDepth', async () => { + test('disables runSubagent tool when depth reaches hard limit', async () => { const capturedRequests: IChatAgentRequest[] = []; const sessionUri = URI.parse('test://session/depth-limit'); - // maxDepth=1, so the first invoke (depth 0→1) should allow nesting, - // but the second invoke (depth 1→2) should not since 1+1 <= 1 is false. - const { tool, mockChatAgentService } = createInvokableTool({ maxDepth: 1, capturedRequests }); + // When nesting is enabled, the tool enforces a hardcoded maximum depth of 5. + // Simulate nested invocation until we exceed the limit and ensure it disables nesting. + const { tool, mockChatAgentService } = createInvokableTool({ allowInvocationsFromSubagents: true, capturedRequests }); // Simulate nested invocation: the first invoke's invokeAgent callback // triggers a second invoke on the same tool (same session). capturedRequests.length = 0; + let nestedInvocations = 0; mockChatAgentService.invokeAgent = async (_id: string, request: IChatAgentRequest) => { capturedRequests.push(request); - // On the first call (depth 0), simulate a nested subagent call - if (capturedRequests.length === 1) { + // Keep nesting until we go beyond the hardcoded maxDepth + if (nestedInvocations++ < RUN_SUBAGENT_MAX_NESTING_DEPTH + 1) { await tool.invoke(createInvocation(sessionUri), countTokens, noProgress, CancellationToken.None); } return {}; @@ -609,16 +610,17 @@ suite('RunSubagentTool', () => { await tool.invoke(createInvocation(sessionUri), countTokens, noProgress, CancellationToken.None); - assert.strictEqual(capturedRequests.length, 2); - // First call at depth 0: should enable (0 + 1 <= 1) - assert.strictEqual(capturedRequests[0].userSelectedTools?.['runSubagent'], true); - // Second call at depth 1: should disable (1 + 1 <= 1 is false) - assert.strictEqual(capturedRequests[1].userSelectedTools?.['runSubagent'], false); + assert.ok(capturedRequests.length >= 2); + // At depth 0..(maxDepth-1), nesting is allowed. Once depth reaches maxDepth, the next call should disable nesting. + const enabledFlags = capturedRequests.map(r => r.userSelectedTools?.['runSubagent']); + assert.strictEqual(enabledFlags[0], true); + assert.strictEqual(enabledFlags[1], true); + assert.strictEqual(enabledFlags[RUN_SUBAGENT_MAX_NESTING_DEPTH], false); }); test('depth is decremented after invoke completes', async () => { const capturedRequests: IChatAgentRequest[] = []; - const { tool } = createInvokableTool({ maxDepth: 2, capturedRequests }); + const { tool } = createInvokableTool({ allowInvocationsFromSubagents: true, capturedRequests }); const sessionUri = URI.parse('test://session/depth-decrement'); // First invoke diff --git a/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts b/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts index d7ba992c32dcc..b2c7dbedd4af1 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts @@ -19,8 +19,8 @@ import { timeout } from '../../../../../base/common/async.js'; import { CancellationToken, CancellationTokenSource } from '../../../../../base/common/cancellation.js'; import { registerAction2, Action2, MenuId } from '../../../../../platform/actions/common/actions.js'; import { KeyMod, KeyCode } from '../../../../../base/common/keyCodes.js'; -import { prepareQuery } from '../../../../../base/common/fuzzyScorer.js'; -import { SymbolKind } from '../../../../../editor/common/languages.js'; +import { prepareQuery, IPreparedQuery } from '../../../../../base/common/fuzzyScorer.js'; +import { DocumentSymbol, SymbolKind } from '../../../../../editor/common/languages.js'; import { fuzzyScore } from '../../../../../base/common/filters.js'; import { onUnexpectedError } from '../../../../../base/common/errors.js'; import { ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js'; @@ -34,6 +34,8 @@ import { ILanguageFeaturesService } from '../../../../../editor/common/services/ import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js'; import { accessibilityHelpIsShown, accessibleViewIsShown } from '../../../accessibility/browser/accessibilityConfiguration.js'; import { matchesFuzzyIconAware, parseLabelWithIcons } from '../../../../../base/common/iconLabels.js'; +import { IChatWidgetService } from '../../../chat/browser/chat.js'; +import { ISymbolVariableEntry } from '../../../chat/common/attachments/chatVariableEntries.js'; export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccessProvider { @@ -45,6 +47,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, @IOutlineService private readonly outlineService: IOutlineService, @IOutlineModelService outlineModelService: IOutlineModelService, + @IChatWidgetService private readonly chatWidgetService: IChatWidgetService, ) { super(languageFeaturesService, outlineModelService, { openSideBySideDirection: () => this.configuration.openSideBySideDirection @@ -121,6 +124,31 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess return this.doGetSymbolPicks(this.getDocumentSymbols(model, token), prepareQuery(filter), options, token, model); } + protected override async doGetSymbolPicks(symbolsPromise: Promise, query: IPreparedQuery, options: { extraContainerLabel?: string } | undefined, token: CancellationToken, model: ITextModel): Promise> { + const picks = await super.doGetSymbolPicks(symbolsPromise, query, options, token, model); + const modelUri = model.uri; + for (const pick of picks) { + const symbolPick = pick as IGotoSymbolQuickPickItem; + if (symbolPick.range && !symbolPick.attach) { + symbolPick.attach = () => { + const widget = this.chatWidgetService.lastFocusedWidget; + if (!widget) { + return; + } + const entry: ISymbolVariableEntry = { + kind: 'symbol', + id: JSON.stringify({ uri: modelUri.toString(), range: symbolPick.range!.decoration }), + name: symbolPick.symbolName ?? symbolPick.label, + value: { uri: modelUri, range: symbolPick.range!.decoration }, + symbolKind: symbolPick.kind, + }; + widget.attachmentModel.addContext(entry); + }; + } + } + return picks; + } + //#endregion protected override provideWithoutTextEditor(picker: IQuickPick): IDisposable { diff --git a/src/vs/workbench/contrib/performance/browser/inputLatencyContrib.ts b/src/vs/workbench/contrib/performance/browser/inputLatencyContrib.ts index b2a4b030a6e7b..ea1143872e4f3 100644 --- a/src/vs/workbench/contrib/performance/browser/inputLatencyContrib.ts +++ b/src/vs/workbench/contrib/performance/browser/inputLatencyContrib.ts @@ -52,7 +52,7 @@ export class InputLatencyContrib extends Disposable implements IWorkbenchContrib } type InputLatencyStatisticFragment = { - owner: 'tyriar'; + owner: 'hediet'; comment: 'Represents a set of statistics collected about input latencies'; average: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The average time it took to execute.' }; max: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The maximum time it took to execute.' }; @@ -60,7 +60,7 @@ export class InputLatencyContrib extends Disposable implements IWorkbenchContrib }; type PerformanceInputLatencyClassification = { - owner: 'tyriar'; + owner: 'hediet'; comment: 'This is a set of samples of the time (in milliseconds) that various events took when typing in the editor'; keydown: InputLatencyStatisticFragment; input: InputLatencyStatisticFragment; diff --git a/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts b/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts index 8d449a07b3e76..50555781f9193 100644 --- a/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts +++ b/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts @@ -55,7 +55,7 @@ import { IKeybindingService } from '../../../../platform/keybinding/common/keybi import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; import { Registry } from '../../../../platform/registry/common/platform.js'; import { ASK_QUICK_QUESTION_ACTION_ID } from '../../chat/browser/actions/chatQuickInputActions.js'; -import { IQuickChatService } from '../../chat/browser/chat.js'; +import { IChatWidgetService, IQuickChatService } from '../../chat/browser/chat.js'; import { ILogService } from '../../../../platform/log/common/log.js'; import { ICustomEditorLabelService } from '../../../services/editor/common/customEditorLabelService.js'; @@ -140,7 +140,8 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider this.openAnything(resourceOrEditor, { keyMods, range: this.pickState.lastRange, preserveFocus: event.inBackground, forcePinned: event.inBackground }) + accept: (keyMods, event) => this.openAnything(resourceOrEditor, { keyMods, range: this.pickState.lastRange, preserveFocus: event.inBackground, forcePinned: event.inBackground }), + attach: () => { + const widget = this.chatWidgetService.lastFocusedWidget; + if (widget && resource) { + widget.attachmentModel.addContext(widget.attachmentModel.asFileVariableEntry(resource)); + } + } }; } diff --git a/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.ts b/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.ts index 84a3c98a42100..fb004c0bce793 100644 --- a/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.ts +++ b/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.ts @@ -24,6 +24,8 @@ import { prepareQuery, IPreparedQuery, scoreFuzzy2, pieceToQuery } from '../../. import { IMatch } from '../../../../base/common/filters.js'; import { Codicon } from '../../../../base/common/codicons.js'; import { ThemeIcon } from '../../../../base/common/themables.js'; +import { IChatWidgetService } from '../../chat/browser/chat.js'; +import { ISymbolVariableEntry } from '../../chat/common/attachments/chatVariableEntries.js'; export interface ISymbolQuickPickItem extends IPickerQuickAccessItem, IQuickPickItemWithResource { score?: number; @@ -64,7 +66,8 @@ export class SymbolsQuickAccessProvider extends PickerQuickAccessProvider this.openSymbol(provider, symbol, token, { keyMods, preserveFocus: event.inBackground, forcePinned: event.inBackground }), + attach: () => { + const widget = this.chatWidgetService.lastFocusedWidget; + if (widget) { + const entry: ISymbolVariableEntry = { + kind: 'symbol', + id: JSON.stringify({ uri: symbolUri.toString(), range: symbol.location.range }), + name: symbol.name, + value: symbol.location, + symbolKind: symbol.kind, + }; + widget.attachmentModel.addContext(entry); + } + }, }); } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTelemetry.ts b/src/vs/workbench/contrib/terminal/browser/terminalTelemetry.ts index 45914710aaa8c..efa29b29e030f 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTelemetry.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTelemetry.ts @@ -85,7 +85,7 @@ export class TerminalTelemetryContribution extends Disposable implements IWorkbe terminalSessionId: string; }; type TerminalCreationTelemetryClassification = { - owner: 'tyriar'; + owner: 'anthonykim1'; comment: 'Track details about terminal creation, such as the shell type'; location: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The location of the terminal.' }; diff --git a/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.ts b/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.ts index 047c59fab3975..f57d17407a34b 100644 --- a/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.ts +++ b/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.ts @@ -65,7 +65,7 @@ export class RunInTerminalToolTelemetry { autoApproveDefault: boolean | undefined; }; type TelemetryClassification = { - owner: 'tyriar'; + owner: 'meganrogge'; comment: 'Understanding the auto approve behavior of the runInTerminal tool'; terminalToolSessionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The session ID for this particular terminal tool invocation.' }; @@ -139,7 +139,7 @@ export class RunInTerminalToolTelemetry { inputToolFreeFormInputCount: number; }; type TelemetryClassification = { - owner: 'tyriar'; + owner: 'meganrogge'; comment: 'Understanding the usage of the runInTerminal tool'; terminalSessionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The session ID of the terminal instance.' }; diff --git a/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts b/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts index 4739f7e27c916..3d7614d54e66a 100644 --- a/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts +++ b/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts @@ -274,7 +274,7 @@ export async function createRunInTerminalToolData( modelDescription, userDescription: localize('runInTerminalTool.userDescription', 'Run commands in the terminal'), source: ToolDataSource.Internal, - icon: isSandboxEnabled ? Codicon.terminalSecure : Codicon.terminal, + icon: Codicon.terminal, inputSchema: { type: 'object', properties: { diff --git a/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkManager.ts b/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkManager.ts index 05446ea9f07d0..fb1496acdff50 100644 --- a/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkManager.ts +++ b/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkManager.ts @@ -209,7 +209,7 @@ export class TerminalLinkManager extends DisposableStore { this._telemetryService.publicLog2<{ linkType: TerminalBuiltinLinkType | string; }, { - owner: 'tyriar'; + owner: 'anthonykim1'; comment: 'When the user opens a link in the terminal'; linkType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of link being opened' }; }>('terminal/openLink', { linkType: isString(link.type) ? link.type : `extension:${link.type.id}` }); diff --git a/src/vs/workbench/contrib/terminalContrib/typeAhead/browser/terminalTypeAheadAddon.ts b/src/vs/workbench/contrib/terminalContrib/typeAhead/browser/terminalTypeAheadAddon.ts index b7d264ee0c84b..b5f0421b343fc 100644 --- a/src/vs/workbench/contrib/terminalContrib/typeAhead/browser/terminalTypeAheadAddon.ts +++ b/src/vs/workbench/contrib/terminalContrib/typeAhead/browser/terminalTypeAheadAddon.ts @@ -1428,7 +1428,7 @@ export class TypeAheadAddon extends Disposable implements ITerminalAddon { private _sendLatencyStats(stats: PredictionStats) { /* __GDPR__ "terminalLatencyStats" : { - "owner": "Tyriar", + "owner": "anthonykim1", "min" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "max" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "median" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, diff --git a/src/vs/workbench/services/actions/common/menusExtensionPoint.ts b/src/vs/workbench/services/actions/common/menusExtensionPoint.ts index e9e6d9d2cca20..1a80b0b1e3e49 100644 --- a/src/vs/workbench/services/actions/common/menusExtensionPoint.ts +++ b/src/vs/workbench/services/actions/common/menusExtensionPoint.ts @@ -490,6 +490,18 @@ const apiMenus: IAPIMenu[] = [ description: localize('menus.chatEditingSessionApplySubmenu', "Submenu for apply actions in the Chat Editing session changes toolbar."), proposed: 'chatSessionsProvider' }, + { + key: 'chat/input/editing/sessionTitleToolbar', + id: MenuId.ChatEditingSessionTitleToolbar, + description: localize('menus.chatEditingSessionTitleToolbar', "The Chat Editing widget toolbar menu for session title."), + proposed: 'chatSessionsProvider' + }, + { + key: 'chat/input/editing/sessionChangeToolbar', + id: MenuId.ChatEditingSessionChangeToolbar, + description: localize('menus.chatEditingSessionChangeToolbar', "The Chat Editing widget toolbar menu for session changes."), + proposed: 'chatSessionsProvider' + }, { // TODO: rename this to something like: `chatSessions/item/inline` key: 'chat/chatSessions', diff --git a/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts b/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts index e4bc845c46ad3..c7c1a7b45c2a7 100644 --- a/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts +++ b/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ declare module 'vscode' { - // @anthonykim1 @tyriar https://github.com/microsoft/vscode/issues/227467 + // @anthonykim1 https://github.com/microsoft/vscode/issues/227467 export interface TerminalShellIntegrationEnvironment { /**