diff --git a/.eslintrc.json b/.eslintrc.json
index 0644079623d..f44673cd1cd 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -196,6 +196,47 @@
]
}
},
+ {
+ "files": [
+ "**/vscode.d.ts"
+ ],
+ "rules": {
+ "jsdoc/tag-lines": "off",
+ "jsdoc/valid-types": "off",
+ "jsdoc/no-multi-asterisks": [
+ "warn",
+ {
+ "allowWhitespace": true
+ }
+ ],
+ "jsdoc/require-jsdoc": [
+ "warn",
+ {
+ "enableFixer": false,
+ "contexts": [
+ "TSInterfaceDeclaration",
+ "TSPropertySignature",
+ "TSMethodSignature",
+ "TSDeclareFunction",
+ "ClassDeclaration",
+ "MethodDefinition",
+ "PropertyDeclaration",
+ "TSEnumDeclaration",
+ "TSEnumMember",
+ "ExportNamedDeclaration"
+ ]
+ }
+ ],
+ "jsdoc/check-param-names": [
+ "warn",
+ {
+ "enableFixer": false,
+ "checkDestructured": false
+ }
+ ],
+ "jsdoc/require-returns": "warn"
+ }
+ },
{
"files": [
"src/**/{common,browser}/**/*.ts"
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 3bea8e7c076..b2e25927a8a 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -256,7 +256,11 @@
"browserLaunchLocation": "workspace",
"presentation": {
"hidden": true,
- }
+ },
+ // This is read by the vscode-diagnostic-tools extension
+ "vscode-diagnostic-tools.debuggerScripts": [
+ "${workspaceFolder}/scripts/hot-reload-injected-script.js"
+ ]
},
{
"type": "node",
diff --git a/.vscode/notebooks/my-endgame.github-issues b/.vscode/notebooks/my-endgame.github-issues
index 96c780e5a6f..6978af0b6f0 100644
--- a/.vscode/notebooks/my-endgame.github-issues
+++ b/.vscode/notebooks/my-endgame.github-issues
@@ -177,7 +177,7 @@
{
"kind": 2,
"language": "github-issues",
- "value": "$REPOS $MILESTONE -$MINE is:issue label:bug label:verification-steps-needed"
+ "value": "$REPOS $MILESTONE -$MINE is:issue label:bug label:verification-steps-needed -label:verified"
},
{
"kind": 1,
diff --git a/.yarnrc b/.yarnrc
index 8f658afd4a9..fff0be195f2 100644
--- a/.yarnrc
+++ b/.yarnrc
@@ -1,5 +1,5 @@
disturl "https://electronjs.org/headers"
-target "25.5.0"
-ms_build_id "23084831"
+target "25.8.0"
+ms_build_id "23503258"
runtime "electron"
build_from_source "true"
diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt
index cf52ca35c94..6863bf7828f 100644
--- a/ThirdPartyNotices.txt
+++ b/ThirdPartyNotices.txt
@@ -440,580 +440,6 @@ Title to copyright in this work will at all times remain with copyright holders.
---------------------------------------------------------
-dompurify 2.3.1 - Apache 2.0
-https://github.com/cure53/DOMPurify
-
-DOMPurify
-Copyright 2023 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.
----------------------------------------------------------
-
----------------------------------------------------------
-
dotnet/csharp-tmLanguage 0.1.0 - MIT
https://github.com/dotnet/csharp-tmLanguage
@@ -1345,27 +771,682 @@ SOFTWARE.
jeff-hykin/better-cpp-syntax 1.17.4 - MIT
https://github.com/jeff-hykin/better-cpp-syntax
-MIT License
+The MIT License (MIT)
-Copyright (c) 2019 Jeff Hykin
+GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
-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:
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+ Preamble
-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.
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
---------------------------------------------------------
---------------------------------------------------------
@@ -1454,6 +1535,34 @@ SOFTWARE.
---------------------------------------------------------
+jeff-hykin/better-snippet-syntax 1.0.2 - MIT
+https://github.com/jeff-hykin/better-snippet-syntax
+
+MIT License
+
+Copyright (c) 2019 Jeff Hykin
+
+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.
+---------------------------------------------------------
+
+---------------------------------------------------------
+
jlelong/vscode-latex-basics 1.5.3 - MIT
https://github.com/jlelong/vscode-latex-basics
diff --git a/build/checksums/electron.txt b/build/checksums/electron.txt
index f5c22bc1c23..9c46b2ad8ef 100644
--- a/build/checksums/electron.txt
+++ b/build/checksums/electron.txt
@@ -1,27 +1,27 @@
-c3fb8cb4804143eb25fce55a179a6f2df8c215ed709104ec235c96e357b20f42 *electron-v25.5.0-darwin-arm64-symbols.zip
-e6d2a09348d4fe7c9fbd92bf796489a95e625642f0f1ce96169212554cfa6841 *electron-v25.5.0-darwin-arm64.zip
-15c28e613dfee0f7e46a296bb4aed64e17f9644d7ef19129aeb6480b8da230ab *electron-v25.5.0-darwin-x64-symbols.zip
-a5c5c0b621daf8242258c89edb2387fbdf1c69125c984f8564d89b87927373e3 *electron-v25.5.0-darwin-x64.zip
-69d60a69b7f692b9069cdf9e518bcbaca9cec561f40199cc87196929936a34ce *electron-v25.5.0-linux-arm64-symbols.zip
-adec2ba09faf5f8d8af8997c8bed43c7712eba5546db1e7d06f8357bf4613921 *electron-v25.5.0-linux-arm64.zip
-0fe7a5d152c9c401671e02ebcd9da34ab9bb0c28598ede3657077a79f8b3e70a *electron-v25.5.0-linux-armv7l-symbols.zip
-eccb66e4a308a0bd2d90474894370e3d687e32f78672e6b5077c1822c7bc526b *electron-v25.5.0-linux-armv7l.zip
-82bd9bc9e66f8ae802fe48a51b8d7e2fb599403e9715fa4b859190200a7376b1 *electron-v25.5.0-linux-x64-symbols.zip
-485cbeb206fccfb4ed42f694100eebb80c9db6639b3537a95823c4fcb7f210cd *electron-v25.5.0-linux-x64.zip
-ed2c2a7da571b53bcb336b9a2a024753a272df82ece45df83df888df51bf1912 *electron-v25.5.0-win32-arm64-pdb.zip
-c316f6364e9b4cd61e19d4763c96abda7247a2c31ae7d30e81219c9a7754f11a *electron-v25.5.0-win32-arm64-symbols.zip
-582ccbfc5a85a093f5639ee476bb5fef18c2d25dab4a60e5f5cb47e64c99f7fb *electron-v25.5.0-win32-arm64.zip
-5776e650c23e3847b0c52d850f61c57a84a4fa30943c3cc82197250112911b5b *electron-v25.5.0-win32-ia32-pdb.zip
-730b429ad2c4cae0fe3ba9600a6ee86c79dada77976bac1c75ca2404993495bc *electron-v25.5.0-win32-ia32-symbols.zip
-7e6e68aa33a89c0d647575b06daf415a2401feb170ebb9cd795e221af321f751 *electron-v25.5.0-win32-ia32.zip
-0792665fda9255b340a829cdd24601887a2ca8f04cc49f9a6d4557db0c0cd2f2 *electron-v25.5.0-win32-x64-pdb.zip
-dc2459546951f8418e866857e9111dd83a0789d401906b2200c2f8dd59d9146b *electron-v25.5.0-win32-x64-symbols.zip
-9bf7980fbc024ba77ea8ab3e2d32088a5f69bf32506a7d2db72ede17028abdf4 *electron-v25.5.0-win32-x64.zip
-5b1ea601b737842eacf88d7456c4d14e697822753e9a08ede889cce9e20bafb2 *ffmpeg-v25.5.0-darwin-arm64.zip
-37bf5c75edefc0b6735b44d0b5b06fdd427179a8501f6e93df9840283cdb4a95 *ffmpeg-v25.5.0-darwin-x64.zip
-bd52d57ff97fb56ac01a3482af905d04f0d4e9c13c53858c6d9f99957eca82da *ffmpeg-v25.5.0-linux-arm64.zip
-9b3d09177fa1e63e2a6beecfa70aeec30aeb5c1873ff21128a68051c4e23f95d *ffmpeg-v25.5.0-linux-armv7l.zip
-edc7b1c9f1a0733f109a2c0375a4e40c5bfe0bf28b7f06dcc76e1ada0aa2f125 *ffmpeg-v25.5.0-linux-x64.zip
-2e28767b3570ea247869a20988cddd23af710eb994d6099404f123390cedeba6 *ffmpeg-v25.5.0-win32-arm64.zip
-715568eefd7267573a30186ade3de901587baeb1f013200d8ae50b35941b613f *ffmpeg-v25.5.0-win32-ia32.zip
-29876504452aaa505f696642178968e24b8dc8cc4b055071e6f0f3f073088acc *ffmpeg-v25.5.0-win32-x64.zip
+88cafda8394985e59d3d84cb4a6692ad04d8e32db9ecd6429e748e41526ddad7 *electron-v25.8.0-darwin-arm64-symbols.zip
+6e33d3b8041561722ed41777e055a8c15d3f4e61b67367b2618918bcf0cfea76 *electron-v25.8.0-darwin-arm64.zip
+438ac9915e062a239fb6d2595323c4783d2c820efc9cbcf3d2c1253d0e057e83 *electron-v25.8.0-darwin-x64-symbols.zip
+798907d2a66bc79202c8213c61e7fd147ae2a8c31c485d814950b11d43bbbba8 *electron-v25.8.0-darwin-x64.zip
+3243f3764319cff6c942d9f90a86323c36ec05ec51ef01e782c4e9a7194187e1 *electron-v25.8.0-linux-arm64-symbols.zip
+f24f858b76bf8a2e18419f62e0f891712b2fa541089123e9caa8d5cd67fc3276 *electron-v25.8.0-linux-arm64.zip
+dc3ff0489a0ebeda56d06b31eeae75dd7321a52bb601069c4475c56462b4814a *electron-v25.8.0-linux-armv7l-symbols.zip
+3b7a0c3899f828a5cf30043b73992e90231400b90c1afa700a44f892a55e326b *electron-v25.8.0-linux-armv7l.zip
+44803b2487406eca8fff9cec405e9e50bd92a911808dfaaa523b9ef52a0e72d8 *electron-v25.8.0-linux-x64-symbols.zip
+d54fb2df0ad7318240220aa26327171ed1e891fb296f3c27c58b8b487c4df8eb *electron-v25.8.0-linux-x64.zip
+bf7be6c0c8d0df06f0ce22e16c97aea823415d7f5cbf0ffdadf65d75feaf3cd8 *electron-v25.8.0-win32-arm64-pdb.zip
+5d91757660b44bf30907f9c2b52225ade4d127d0fe48dc83dec134cc06c949f0 *electron-v25.8.0-win32-arm64-symbols.zip
+d1e6f30a8d8c7aed28d08ddf915d79de6b16b3a0a7c84c45fd3cc0d47f2b7f53 *electron-v25.8.0-win32-arm64.zip
+e389fef61c14ea0eefad91a9725aa0afd4dbdc982f7b30aba97bd9c2871c2061 *electron-v25.8.0-win32-ia32-pdb.zip
+374d6c8897f97fab04e990ecf928e05f643ae33801546bf7d39bf4045b9d8b52 *electron-v25.8.0-win32-ia32-symbols.zip
+73fc3382202b70dcaf7928f09a791662de82c701b8f403ed72cc5aa9b1401593 *electron-v25.8.0-win32-ia32.zip
+010d248bd2e77585e1fa977e58b016659566de5a91c1e6845c85a7e6e1851bb9 *electron-v25.8.0-win32-x64-pdb.zip
+72adb74fd92edff35c177c3c5d96765f230bc7adb8af11b30d5122b9e54c26e1 *electron-v25.8.0-win32-x64-symbols.zip
+0051d0f241aedc6cdab4751c60f48758936122796f06c9e3033c7710a531686c *electron-v25.8.0-win32-x64.zip
+2956915642c45eb0099228368d0af50e891e4c10014fa4d3d3bcfb135fbb89a7 *ffmpeg-v25.8.0-darwin-arm64.zip
+099ee69d44f8ac3802cdd612895f279f7adb043a5b9c9d123479b0f96514a44c *ffmpeg-v25.8.0-darwin-x64.zip
+bd52d57ff97fb56ac01a3482af905d04f0d4e9c13c53858c6d9f99957eca82da *ffmpeg-v25.8.0-linux-arm64.zip
+9b3d09177fa1e63e2a6beecfa70aeec30aeb5c1873ff21128a68051c4e23f95d *ffmpeg-v25.8.0-linux-armv7l.zip
+edc7b1c9f1a0733f109a2c0375a4e40c5bfe0bf28b7f06dcc76e1ada0aa2f125 *ffmpeg-v25.8.0-linux-x64.zip
+a58e9480dab981ff973749e9d1e08936b2dd63a4b7f9523c030b1833387a4eb5 *ffmpeg-v25.8.0-win32-arm64.zip
+6866b23a4d561c0322aeb7690aae646718c54398739946e352bf80d0dd721bfd *ffmpeg-v25.8.0-win32-ia32.zip
+7b906df4ad6252881cf1e58619285b624f74d593379fbc6728e238b852d6abad *ffmpeg-v25.8.0-win32-x64.zip
diff --git a/build/lib/stylelint/vscode-known-variables.json b/build/lib/stylelint/vscode-known-variables.json
index a7d22a17b85..1fb81747019 100644
--- a/build/lib/stylelint/vscode-known-variables.json
+++ b/build/lib/stylelint/vscode-known-variables.json
@@ -757,6 +757,7 @@
"--vscode-sash-hover-size",
"--vscode-sash-size",
"--vscode-editorStickyScroll-scrollableWidth",
+ "--vscode-editorStickyScroll-foldingOpacityTransition",
"--window-border-color",
"--workspace-trust-check-color",
"--workspace-trust-selected-color",
@@ -779,4 +780,4 @@
"--z-index-notebook-sticky-scroll",
"--zoom-factor"
]
-}
\ No newline at end of file
+}
diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe
index 89c884f18a0..4f064aeb6f1 100644
--- a/build/monaco/monaco.d.ts.recipe
+++ b/build/monaco/monaco.d.ts.recipe
@@ -110,7 +110,8 @@ export interface ICommandHandler {
#include(vs/editor/common/diff/legacyLinesDiffComputer): IChange, ICharChange, ILineChange
#include(vs/editor/common/diff/documentDiffProvider): IDocumentDiffProvider, IDocumentDiffProviderOptions, IDocumentDiff
#include(vs/editor/common/core/lineRange): LineRange
-#include(vs/editor/common/diff/linesDiffComputer): LineRangeMapping, RangeMapping, MovedText, SimpleLineRangeMapping
+#include(vs/editor/common/diff/linesDiffComputer): MovedText
+#include(vs/editor/common/diff/rangeMapping): DetailedLineRangeMapping, RangeMapping, LineRangeMapping
#include(vs/editor/common/core/dimension): IDimension
#includeAll(vs/editor/common/editorCommon): IScrollEvent
#includeAll(vs/editor/common/textModelEvents):
diff --git a/cgmanifest.json b/cgmanifest.json
index 574ec75d24d..6b2d2bfff44 100644
--- a/cgmanifest.json
+++ b/cgmanifest.json
@@ -528,12 +528,12 @@
"git": {
"name": "electron",
"repositoryUrl": "https://github.com/electron/electron",
- "commitHash": "34be316c404e84cdd967fa0e10fceeb6424eed90"
+ "commitHash": "84d7f7f071ae11637d4a41b95536410293672750"
}
},
"isOnlyProductionDependency": true,
"license": "MIT",
- "version": "25.5.0"
+ "version": "25.8.0"
},
{
"component": {
diff --git a/cli/Cargo.lock b/cli/Cargo.lock
index 34627da135b..1e75e0541fa 100644
--- a/cli/Cargo.lock
+++ b/cli/Cargo.lock
@@ -735,6 +735,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743"
dependencies = [
"crc32fast",
+ "libz-sys",
"miniz_oxide",
]
@@ -1217,6 +1218,17 @@ version = "0.2.144"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
+[[package]]
+name = "libz-sys"
+version = "1.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b"
+dependencies = [
+ "cc",
+ "pkg-config",
+ "vcpkg",
+]
+
[[package]]
name = "link-cplusplus"
version = "1.0.9"
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index 50fad68a8a4..03a6f573952 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -18,8 +18,8 @@ open = "4.1.0"
reqwest = { version = "0.11.18", default-features = false, features = ["json", "stream", "native-tls"] }
tokio = { version = "1.28.2", features = ["full"] }
tokio-util = { version = "0.7.8", features = ["compat", "codec"] }
-flate2 = "1.0.26"
-zip = { version = "0.6.6", default-features = false, features = ["time", "deflate"] }
+flate2 = { version = "1.0.26", default-features = false, features = ["zlib"] }
+zip = { version = "0.6.6", default-features = false, features = ["time", "deflate-zlib"] }
regex = "1.8.3"
lazy_static = "1.4.0"
sysinfo = { version = "0.29.0", default-features = false }
diff --git a/cli/ThirdPartyNotices.txt b/cli/ThirdPartyNotices.txt
index ba85a27096c..09856f72402 100644
--- a/cli/ThirdPartyNotices.txt
+++ b/cli/ThirdPartyNotices.txt
@@ -525,35 +525,6 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-atty 0.2.14 - MIT
-https://github.com/softprops/atty
-
-The MIT License (MIT)
-
-Copyright (c) 2015-2019 Doug Tangren
-
-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.
----------------------------------------------------------
-
----------------------------------------------------------
-
autocfg 1.1.0 - Apache-2.0 OR MIT
https://github.com/cuviper/autocfg
@@ -1875,7 +1846,7 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-crossbeam-utils 0.8.12 - MIT OR Apache-2.0
+crossbeam-utils 0.8.16 - MIT OR Apache-2.0
https://github.com/crossbeam-rs/crossbeam
The MIT License (MIT)
@@ -1965,7 +1936,7 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
---------------------------------------------------------
-cxx 1.0.78 - MIT OR Apache-2.0
+cxx 1.0.97 - MIT OR Apache-2.0
https://github.com/dtolnay/cxx
Permission is hereby granted, free of charge, to any
@@ -1995,7 +1966,7 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-cxx-build 1.0.78 - MIT OR Apache-2.0
+cxx-build 1.0.97 - MIT OR Apache-2.0
https://github.com/dtolnay/cxx
Permission is hereby granted, free of charge, to any
@@ -2025,7 +1996,7 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-cxxbridge-flags 1.0.78 - MIT OR Apache-2.0
+cxxbridge-flags 1.0.97 - MIT OR Apache-2.0
https://github.com/dtolnay/cxx
Permission is hereby granted, free of charge, to any
@@ -2055,7 +2026,7 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-cxxbridge-macro 1.0.78 - MIT OR Apache-2.0
+cxxbridge-macro 1.0.97 - MIT OR Apache-2.0
https://github.com/dtolnay/cxx
Permission is hereby granted, free of charge, to any
@@ -3553,7 +3524,7 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
---------------------------------------------------------
-http 0.2.8 - MIT OR Apache-2.0
+http 0.2.9 - MIT OR Apache-2.0
https://github.com/hyperium/http
Copyright (c) 2017 http-rs authors
@@ -3725,7 +3696,7 @@ THE SOFTWARE.
---------------------------------------------------------
-iana-time-zone 0.1.51 - MIT OR Apache-2.0
+iana-time-zone 0.1.57 - MIT OR Apache-2.0
https://github.com/strawlab/iana-time-zone
Copyright (c) 2020 Andrew D. Straw
@@ -3757,7 +3728,7 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-iana-time-zone-haiku 0.1.0 - MIT OR Apache-2.0
+iana-time-zone-haiku 0.1.1 - MIT OR Apache-2.0
https://github.com/strawlab/iana-time-zone
Copyright (c) 2020 Andrew D. Straw
@@ -4259,7 +4230,7 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-link-cplusplus 1.0.7 - MIT OR Apache-2.0
+link-cplusplus 1.0.9 - MIT OR Apache-2.0
https://github.com/dtolnay/link-cplusplus
Permission is hereby granted, free of charge, to any
@@ -7734,7 +7705,7 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-scratch 1.0.2 - MIT OR Apache-2.0
+scratch 1.0.7 - MIT OR Apache-2.0
https://github.com/dtolnay/scratch
Permission is hereby granted, free of charge, to any
@@ -8753,7 +8724,7 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-termcolor 1.1.3 - Unlicense OR MIT
+termcolor 1.2.0 - Unlicense OR MIT
https://github.com/BurntSushi/termcolor
The MIT License (MIT)
@@ -8841,7 +8812,6 @@ DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
-time 0.1.44 - MIT/Apache-2.0
time 0.3.21 - MIT OR Apache-2.0
https://github.com/time-rs/time
@@ -9136,31 +9106,25 @@ DEALINGS IN THE SOFTWARE.
toml 0.5.9 - MIT/Apache-2.0
https://github.com/toml-rs/toml
-Copyright (c) 2014 Alex Crichton
+Copyright (c) Individual contributors
-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:
+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 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.
+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.
---------------------------------------------------------
---------------------------------------------------------
@@ -9357,7 +9321,7 @@ THE SOFTWARE.
---------------------------------------------------------
-tunnels 2621784a9ad72aa39500372391332a14bad581a3
+tunnels 3141ad7be00e18c4231f7c4fb6c11f9219ac49af
https://github.com/microsoft/dev-tunnels
MIT License
@@ -9852,7 +9816,6 @@ THE SOFTWARE.
---------------------------------------------------------
-wasi 0.10.0+wasi-snapshot-preview1 - Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
wasi 0.11.0+wasi-snapshot-preview1 - Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
wasi 0.9.0+wasi-snapshot-preview1 - Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
https://github.com/bytecodealliance/wasi
@@ -10272,6 +10235,34 @@ SOFTWARE.
---------------------------------------------------------
+windows 0.48.0 - MIT OR Apache-2.0
+https://github.com/microsoft/windows-rs
+
+MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ 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
+---------------------------------------------------------
+
+---------------------------------------------------------
+
windows-sys 0.36.1 - MIT OR Apache-2.0
windows-sys 0.45.0 - MIT OR Apache-2.0
windows-sys 0.48.0 - MIT OR Apache-2.0
diff --git a/cli/src/commands/args.rs b/cli/src/commands/args.rs
index bfa1c6f2da4..cbc33fcb071 100644
--- a/cli/src/commands/args.rs
+++ b/cli/src/commands/args.rs
@@ -52,6 +52,7 @@ const VERSION: &str = concatcp!(NUMBER_IN_VERSION, " (commit ", COMMIT_IN_VERSIO
#[clap(
help_template = INTEGRATED_TEMPLATE,
long_about = None,
+ name = constants::APPLICATION_NAME,
version = VERSION,
)]
pub struct IntegratedCli {
@@ -84,6 +85,7 @@ pub struct CliCore {
help_template = STANDALONE_TEMPLATE,
long_about = None,
version = VERSION,
+ name = constants::APPLICATION_NAME,
)]
pub struct StandaloneCli {
#[clap(flatten)]
@@ -173,6 +175,7 @@ pub enum Commands {
Version(VersionArgs),
/// Runs a local web version of VS Code.
+ #[clap(about = concatcp!("Runs a local web version of ", constants::PRODUCT_NAME_LONG))]
ServeWeb(ServeWebArgs),
/// Runs the control server on process stdin/stdout
diff --git a/cli/src/commands/serve_web.rs b/cli/src/commands/serve_web.rs
index 4a3af432444..2181c6339a4 100644
--- a/cli/src/commands/serve_web.rs
+++ b/cli/src/commands/serve_web.rs
@@ -10,6 +10,7 @@ use std::path::PathBuf;
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};
+use const_format::concatcp;
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Request, Response, Server};
use tokio::io::{AsyncBufReadExt, BufReader};
@@ -23,6 +24,8 @@ use crate::constants::VSCODE_CLI_QUALITY;
use crate::download_cache::DownloadCache;
use crate::log;
use crate::options::Quality;
+use crate::state::{LauncherPaths, PersistedState};
+use crate::tunnels::shutdown_signal::ShutdownRequest;
use crate::update_service::{
unzip_downloaded_release, Platform, Release, TargetKind, UpdateService,
};
@@ -48,6 +51,22 @@ const SERVER_ACTIVE_TIMEOUT_SECS: u64 = SERVER_IDLE_TIMEOUT_SECS * 24 * 30 * 12;
/// How long to cache the "latest" version we get from the update service.
const RELEASE_CACHE_SECS: u64 = 60 * 60;
+/// Number of bytes for the secret keys. See workbench.ts for their usage.
+const SECRET_KEY_BYTES: usize = 32;
+/// Path to mint the key combining server and client parts.
+const SECRET_KEY_MINT_PATH: &str = "/_vscode-cli/mint-key";
+/// Cookie set to the `SECRET_KEY_MINT_PATH`
+const PATH_COOKIE_NAME: &str = "vscode-secret-key-path";
+/// Cookie set to the `SECRET_KEY_MINT_PATH`
+const PATH_COOKIE_VALUE: &str = concatcp!(
+ PATH_COOKIE_NAME,
+ "=",
+ SECRET_KEY_MINT_PATH,
+ "; SameSite=Strict; Path=/"
+);
+/// HTTP-only cookie where the client's secret half is stored.
+const SECRET_KEY_COOKIE_NAME: &str = "vscode-cli-secret-half";
+
/// Implements the vscode "server of servers". Clients who go to the URI get
/// served the latest version of the VS Code server whenever they load the
/// page. The VS Code server prefixes all assets and connections it loads with
@@ -69,19 +88,31 @@ pub async fn serve_web(ctx: CommandContext, mut args: ServeWebArgs) -> Result(service) }
};
+ let mut shutdown = ShutdownRequest::create_rx([ShutdownRequest::CtrlC]);
let r = if let Some(s) = args.socket_path {
- let socket = listen_socket_rw_stream(&PathBuf::from(&s)).await?;
- ctx.log.result(format!("Web UI available on {}", s));
- Server::builder(socket.into_pollable())
+ let s = PathBuf::from(&s);
+ let socket = listen_socket_rw_stream(&s).await?;
+ ctx.log
+ .result(format!("Web UI available on {}", s.display()));
+ let r = Server::builder(socket.into_pollable())
.serve(make_service_fn(|_| make_svc()))
- .await
+ .with_graceful_shutdown(async {
+ let _ = shutdown.wait().await;
+ })
+ .await;
+ let _ = std::fs::remove_file(&s); // cleanup
+ r
} else {
let addr: SocketAddr = match &args.host {
Some(h) => {
@@ -98,6 +129,9 @@ pub async fn serve_web(ctx: CommandContext, mut args: ServeWebArgs) -> Result Result,
log: log::Logger,
- req: Request,
-) -> Result, Infallible> {
- let release = if let Some((r, _)) = get_release_from_path(req.uri().path(), cm.platform) {
+ server_secret_key: SecretKeyPart,
+}
+
+/// Handler function for an inbound request
+async fn handle(ctx: HandleContext, req: Request) -> Result, Infallible> {
+ let client_key_half = get_client_key_half(&req);
+ let mut res = match req.uri().path() {
+ SECRET_KEY_MINT_PATH => handle_secret_mint(ctx, req),
+ _ => handle_proxied(ctx, req).await,
+ };
+
+ append_secret_headers(&mut res, &client_key_half);
+
+ Ok(res)
+}
+
+async fn handle_proxied(ctx: HandleContext, req: Request) -> Response {
+ let release = if let Some((r, _)) = get_release_from_path(req.uri().path(), ctx.cm.platform) {
r
} else {
- match cm.get_latest_release().await {
+ match ctx.cm.get_latest_release().await {
Ok(r) => r,
Err(e) => {
- error!(log, "error getting latest version: {}", e);
- return Ok(response::code_err(e));
+ error!(ctx.log, "error getting latest version: {}", e);
+ return response::code_err(e);
}
}
};
- Ok(match cm.get_connection(release).await {
+ match ctx.cm.get_connection(release).await {
Ok(rw) => {
if req.headers().contains_key(hyper::header::UPGRADE) {
- forward_ws_req_to_server(cm.log.clone(), rw, req).await
+ forward_ws_req_to_server(ctx.log.clone(), rw, req).await
} else {
forward_http_req_to_server(rw, req).await
}
}
Err(CodeError::ServerNotYetDownloaded) => response::wait_for_download(),
Err(e) => response::code_err(e),
- })
+ }
+}
+
+fn handle_secret_mint(ctx: HandleContext, req: Request) -> Response {
+ use sha2::{Digest, Sha256};
+
+ let mut hasher = Sha256::new();
+ hasher.update(ctx.server_secret_key.0.as_ref());
+ hasher.update(get_client_key_half(&req).0.as_ref());
+ let hash = hasher.finalize();
+ let hash = hash[..SECRET_KEY_BYTES].to_vec();
+ response::secret_key(hash)
+}
+
+/// Appends headers to response to maintain the secret storage of the workbench:
+/// sets the `PATH_COOKIE_VALUE` so workbench.ts knows about the 'mint' endpoint,
+/// and maintains the http-only cookie the client will use for cookies.
+fn append_secret_headers(res: &mut Response, client_key_half: &SecretKeyPart) {
+ let headers = res.headers_mut();
+ headers.append(
+ hyper::header::SET_COOKIE,
+ PATH_COOKIE_VALUE.parse().unwrap(),
+ );
+ headers.append(
+ hyper::header::SET_COOKIE,
+ format!(
+ "{}={}; SameSite=Strict; HttpOnly; Max-Age=2592000; Path=/",
+ SECRET_KEY_COOKIE_NAME,
+ client_key_half.encode()
+ )
+ .parse()
+ .unwrap(),
+ );
}
/// Gets the release info from the VS Code path prefix, which is in the
@@ -258,6 +339,77 @@ fn is_commit_hash(s: &str) -> bool {
s.len() == COMMIT_HASH_LEN && s.chars().all(|c| c.is_ascii_hexdigit())
}
+/// Gets a cookie from the request by name.
+fn extract_cookie(req: &Request, name: &str) -> Option {
+ for h in req.headers().get_all(hyper::header::COOKIE) {
+ if let Ok(str) = h.to_str() {
+ for pair in str.split("; ") {
+ let i = match pair.find('=') {
+ Some(i) => i,
+ None => continue,
+ };
+
+ if &pair[..i] == name {
+ return Some(pair[i + 1..].to_string());
+ }
+ }
+ }
+ }
+
+ None
+}
+
+#[derive(Clone)]
+struct SecretKeyPart(Box<[u8; SECRET_KEY_BYTES]>);
+
+impl SecretKeyPart {
+ pub fn new() -> Self {
+ let key: [u8; SECRET_KEY_BYTES] = rand::random();
+ Self(Box::new(key))
+ }
+
+ pub fn decode(s: &str) -> Result {
+ use base64::{engine::general_purpose, Engine as _};
+ let mut key: [u8; SECRET_KEY_BYTES] = [0; SECRET_KEY_BYTES];
+ let v = general_purpose::URL_SAFE.decode(s)?;
+ if v.len() != SECRET_KEY_BYTES {
+ return Err(base64::DecodeSliceError::OutputSliceTooSmall);
+ }
+
+ key.copy_from_slice(&v);
+ Ok(Self(Box::new(key)))
+ }
+
+ pub fn encode(&self) -> String {
+ use base64::{engine::general_purpose, Engine as _};
+ general_purpose::URL_SAFE.encode(self.0.as_ref())
+ }
+}
+
+/// Gets the server's half of the secret key.
+fn get_server_key_half(paths: &LauncherPaths) -> SecretKeyPart {
+ let ps = PersistedState::new(paths.root().join("serve-web-key-half"));
+ let value: String = ps.load();
+ if let Ok(sk) = SecretKeyPart::decode(&value) {
+ return sk;
+ }
+
+ let key = SecretKeyPart::new();
+ let _ = ps.save(key.encode());
+ key
+}
+
+/// Gets the client's half of the secret key.
+fn get_client_key_half(req: &Request) -> SecretKeyPart {
+ if let Some(c) = extract_cookie(req, SECRET_KEY_COOKIE_NAME) {
+ if let Ok(sk) = SecretKeyPart::decode(&c) {
+ return sk;
+ }
+ }
+
+ SecretKeyPart::new()
+}
+
/// Module holding original responses the CLI's server makes.
mod response {
use const_format::concatcp;
@@ -287,6 +439,14 @@ mod response {
.body(Body::from(concatcp!("The latest version of the ", QUALITYLESS_SERVER_NAME, " is downloading, please wait a moment...", )))
.unwrap()
}
+
+ pub fn secret_key(hash: Vec) -> Response {
+ Response::builder()
+ .status(200)
+ .header("Content-Type", "application/octet-stream") // todo: get latest
+ .body(Body::from(hash))
+ .unwrap()
+ }
}
/// Handle returned when getting a stream to the server, used to refcount
@@ -515,6 +675,7 @@ impl ConnectionManager {
let executable = path
.join("bin")
.join(args.release.quality.server_entrypoint());
+
let socket_path = get_socket_name();
#[cfg(not(windows))]
diff --git a/cli/src/log.rs b/cli/src/log.rs
index a7561a37f6c..1180f2c82c2 100644
--- a/cli/src/log.rs
+++ b/cli/src/log.rs
@@ -323,8 +323,8 @@ fn format(level: Level, prefix: &str, message: &str, use_colors: bool) -> String
}
pub fn emit(level: Level, prefix: &str, message: &str) {
- let line = format(level, prefix, message, true);
- if level == Level::Trace {
+ let line = format(level, prefix, message, *COLORS_ENABLED);
+ if level == Level::Trace && *COLORS_ENABLED {
print!("\x1b[2m{}\x1b[0m", line);
} else {
print!("{}", line);
diff --git a/cli/src/tunnels/code_server.rs b/cli/src/tunnels/code_server.rs
index 5bc5e39514a..16655533754 100644
--- a/cli/src/tunnels/code_server.rs
+++ b/cli/src/tunnels/code_server.rs
@@ -14,7 +14,7 @@ use crate::tunnels::paths::{get_server_folder_name, SERVER_FOLDER_NAME};
use crate::update_service::{
unzip_downloaded_release, Platform, Release, TargetKind, UpdateService,
};
-use crate::util::command::{capture_command, kill_tree};
+use crate::util::command::{capture_command, capture_command_and_check_status, kill_tree};
use crate::util::errors::{wrap, AnyError, CodeError, ExtensionInstallFailed, WrappedError};
use crate::util::http::{self, BoxedHttp};
use crate::util::io::SilentCopyProgress;
@@ -416,11 +416,23 @@ impl<'a> ServerBuilder<'a> {
)
.await?;
- unzip_downloaded_release(
- &archive_path,
- &target_dir.join(SERVER_FOLDER_NAME),
- SilentCopyProgress(),
- )?;
+ let server_dir = target_dir.join(SERVER_FOLDER_NAME);
+ unzip_downloaded_release(&archive_path, &server_dir, SilentCopyProgress())?;
+
+ let output = capture_command_and_check_status(
+ server_dir
+ .join("bin")
+ .join(self.server_params.release.quality.server_entrypoint()),
+ &["--version"],
+ )
+ .await
+ .map_err(|e| wrap(e, "error checking server integrity"))?;
+
+ trace!(
+ self.logger,
+ "Server integrity verified, version: {}",
+ String::from_utf8_lossy(&output.stdout).replace('\n', " / ")
+ );
Ok(())
})
diff --git a/cli/src/tunnels/control_server.rs b/cli/src/tunnels/control_server.rs
index 6f8c1060e1f..45e0c9748ef 100644
--- a/cli/src/tunnels/control_server.rs
+++ b/cli/src/tunnels/control_server.rs
@@ -1021,6 +1021,9 @@ where
p.current_dir(cwd);
}
+ #[cfg(target_os = "windows")]
+ p.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW);
+
let mut p = p.spawn().map_err(CodeError::ProcessSpawnFailed)?;
let futs = FuturesUnordered::new();
diff --git a/cli/src/tunnels/dev_tunnels.rs b/cli/src/tunnels/dev_tunnels.rs
index b77f6da5f2e..e7b84ed4112 100644
--- a/cli/src/tunnels/dev_tunnels.rs
+++ b/cli/src/tunnels/dev_tunnels.rs
@@ -212,6 +212,7 @@ impl ActiveTunnel {
const VSCODE_CLI_TUNNEL_TAG: &str = "vscode-server-launcher";
const VSCODE_CLI_FORWARDING_TAG: &str = "vscode-port-forward";
+const OWNED_TUNNEL_TAGS: &[&str] = &[VSCODE_CLI_TUNNEL_TAG, VSCODE_CLI_FORWARDING_TAG];
const MAX_TUNNEL_NAME_LENGTH: usize = 20;
fn get_host_token_from_tunnel(tunnel: &Tunnel) -> String {
@@ -635,7 +636,7 @@ impl DevTunnels {
"Tunnel limit hit, trying to recycle an old tunnel"
);
- let existing_tunnels = self.list_all_server_tunnels().await?;
+ let existing_tunnels = self.list_tunnels_with_tag(OWNED_TUNNEL_TAGS).await?;
let recyclable = existing_tunnels
.iter()
@@ -667,13 +668,15 @@ impl DevTunnels {
}
}
- async fn list_all_server_tunnels(&mut self) -> Result, AnyError> {
+ async fn list_tunnels_with_tag(
+ &mut self,
+ tags: &[&'static str],
+ ) -> Result, AnyError> {
let tunnels = spanf!(
self.log,
self.log.span("dev-tunnel.listall"),
self.client.list_all_tunnels(&TunnelRequestOptions {
- tags: vec![self.tag.to_string()],
- require_all_tags: true,
+ tags: tags.iter().map(|t| t.to_string()).collect(),
..Default::default()
})
)
@@ -711,7 +714,7 @@ impl DevTunnels {
preferred_name: Option<&str>,
mut use_random_name: bool,
) -> Result {
- let existing_tunnels = self.list_all_server_tunnels().await?;
+ let existing_tunnels = self.list_tunnels_with_tag(&[self.tag]).await?;
let is_name_free = |n: &str| {
!existing_tunnels.iter().any(|v| {
v.status
diff --git a/cli/src/tunnels/socket_signal.rs b/cli/src/tunnels/socket_signal.rs
index 2a2df6607ea..53e6cd51567 100644
--- a/cli/src/tunnels/socket_signal.rs
+++ b/cli/src/tunnels/socket_signal.rs
@@ -264,8 +264,8 @@ where
#[cfg(test)]
mod tests {
- // Note this useful idiom: importing names from outer (for mod tests) scope.
use super::*;
+ use base64::{engine::general_purpose, Engine as _};
#[test]
fn test_round_trips_compression() {
@@ -287,4 +287,26 @@ mod tests {
assert_eq!(decompressed, vals);
}
}
+
+ const TEST_191501_BUFS: [&str; 3] = [
+ "TMzLSsQwFIDhfSDv0NXsYs2kubQQXIgX0IUwHVyfpCdjaSYZmkjRpxdEBnf/5vufHsZmK0PbxuwhfuRS2zmVecKVBd1rEYTUqL3gCoxBY7g2RoWOg+nE7Z4H1N3dij6nhL7OOY15wWTBeN87IVkACayTijMXcGJagevkxJ3i/e4/swFiwV1Z5ss7ukP2C9bHFc5YbF0/sXkex7eW33BK7q9maI6X0woTUvIXQ7OhK7+YkgN6dn2xF/wamhTgVM8xHl8Tr2kvvv2SymYtJZT8AAAA//8=",
+ "YmJAgIhqpZLKglQlK6XE0pIMJR0IZaVUlJqbX5JaXAwSSkksSQQK+WUkung5BWam6TumVaWEFhQHJBuUGrg4WUY4eQV4GOTnhwVkWJiX5lRmOdoq1QIAAAD//w==",
+ "jHdTdCZQk23UsW3btpOObeuLbdu2bdvs2E46tm17+p+71ty5b/ect13aVbte6n8XmfmfIv9rev8BaP8BNjYWzv8s/78S/ItxsjCzNTEW/T+s2DhZaNSE5Bi41B0kFBjZ2VjYtAzlzTWUHJWtJC2dPFUclDmZPW2EFQEAGkN3Rb7/tGPiZOFoYizy/1LhZvnXu6OZEzG3F/F/duNf6v/Zk39B9naO/yAuRi5GHx8FeWUVQob/JZTEPx9uQiZmDnrGf5/pv93+KeX0b7OEzExs/9kALo7WDBz0nEz0/wxCAICJ/T+QmoH6v0V2/udCJ2Nia+Zs/i8L47/3f+H/cOMmNLS3t7YAGP6HLIM7nZubG52pnaMN3b+kJrYAO2MT4//IGvKquY+4Oly7Z01ajWRItkE1jacYu9tcSU339/OnBkYgUbBD9rHonA9pvJV7heYuoFUpRcnKi8RwoJrSkW7ePD6N3ANHPr1UW7wPu5907dLnd4hlXwziROJkDgejfKv5ztZzPgXoUaEPEsM6y752iLyMJdkKwrSo+LAiaFp4HSRvSAnMT2Ck9JHIyQNuaFslDhaLQMIP+B7AGRyZFXeqpFF8HvfFVkQHqGejNjdizFvRHkndAl8AtfEqRHfxPFAit0twsNMyaONmusi/YHvmbQhpTRnyOV0gg+tXzisWmDsLBFAutCcGRHR0Cigere6p3A7NDGmBxHAZSmK/LGHKCeyUqN9fyBIUmyCtV99ptMaQWt4KAny5Fg+nTU1gBvBq4RvHlGCF9WL+2ZxKDfB2gr2GQaUY76Tv7x79VKbxwC5GITg2q02XPy6ZNFnLryVCGskiYPFPQLAsU+LrTvbyQTk7KNUFHwzBUTP1MiKg9LCdWAs8BZx3FHYaJyvIPw4nJpUAP3rP8GPdJeb3iIJ7i8xf15F71iT47rNv+qCXaQD9NBo8PcRVqnEy3vyrPG5SO8HwSDk9PhQJe2xo4Q52soIDB3v1jYYmR8ZkuoNq3Moy6BDjR1WBCTFJEHjdSSADxzRJ2hnozSOLmzTLuKgwWnFU1aGpQ5S8Ry7ME7gVb+CwnFvVtrpofL+DXvE3CY9Fhqe0y4Sq1yLyn/vcgA7ShFG+QnTB5zaKS3Ndj6LSCxwiNivY9R9TsAXobw4Exqog7xCAjYxNIbDuo/fC1QKpFUzvxw+7Rjc8J2lJg80YveK++I5fqJVAFu0Gb4SuJAd8ernBkpyy9lbou0enEfQMOjjucNiy+rgpU4pl+ERgt/Be+8G9l0RbeUwthLZp4ARnBHAB2mcB2o1cJIbhXnMiYStLmjwI+i+NOhBvRV8nmAVslkGdsEVU6Q3hYy/cT/QRTbEF0W58bkYPCyx93ESp7/sWkTG5i9GInCwW+zw1NIRfi2zkuz7KIzOlg33b5/R60L2tjlPtcLjZYL9qGWXwgPApKkndbDq0HhRCQYTyEZ1nC4MFi9NuasFm4t4UV4/W4L0A8YwsXH2m8Rh7hl1No5oIIlAGi5Er/amKw5mAA/Hvwbzfd4TGx66MHWA9t6NAA2WPx538griN7LCqE2315o09fNbOumI6fM1CN0AJT2FheQgaG4tdPFPn6uAeDXUDT8OkTdRFNi6Av4rwo6NnyfLnLYxBNdAhHs75bAedI5egbRrWLC48JT7aKsV+VsOmLsk0TGh6ISxI3WzskVbVFr6HGLy8jee1ZiMF0wzd/B4LvlyGIMa6HD+JBsGOH6vukgqV7ywTl6P+Wo8mTZHo12d7u09Z59eyXJcZKnqY4YzEzGUrlGzvO0Rgfgsse3RMPWJSpsETWqo5zMTtzYk9HANeoA5ubNoO/jjtLyModk/iH6XLiFD1591q+nXNb3Ve2v/aHlJQQYaytpOULvnsEYGIQH9+y3eK1Rgqgs7fxD3uzpv06A/afiToieIJpbjLhy3JZBEAmtN5UgJm6SuCbqgKJ+fDsuwMp/m0fCNVqrYORcBpKTvIWFzWF/leWJntKUis0dPrWy5x7Yu2GhqJh3GN2bT8w1uIh1haSlBmhMOzV3yNUmNcjqFV+GziNt6twoPDJ+4m7TE7hP2E9mEhiYihUDjT0X2Q4k0GIqdIl6fpoFPK0zdfRfbEkP2Ulr7fzfVqCYp9iuxtZFqBafBWLNHVjYtIn9/Z6Z3mP8DBfOYrXbMXldLjKW6rHr3w/LACe+LINkxcxQ9rxxBffepkhhj8NQ7vpyXpudfYmfPMsnai+b5VI5QMcyZly26kxMo6KGGilNYyX/hLaowV4GjIEY7kHRCNmJIBNevb1ag4w98wLWMtfyPMLn18o9cFKiJk2kjZmRBFh0S0Bd7AjxiNO8YdDQ83lBGS5JrxmLG+hW2oGYQllWS2UjK3+loONmC6NpPNgUiNhDQ05s24iRJZ/bzrgBskPLGukoMu8NK8CQNKZE8zzmsCrnkU53iPeZd/UT8ox6WMMZOtDv8YyQpTmhbzXCQW9ogbfgqH447dJFZuPkT4MGfKw+0c5L6aLWqAadBU9yLftFVsi8GZOSB9Ctv9/fJZ5SmlNgt25uGvspB9y1PQGEmLQyjFiGK7kveEw4Knn9lv/9GV2YlCdeRTAUyOS56k6G4ajfxNtMHPaDqIWTM1yBem3dShwkhD0nMXit14/wHRHosy59T+nkuvxG1MbTx8GJM45rvrOmUW0nwxNNdsdqFCNPWn+GcYzIdwCNFtHmdSKNOecfZZVJnKzuGbs41wRQIkv1E1p6ITiPxv+zKWflEU76wHOPrDx4rmyw3Z6MqaP316eOcW43JwBvp9hJuMUHr0TFkvjd5KzvmUSrZfYvpPZ2humVwOsjChiFzc7aoBMt8MdXyf2LIhuhBAg8Ue3wLqlg3cEYBS2z+uzrS5bJzmzH3NGmI+M/WbHOkbqcNtSoZjwp4NI5bSpCKWs7BqrK8sfsUC+UpA08Lfc4CpcBmsTyuHncO2gLc9jPMT+SBAgiZxTDncaiM+YG19ntqYSttys+jpASZDwEWjYRN8QURClAIs0G0KKoY0jjWcc0rypYXiCsHD9+kjtnYJHuzeZw2GQ5U5j7acLM8nyuy8bSJaKZXFq8TJkQ/p4lSkKHpVQPi+dWF4jYaQFEGiPAuiLOGzOE/f8B2rePs9zps7QivUyIiM8fsbPx5mwaC7FbjdihjbM198akLx99SpXAF4fh6d/xwLppw2kFrKa0UsTa/emTuV+6l2/8WmVWLd8JJAhcE+qbMrJBrohgGdDNZIRxJOrsFCzSmu2ykTCZnZlPITlbK/hUA/+DwdtJbmzKczEWAS9ENNbxHNSbn4Nqsz0yvhUE2a/FT6tvnBbXm/X2yLQQhxuVyNCsK2TeUNifqlsCEAJAALqqNI/NX+owJEAk+KehT/fpCsXGTsT3kFsUiPNWAkOEuHviK3Nzpu53edKRZgInWOWhGnd8aD6k7kio0tLT8i/PkxVrdZftlNrqPZfiEXkqX3hM526HzLGVzlr+CvTBKxsU8ROxHvBGWzJk4Tt0uDhZessy5BDFVx2xiYxMTXfQyv8NF0Op3CKCFvH1KbE2Z2TGCvpOEH7LKVK5TyTVSP+yah8TkpL1cHorIRxz2a5cMNMZGgdooqszII7PJuT3Ii0GpCCXe3v5mzysGhVKBulynWOeMrlJ4jKA4xzAXIg7ReLCGOntAOvU7qD+5UBufLWxx/3cqhuMcZDnR2dUjJuFG5LuFiwnvboFRMjVTvVJkcNdUc7b+0auIQWC1E3hTQx422OCMuGvayP3WMCGe8IClwSw4f1uA5LkoDYZbVQo1SUzETYNPQUK5BTJy7YRq4ln9vLvDHDImNd3TiWnsL7Zp9qWVSSTfSVSyZTT4fJqKIZ/Kcy7IkXFyv0Frw64R7y0vM+tAu+0kebn9y+DlN2xmi7nmf81iI1xffS5+ehMzQJTIa8SjVc8kCf14eOLiR7TgCnHcJieDFQI9r9K9co2G0hpitdihrbb56XvossnHl8Fu4JRLBPgKXsAQyX3v3BUHuw42rmeQXz74oZzmEIG13oteilg9HOUyoR5NHE94cYtIqP80qheAh9uQA9e3+TSmiLy6dsU625mYOYcPixVm9ZYuiOtLWQ3tT8j2T111qqjqNu6yUSxlIAh0+ANUEhEh9Uoj9v89/WqlGXNWPDmKfRtn+yFVoyggl8PjW0GB7qfreaEuoqouCGoV+lWma6sNZyKYQGIn51nzIyO1uUlRQZq5j8aTQgcXlNYi5rXALJ2Kj8nEbJT8OqXEt0fbWPKaLQZch23yR9RLyaXMpTIzzRBkoFY5g0MfTWFLbcMynydkZITcfLTSDeD/fxSqUzWmgjk9j1aQ07KUBInTRErSbfEhgCVikEENWXpOubo3XV4YBv9CJYSuXnSv0d3jLQdHefqwT7+Gyqy0ZJYicFYw3ma+acapIZw2r4qg4BNKbSbkMKOuWidsr1dxjS9bjSYoNH/VDBdbgXpXTpPJosDIjwMHsV48OfhwZjvnAC0r2yJ3+NPhBP4g/GU14mpdefzvR08OElSHLpZidGsL5GGtpzcohM5sQ48TMsOs6Cy3vvgKR1oanGjGa8dRN+UaaAWm1dieSOjvXzIIVPp3zoKEgVu9zlP2W5NtNSVDfceVy/cA2IFjOlKa5EiLEEA57fuxvGmOvxCB+ZROvg6KOi6EbxLMylQEbvzctlbmEJ0S32x1usYisIWFfCLX/SEETVFuAxZJej9AcvkolOkSLNlohZdKzOYeRMfQM/RMT4JwSfFqHgIq4XeYPtTzMO2ZkTdOjdrrWL0ZMFosuXiKD/9qKKbo1FjqjwiT5a4uIaPdU95J52kiPoS7adOxUFiypbB9SrLFTABESJrPr0qMSVCi9cMME+Vt2Qq9gYFIvXoDRAR0SP04c/2A1r/tvxBu6JRGDB9cwYWOE1g8W+W/vju6WwPvifEO4AQ+KD3bGEhffrUWM1SnsAZBbJOgep/M1iU/HX4uNGb6Dmz+0PQdJAo7TkA2D+Wigyb9CQUfK16vwLvIIvMnylTcOOIAUtbiy2/lcdbmnQcFMt7ZZLQxBemf8S5L8jkyl1WLZyVNGDm5qf/72TQLs6KK4ljCJqMt0F6p8tidu/52WK95lYzKiZy6nlOSKadsCEWX5+eMzpJu8ZjYF5Qf1K54q5wO/T4Y+QYoWlUlXB6MoL0adwXmSs5T7Mht+6k8BO7T5I+3iI54WdYwixTnvlI/TNQSjwGJdxqJOmInihyKgkCx1lUyn/fx6jKZ+1MHPZwvfOg5V9TuCf+aXvjVhcgJHJBilS8ytrZh8FQh23yNbEIMoE6lYyWuYdSKv6831VdffGAP6gvaD3d9aUBJRkHquA1iqVB/ZG+bcJLpeMFJagd95AvGXUIuYwFKFmBtlKkjOuiEbKNKxv+SJ/NQCIGRBxVkm6oqcabuFnskNEhB4FnYnplnCIUZEfsuLirqsm6sSQZ2ZITdUAkmQ308cj5051V8FwogjNmZJyYuNNsOxYzumG33B7Z5k6QHkr2HC4aky5ZHP2bW8quZNaSXEcL5YGfZeTPTOVCv3TA+e4NLZeVocXTUYNWe7pyYjaf6EUeHdXOAMpZk9084KP8PBCwnlNfiZG2fXD+36bvn8sOVcsLvwAT01LEmVgo2E0geZqDPd8OIHJxDVB7VXNeFYIKjKgOjT63Bq49GLdBmwOlTKDljg00eYqLTQO66FPzSTWMc2EMGCae7sVr/OluTg/T4NKFt39gySNurVvPtlXZfqCo3GfCiyTV6iZWeuVMh69PrrozqgCX0mHJ+OyzMtQrTbqUB4BvHZe9Bfo/uyBDmRDWV0vTCz1mz0t+DTOjRkjEiAOFOKSQ5w/L3RgIwmuEgW3kqaQqtwAFIfWb9PxNuLvTLGMttZ3yO5P3aYl9G6jCSrrcr+3m0ICKOTBu8lH/lonRkZOq/08lpP5VtCEak6I+aSIT9tP9LJIZACn/IUe7qE88kjETKmnZT6F1D/1p58pEA0NI4g5CtdHlSXmg0s+zhAKS7tYpvNx96EPw5cCc5+VneGb0RDNvLaa+cEF4M/JuU0PcA9u9gu+PC+byS52tGqNA8yuH7El6JwFI8dXUvX07iAkC2VOvtt4kg0aeiHDyPHJpvvN4TaAH9Bz+WT5FDWNTAz4LC79GO6pQb9j5iojBlt+UUHvr8nfZN6AKa57RMsFTt9m0t0eBVUqR5fgpE/k6+57U9FtAQPZ5ufj66n0Ys1Chyr93K5jhX3GM64JjdryhghfffO150Q+hYrX3a5/fo2ULWBM27UoViPGVCFtmd0Yw1V5F+l8j58Mck1yUYxpU6tg+o1tara6THtW91V2dqC0+ha42qUVZhScMys1ygeqrpwVTvfhsaVH3/e0xXB7cO4UYkBg1ivB9O+90jwFfg1noBWOg7JpyGvPzYuLPz1CzNtVCqtRpqhMbCu4e2xQ++w8gJGD87TjODSjvgsXoDOs/Fs2qzhSatxvKrnW6pmKqwo9j4B12XZ4Sc+4oE2DIquGY8iyYrp9oBkSCQ8kOIkYVD74yj5C+Y/+JkFNVPwwBvarswkuyZUp8gjHCBLFkf0l+yBDWvJ/jZBXyUFSCGDIrpl1USocwndJFH5zst9/ZyaiKGKEO2nEBAuOCo1XTAyPLIjonN2pH7c01ySgFXymnEV0K0UGq78eDfUtxpmcGLtK+75NVraVGD2wNVNrpWJl1al+s+CM4OvabLcM6VnweXcGciDFRmghhWVoE4EqnhFUuFxCB3umtoyn8lKuEy1fmrRsweDOMtUNd0qA6IctHwIM0AOX2Sx0KxqjEhpp+YkfStkyLrzC33yJbUqRbgkDGq1fKfJDAdenpfQOVj6VMCsB208bbzJUcGOWzZtvfnETOnRLxb4LddrcPuP91CawvOVuAphNrIEUsiRon1SrCuL8GVF75tbSHcskqjIVLfycIZlvVjlywu9gBptiORxw/e1CZ7bDeKlTTIK67KQqosSEs1fnc/X0aAxlkqaOEZQdefKhrABuZFa/KTPRhQsFSncg6wI+niscy0rjfkkvg5fe4c17WCpa0eXot7t+4ot9O5+v0H/buYYniE4MzfrsDnJhqu1tLt1z0dNQ60Qz/8RxR7461d9KxJaNTelFLXDQwDHcTCBSk+0BrJVKT9Ls0bHgxr0zDoaDnbnlXjuu9+I+TH6sZYee1kDBqfPV/RKaXBx6yCFxEBosyCqvwmiuHUzItjvCMSpgREhM861FtvcyaGbN1+nFgM0NlPJQdpqz7bpEJcVw8HFp0yAAT61uYy8m51btG5zFKE74t+qEpjkQPOxPzxh52MDHVgMT0vIQcdA2GGXmjLInOlKHy44blBXKhSsvnWk6goe3xaY/vatI9iOJP0zdmqYuV/Z82spbMuwMwDVEEqrn/KPXqWl0G9AIAPPSA/DO5U9NZAn8nW5CcnB359CkSxVmBXbPBph/GvVrjZEiohjaAfRzdYgSBArwPcIhmfsE3ankfWrXOiw0qJgH4UvOuQphVkNCTIDl405MQMo+6Usm6YMkKx93V+wFSt0l6zoNYeELrp5hNwWNc35EVD0YJegiTIgVDqJykV3YM5po2UCDF4a1Ijhgu+mWL/+B3K8OcvmsGG8X/tKBCNPK/0jJT6PKfks/NEJDkcRcfm1ZDp9AFzldq53UZoT4o4zhRSpLA+f6VTIJx4/t78vpyZKMEJmc8RbIp/swFrbSGInwW4NCrovIK+oS5Z3zXeNbGSpuf2oWYAtpQvttaM2LNl4svcEwxvYor7JMy46l1f2SB0Q0PXLIehirHvMLhbfdWLQw0QB7Gq2O0khxvT1LjZ+H+euX7uZmkY9IvXdW0pnDhaNmZKT6nKj9K1bcLT3520W7lrdOzlEMHxtoSMMd9u2LtEkdtO0KIyfVvkXReY+ilkTyBUmcRCEWl27pABXdcl9jZn6A/16Ze1Lv9SFRncN42vpbOS3xkIBPtFwaDftP6IZLtchcxmj3xkeJFH8fFKg5f06HvCjPbxR3US46FTJqo49yM0H1L8wOjSC8wYHb4Mo6Zhh4i48snY9IOVfrIGqFfTsTQ5kxIctBPqGnMO7dl+iu4TUqeHkDk2IkmZSNjB7hp0mmLHKcTAB49JQDsZdlPlcOeADP/r7q/I5vXE8ZHzXqFmxW9v90+JMckU0V0AIrcJK9IQWl4LQR+dRuKRxJwDpy4wa4ymhqnBdjDMqQ/cetUExuVkzntiCPyOz6dMpAx9ZeidxQ02hYjPVqgFg8sCl1lTHTulvk7Nj698usBJMG+IKJorZp7+a97Tr226dW1h++Ic3ERIIDuFrJVY0UvO/vrTZrxZbzT2Ki+UvjN5Ins+P6gU7XLKlAlh4h3u54VXMJO6MqqpSFKXQlRY2fOOn/m5YDfOCvjmhsmrp63Wz9s+kowNsciO+DZa5Mce5qH9/ysvEHv7Sgb3AIZ4+zl1R9px1bU2HI/tcieQUvHkNG0N43uBelEbsrZTfVDAsk7KashZp+QG9k91BWuxlN00Hmaqd3foNx2EwoBe14MbFyJKr0PLJvFrMBQamhlWX31hknK3y9m7F3cIopvO2kIngxuVgZ/c3XOMnJysZcmgeVvouinM2GCcJF5k54InnSO0JJ0g4taICxSdD1NbXw4aVfuPXY2loCOKwXAsHW+vRvIu5yBYsAXeOX1J7LwWwVHOTLjQDRyIwgAsot1J4dr3tRO1u3s72SospfgKrMJdMYtrSJ6zvRQTEDXZcyk3fqtElG55syIjePTyPVPDGCGHVvaqOCWvYDXnsFAy9L3gVg8HaLMerTRuSzj6HjRmyZNheBBZkDOTRmc6yaJVhK/+NCpXgPsW3xyAX6ZGQ44NOAyn9U49Jz5VIUpEfXTK/hDaJeMgl/HmLcfxbBara5U+J5xi9IvwTcMMzxxN/sm/BjLc+34gP33ChIncbfHleQbbQvS6JMkySTA2PCbI/vwYonIZnymVtA3c4fC5zso+ZgTyvnxZkeJdDRPjTUtP6DFIAxMbIotg2e93CXfUp4ciADmTWa4IbuP3n602bqsqzTldZAt7UzolvY0gnTcmZWJC8dCoZhebkdcf9hd+jW/HdVo/YM6s39d1Mqm7PnG2dsXFSCn+yg1redbnDTPpUVi1+T1xd6dGeM7GddroA/qyNLl9dvdvCUGQvRL7BIFQFUZYXRdx27OAStt+iqORvuibZWfLufrRJVM6AoyJNpRo4rALSdtAcfW8d4HJGPEaP1cxl6ErnQz+yDbv+zRMTFCJiuPTJRDXD+ir8hz+eChUN323YpgVJ0Qjl9oqEj9H3SKORfnFaq0337C3oyz0eQ5PedG/d78nJzRP+BfQIOFMDzPSJ40yg+MAgX0P6ZPOiBIW7c/i2j6TQhVyeEUzsjRMYMMiGQl/lgTz9D6Kc/WP4tzbzhRb0Icoy5+sZRiap1rQFjaOVzGUEOXgMoME9voaumyWcTskYTxGdil9CvKBKsHCFx8iZ63V1xcmT2JnOVuYEAqOwD6bSc6KhJznv+nSyG7HNY+ycCXP1NBoG5Z8QgXEcJxUMl0SDUaMAqM4K/NL+ZiQHDbDL38U9eBa9zYaG7xronBtZ7ieC2yMOcMfz4tSvATwPeH+qlTOJQjBtFEzHkFV84bUdVYLaMj8/oM+rVU/4hZCpXR42AXjhfEZBT2M4YZv9ciCjNAo63zbfTv2zt7A6ZYVUkRFW3mRQw0EP7bmK8w4BcVzhy2U0zaJqlBAbc1i/4A+0lmSnyKBISJRF4lrGz1dIsCpZ5AeuDopJNc59Rb7viBjmnA5rBqdrxPhNnReYbJd2k3g7YPAV21Hx4wf7oUsVn8Mu6dgmChDCc1IEc9jxSnHYCWqlCA7YBeUtXTXIJf2qe7knGliksYKnYfX9RnXdeDoIbmKWGsV2mnK+oJPzOlF46TC391bf9GBe8T2rvcXJINCfZBmS60iO+5Yo2NNJQi+Qc9SebaaygxTZOj6rIbNwzdhDEUYCG8zfS9KmEhZKfcz5+9oCIG6mM8oh7q79yxzDIzdpaotBKCgJ9M8jtC/Ee5ZI8adPdXMkB1EEzaGWZBuBvzecpPmTyhzpKBy8FB0kKhEOjY0/utP7JAJKpId0xWuDDsFlSsbCqPgb4wbUqID7Qxu6FUJ1QGCxGYA+u/NXFQesgGrYlWKdm0zY62gtlUv89zV1PwQwB4TNtP16MrfZAuYhqgR2xJ7ON7tWJ49lVyjB5NbzlCGelLKJIkoicwMz1CSQ8b9SO2qk+WMWUPnXqCsHBSU7ews5rZ8ccw539tfEBj9UNPUqW30tjb9BIc5q0ypPa15S8ucZOGEpSGyRLaf8SdSxw1JDsq0vYF04PoWvvYyAIAVNl6ACzWEnCPSzVAb2orLKO2McQpRAY4I762BRDhBt0R6a1Qm9Hx9g0gUfQE6iXBniPe81OUTKzGHNKxHzV2sP3HgVlBmB2M3N2tJTzb65XnRGKLGOgMe2/eVvLj54lK4MRe5vTJG1QvZUKbxnK0YdMNE/N/eTPwJ3tB7tMyVVVDEUQpzKNtWqrbKvtQcxG1Dy42DjnsCW+DNlXdgmIKcG8ZpJT9vTihoR2UAK1ZG1WPhVF2oNNvQGU3z3hIQ8VNmdu0EMJlEu6v4iTlLYi3E68RpLs8Eq1d6csi6nKrJRssSwsm8ApR/yO/p9c7dYj4EsfcwhxzsfgLdpu8SKZUUgHkSs+KWA2F3fHUawrHUZvl4xdkDqC/S4vi8CweW7ed/VvuriZXHgljCahrwhe2YRn0rZl3Kvsc3wz2L8XaRhusY1lT5Xy8rqsCiKFcuevI7DUCV2/c3uuhY08+5+qTihQwGlrJTQo8iTNr39o6lcoalqyKYeXWoQEKpUQP/SvTT5qhq+7NdJoB+q9JkU+q0aEQwqBOF+rdmRUeYEMWXmPiJ7NndcQGuAJg+M5pnbB25DUv2zP2Xqj/PjYypAJMMavI7YgoIlZ6VZ/L1yqU+PlABLp7+A93JgpG0hv221lEPIWY4+RNr3yyhPnCxtGA8obgUDu/6FIHqq+hxm+GfZx2DI2TQjgQs5yJiUyIVoXbmjjoBX0axEn1x3xsa7YlGVeFw1jeqFbgdIFN+KInG4kpJVd07c4BLJiITZFodHExoFD65tsX1SLXpZgdoljKwDo2DkacLCLiaV8PShqJEjo58uXdCu676mtSePbGyW0KZigAPGEpUEZ6zc1l9cZXjeDi2aLJpl6sphMR/B5aiIz6J7Afj3feUuq5qxxFHQC8jR1C1hPV7ZxF7Sub+U5iB+ynvUkt4iJd7kxJDARVbZPBbUSb9/ny0nBbzZmkRE6oi+0ocWxaH4ZnVrsL/NgnFPwKuG2IwbNCHls26kUeON7qS/+j0PLAXzBghwiRgBku1clT/tM30AS1mvJ6cKDjjLPMei7GwGHaJFfQqEjjikb7ktX5O1jVMlZTrNGliwOK1fTh3jE9b5K9AppT5IFuPxhbJ97+HMazBEPtMA9aZBIKXNFIvdPPCs0DHt05HzygjrejibsBA/SS2F+gSlANRlkrJinMIpt/gdlvUbjaxFrMupGmVCoMDfRDrxO053FTh8nto2pA2ActBghuqLM8p91U5FtVhXU+FI8whYX5WdWMmWc2E2wGzFz1aCKYJIC/qr4xzN305xQLxAVb2n0BQedGI+j38cc0ECk1NxJ2isVKvmhk5RyzSc6EPzB1884xko7roUM7NOu0FiPw+Zu4R8OGoHRYqsigkTRxlmL19aGEbBbdK9TmGBvwCd307SHj2GojSWN7DL9olp1+VMMYQ9UG8DTX47r23qkXZ4z3ctQl86rRjpzdj+70XvZb+h0FzgnyJmYSHxIIn2FWNYmvwPjyiBUgHYP5RoHhSJoeI6W+nkFnHijreTncsonIU5FKlqHQFGzzdc8s9U5sfrMFtR1SUYFYWj3C8KP0oQwiXZcn3AcqPkTqVU0o5kRZ2+QS+fJP1ozNeh6hKJSpUVSb2LZ9329cfBOPAJ7u8zYUqJZ8CIzIa26Qy5ADf5bco2Z18IcLHAulDYBXxaBCm2DXpryNEQMYWmMTHA0mVpIFVkmU5dfnNQykdZiAXU1l+Fw6kIjrMJ9AgF0xWiaZnOyTehWtuxU47hvUm8B2A9ociq2x5aFOxazc3YG5IB7IZmXercFhEWIMzMw63jvREmRjCT5ou+MIjmbi1na8d0SaLUudX5pUouPbc+4stjuNveU6cNACO0s+nbAlVyZyCeRMAPk5C+11kHcwSNd8IZugXSih5eJ4xPoIW0knz0365CjhNUfz9+31qYzK0lZNMUCuf2K0vrUBB/i3T3gdXMGSeldKp3Lx+tz/bpKXTHtUzzsvdS9Gs+uMIZ1XK6AxFyeCxOJ+cU9XN1fBnLPe2JYUlJUmCu4tiwsprlamaRzZQNWlUxombEZeKC7q3mwHcZM5wU0ICwEnLfTxW0VL9N10+batqOKxQnIspanPsw1ez2cuwr/hQSPXqoP2gIkFZnmAqUKUX8GZ5ib+C60pulz4Uxz/QvZW7V2SAAGcUwS30VsW6U2Ld2v5UbOfEQCxPdOHJZw75sKgEdyVdN1FDl4JC6s8IUclP+LD6R/CXIEDhbSWuXdTsAinSZLlMH1LzCXp6Cqvih/NReD6FJezE4Hi0sUGxti+4YngNBTWhUOblVY4+ioJs/kpVyXoAksKXh+Fe1j1PG2gbHkCQQWWCDqufQCEypj+dCoj37UreY26CogoUkVCnNUXQ5jZNFOPeXjh336gUEGzTt9qLgRwsxEJpQKH+aCWZALuJHtCVlK1WQMM6eM15EjMtRabejRb7eD3Us4WqESLYxpZ5KCobtmQDzV/4vOlvq0BSClPNORXWKygxQ2J9casayyd9DxvL77P41vt3k3fsT5PB1d6WR+6JZWwYJGZTdxyDyiFJDCKV9TuCeGkZQ26g1V0sV/H5a1xciwxOCNt7GgQOajs3aR4wpXxg4GbU0nOR0c9Ii/Sn27VMt4BqnAj5W4fx8q4ecJlPHlG3tSjqKSUsP0rlyg7JRFXcxCUGv7QMYc2K9WLvLEHbBOcM/ZD87o+UaQ3CvTwOkQTDq8hUeOBRxcerQV5Xi6Y+Hh6Vg4aeMpoGdUV7xXbw5oVh/mkSLP70aWsGQ3UbqZLFHrxQzLeDFkYJX6q069Lp/1X+lGTY+5ykXDRtK1n+GarP5tNWi4nd81eFXdracJWwcYk2GA6MbdjMnoaTrfSHXO3EXgrlq6ko5DABSrMg+9kF88aW5LAVOxGADYFS8bniGvdKVXnEhhQDJVCYKqqWKYGpAek5BGeVRWSbwLCKdQ5BcBnn+oEsmp46uK3k8KO72Pn+1hPMbgE6xWxVYPqAe7HVPPjNRiQS6cQGOxU1gdlAuEJ4V7ip4o+TgDM2/M4bthC6c4SBMQaMfRZfL5ko/uf3U2MXch54RJ2/LQRAy3AHiOI6enjY+L88VIvjU+hnmwro8yEflSD4tEMeFIkrxEW19Gycl1BDXpDVbs9nrU5MMIGx6QxCFw8FibHOtcRcI71o8s+OvDCQFsw7ZVMslGVDaprGZZmJ2j4uTgxrn15ihGv020yixBNktFCYgTyPlxA1f36ciarunxld8CPUVUPV/D/XFX5s/Neg2cdPqmSlO/fpnXxz4UJnIlB6hSl82wNGKJud1KoVyDHmmjI+EKBSUO7kNuvrQ/fY3duE75BX/HUAeUiLFKBZ1O2/mThw8t0Wq782ApG12/Jvza+94ENybWDDpLLmTddfEP7cYjFtZZONpGuxNkP8FAAD//w=="
+ ];
+
+ // Test that fixes #191501. Ensures compressed data can be streamed out correctly.
+ #[test]
+ fn test_flatestream_decodes_191501() {
+ let mut dec = ClientMessageDecoder::new_compressed();
+ let mut len = 0;
+ for b in TEST_191501_BUFS {
+ let b = general_purpose::STANDARD
+ .decode(b)
+ .expect("expected no decode error");
+ let s = dec.decode(&b).expect("expected no decompress error");
+ len += s.len();
+ }
+
+ assert_eq!(len, 265 + 101 + 10370);
+ }
}
diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json
index b267163da39..e2fed901bce 100644
--- a/extensions/css-language-features/package.json
+++ b/extensions/css-language-features/package.json
@@ -994,7 +994,7 @@
]
},
"dependencies": {
- "vscode-languageclient": "^8.2.0-next.1",
+ "vscode-languageclient": "^8.2.0-next.3",
"vscode-uri": "^3.0.7"
},
"devDependencies": {
diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json
index bdb66297271..874ce1e8202 100644
--- a/extensions/css-language-features/server/package.json
+++ b/extensions/css-language-features/server/package.json
@@ -10,9 +10,9 @@
"main": "./out/node/cssServerMain",
"browser": "./dist/browser/cssServerMain",
"dependencies": {
- "@vscode/l10n": "^0.0.14",
- "vscode-css-languageservice": "^6.2.6",
- "vscode-languageserver": "^8.2.0-next.1",
+ "@vscode/l10n": "^0.0.16",
+ "vscode-css-languageservice": "^6.2.7",
+ "vscode-languageserver": "^8.2.0-next.3",
"vscode-uri": "^3.0.7"
},
"devDependencies": {
diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock
index 649160819e3..296912060e4 100644
--- a/extensions/css-language-features/server/yarn.lock
+++ b/extensions/css-language-features/server/yarn.lock
@@ -12,55 +12,55 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469"
integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==
-"@vscode/l10n@^0.0.14":
- version "0.0.14"
- resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.14.tgz#431e5814c35c3cb11ee21873bc70a4b0fbf90fcf"
- integrity sha512-/yrv59IEnmh655z1oeDnGcvMYwnEzNzHLgeYcQCkhYX0xBvYWrAuefoiLcPBUkMpJsb46bqQ6Yv4pwTTQ4d3Qg==
+"@vscode/l10n@^0.0.16":
+ version "0.0.16"
+ resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.16.tgz#f075db346d0b08419a12540171b230bd803c42be"
+ integrity sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==
-vscode-css-languageservice@^6.2.6:
- version "6.2.6"
- resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.6.tgz#bc26c2abaaa2eb117b143fdb9387ee1701d9661a"
- integrity sha512-SA2WkeOecIpUiEbZnjOsP/fI5CRITZEiQGSHXKiDQDwLApfKcnLhZwMtOBbIifSzESVcQa7b/shX/nbnF4NoCg==
+vscode-css-languageservice@^6.2.7:
+ version "6.2.7"
+ resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.7.tgz#d64e347e9a432d2b9c1a12d1ea5bc77996a2e9dc"
+ integrity sha512-Jd8wpIg5kJ15CfrieoEPvu3gGFc36sbM3qXCtjVq5zrnLEX5NhHxikMDtf8AgQsYklXiDqiZLKoBnzkJtRbTHQ==
dependencies:
- "@vscode/l10n" "^0.0.14"
+ "@vscode/l10n" "^0.0.16"
vscode-languageserver-textdocument "^1.0.8"
vscode-languageserver-types "^3.17.3"
vscode-uri "^3.0.7"
-vscode-jsonrpc@8.2.0-next.0:
- version "8.2.0-next.0"
- resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.0.tgz#41409413c8cebf10f2f1b7cc87e330f0e292814c"
- integrity sha512-13jYzaFQpTz5qQ2P+l5c/iTVsj1wUpflP0CR/v4XaEpM0oToLEXZBTcuuox1WaGIbu3Av3xxmGNU4Hydl1iNKg==
+vscode-jsonrpc@8.2.0-next.2:
+ version "8.2.0-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.2.tgz#09d72832353fc7fb43b33c9c68b083907f6a8a68"
+ integrity sha512-1FQrqLselaLLe5ApFSU/8qGUbJ8tByWbqczMkT2PEDpDYthCQTe5wONPuVphe7BB+FvZwvBFI2kFkY7FtyHc1A==
-vscode-languageserver-protocol@3.17.4-next.1:
- version "3.17.4-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.1.tgz#a15480e1bc663853ae90ded226efafc5ab333616"
- integrity sha512-qrK4BycgPR/+nkRN9PRVTblkLp+kUPUmAgF6rDhFzZIPXW4/MqWwFUT8uswIMGdlTPPgCEkFO/AYEZK1fDXODg==
+vscode-languageserver-protocol@3.17.4-next.3:
+ version "3.17.4-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.3.tgz#7d1d4fcaaa3213a8f2b8a6f1efa8187163251b7c"
+ integrity sha512-GnW3ldfzlsDK9B1/L1edBW1ddSakC59r+DRipTYCcXIT/zCCbLID998Dxn+exgrL33e3/XLQ+7hQQiSz6TnhKQ==
dependencies:
- vscode-jsonrpc "8.2.0-next.0"
- vscode-languageserver-types "3.17.4-next.0"
+ vscode-jsonrpc "8.2.0-next.2"
+ vscode-languageserver-types "3.17.4-next.2"
vscode-languageserver-textdocument@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz#9eae94509cbd945ea44bca8dcfe4bb0c15bb3ac0"
integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==
-vscode-languageserver-types@3.17.4-next.0:
- version "3.17.4-next.0"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.0.tgz#4b5238d21cceaeb836d36a05d23c61a8c0238de2"
- integrity sha512-2FPKboHnT04xYjfM8JpJVBz4a/tryMw58jmzucaabZMZN5hzoFBrhc97jNG4n6edr9JUb9+QSwwcAcYpDTAoag==
+vscode-languageserver-types@3.17.4-next.2:
+ version "3.17.4-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.2.tgz#4099ff39b38edbd2680df13bfb1c05f0c07bfe8d"
+ integrity sha512-r6tXyCXyXQH7b6VHkvRT0Nd9v+DWQiosgTR6HQajCb4iJ1myr3KgueWEGBF1Ph5/YAiDy8kXUhf8dHl7wE1H2A==
vscode-languageserver-types@^3.17.3:
version "3.17.3"
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64"
integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==
-vscode-languageserver@^8.2.0-next.1:
- version "8.2.0-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.2.0-next.1.tgz#ad2558d74392b1cfaccd427febe9a368fc328f8b"
- integrity sha512-994AXMKBijzjlnpf8p9M+ntsNJDjR8pr55NJPYxKjy/nUhVkg962dAomelH6Z94401kBZmSbfP/K/20cB54aFA==
+vscode-languageserver@^8.2.0-next.3:
+ version "8.2.0-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.2.0-next.3.tgz#72e4998392260173fb0c35d2d556fb4015f56ce3"
+ integrity sha512-fqHRwcIRoxfKke7iLDSeUmdo3uk7o/uWNn/44xdWa4urdhsvpTZ5c1GsL1EX4TAvdDg0qeXy89NBZ5Gld2DkgQ==
dependencies:
- vscode-languageserver-protocol "3.17.4-next.1"
+ vscode-languageserver-protocol "3.17.4-next.3"
vscode-uri@^3.0.7:
version "3.0.7"
diff --git a/extensions/css-language-features/yarn.lock b/extensions/css-language-features/yarn.lock
index acd761d8f5b..826e0bb3306 100644
--- a/extensions/css-language-features/yarn.lock
+++ b/extensions/css-language-features/yarn.lock
@@ -40,32 +40,32 @@ semver@^7.3.7:
dependencies:
lru-cache "^6.0.0"
-vscode-jsonrpc@8.2.0-next.0:
- version "8.2.0-next.0"
- resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.0.tgz#41409413c8cebf10f2f1b7cc87e330f0e292814c"
- integrity sha512-13jYzaFQpTz5qQ2P+l5c/iTVsj1wUpflP0CR/v4XaEpM0oToLEXZBTcuuox1WaGIbu3Av3xxmGNU4Hydl1iNKg==
+vscode-jsonrpc@8.2.0-next.2:
+ version "8.2.0-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.2.tgz#09d72832353fc7fb43b33c9c68b083907f6a8a68"
+ integrity sha512-1FQrqLselaLLe5ApFSU/8qGUbJ8tByWbqczMkT2PEDpDYthCQTe5wONPuVphe7BB+FvZwvBFI2kFkY7FtyHc1A==
-vscode-languageclient@^8.2.0-next.1:
- version "8.2.0-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.2.0-next.1.tgz#a3f98b80cfa3225fde0583aa6a5c9b20219fa37e"
- integrity sha512-oITaqHQ10PM3zXCUu/104wriMeDutXMkQXMaRBWh1jKihcNcUBLC/os7RhqiVGypY0nl+F0pwStAf4Koc8inaw==
+vscode-languageclient@^8.2.0-next.3:
+ version "8.2.0-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.2.0-next.3.tgz#a5086f451a679ce77106d8fd1e05c8cbf8e9b886"
+ integrity sha512-Ojo6L2cb7GSiyD864k8vGb9fHxBdZeciHQQOF595C3IDHWg0w4KQ7iN7qGWVdl4wDNwlGTX3wWZawGfPTxnrPQ==
dependencies:
minimatch "^5.1.0"
semver "^7.3.7"
- vscode-languageserver-protocol "3.17.4-next.1"
+ vscode-languageserver-protocol "3.17.4-next.3"
-vscode-languageserver-protocol@3.17.4-next.1:
- version "3.17.4-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.1.tgz#a15480e1bc663853ae90ded226efafc5ab333616"
- integrity sha512-qrK4BycgPR/+nkRN9PRVTblkLp+kUPUmAgF6rDhFzZIPXW4/MqWwFUT8uswIMGdlTPPgCEkFO/AYEZK1fDXODg==
+vscode-languageserver-protocol@3.17.4-next.3:
+ version "3.17.4-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.3.tgz#7d1d4fcaaa3213a8f2b8a6f1efa8187163251b7c"
+ integrity sha512-GnW3ldfzlsDK9B1/L1edBW1ddSakC59r+DRipTYCcXIT/zCCbLID998Dxn+exgrL33e3/XLQ+7hQQiSz6TnhKQ==
dependencies:
- vscode-jsonrpc "8.2.0-next.0"
- vscode-languageserver-types "3.17.4-next.0"
+ vscode-jsonrpc "8.2.0-next.2"
+ vscode-languageserver-types "3.17.4-next.2"
-vscode-languageserver-types@3.17.4-next.0:
- version "3.17.4-next.0"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.0.tgz#4b5238d21cceaeb836d36a05d23c61a8c0238de2"
- integrity sha512-2FPKboHnT04xYjfM8JpJVBz4a/tryMw58jmzucaabZMZN5hzoFBrhc97jNG4n6edr9JUb9+QSwwcAcYpDTAoag==
+vscode-languageserver-types@3.17.4-next.2:
+ version "3.17.4-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.2.tgz#4099ff39b38edbd2680df13bfb1c05f0c07bfe8d"
+ integrity sha512-r6tXyCXyXQH7b6VHkvRT0Nd9v+DWQiosgTR6HQajCb4iJ1myr3KgueWEGBF1Ph5/YAiDy8kXUhf8dHl7wE1H2A==
vscode-uri@^3.0.7:
version "3.0.7"
diff --git a/extensions/git/package.json b/extensions/git/package.json
index 105491916ca..9ad1978be0e 100644
--- a/extensions/git/package.json
+++ b/extensions/git/package.json
@@ -2950,13 +2950,13 @@
{
"view": "scm",
"contents": "%view.workbench.scm.folder%",
- "when": "config.git.enabled && !git.missing && git.state == initialized && workbenchState == folder && scmRepositoryCount == 0 && git.parentRepositoryCount == 0 && git.unsafeRepositoryCount == 0 && git.closedRepositoryCount == 0 && remoteName != 'codespaces'",
+ "when": "config.git.enabled && !git.missing && git.state == initialized && workbenchState == folder && scm.providerCount == 0 && git.parentRepositoryCount == 0 && git.unsafeRepositoryCount == 0 && git.closedRepositoryCount == 0 && remoteName != 'codespaces'",
"group": "5_scm@1"
},
{
"view": "scm",
"contents": "%view.workbench.scm.workspace%",
- "when": "config.git.enabled && !git.missing && git.state == initialized && workbenchState == workspace && workspaceFolderCount != 0 && scmRepositoryCount == 0 && git.parentRepositoryCount == 0 && git.unsafeRepositoryCount == 0 && git.closedRepositoryCount == 0 && remoteName != 'codespaces'",
+ "when": "config.git.enabled && !git.missing && git.state == initialized && workbenchState == workspace && workspaceFolderCount != 0 && scm.providerCount == 0 && git.parentRepositoryCount == 0 && git.unsafeRepositoryCount == 0 && git.closedRepositoryCount == 0 && remoteName != 'codespaces'",
"group": "5_scm@1"
},
{
@@ -2992,13 +2992,13 @@
{
"view": "explorer",
"contents": "%view.workbench.cloneRepository%",
- "when": "config.git.enabled && git.state == initialized && scmRepositoryCount == 0",
+ "when": "config.git.enabled && git.state == initialized && scm.providerCount == 0",
"group": "5_scm@1"
},
{
"view": "explorer",
"contents": "%view.workbench.learnMore%",
- "when": "config.git.enabled && git.state == initialized && scmRepositoryCount == 0",
+ "when": "config.git.enabled && git.state == initialized && scm.providerCount == 0",
"group": "5_scm@10"
}
]
@@ -3012,7 +3012,7 @@
"jschardet": "3.0.0",
"picomatch": "2.3.1",
"vscode-uri": "^2.0.0",
- "which": "3.0.1"
+ "which": "4.0.0"
},
"devDependencies": {
"@types/byline": "4.2.31",
diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts
index 62bdf24ebcb..65d34af1e31 100644
--- a/extensions/git/src/git.ts
+++ b/extensions/git/src/git.ts
@@ -397,8 +397,8 @@ export class Git {
return Versions.compare(Versions.fromString(this.version), Versions.fromString(version));
}
- open(repository: string, dotGit: { path: string; commonPath?: string }, logger: LogOutputChannel): Repository {
- return new Repository(this, repository, dotGit, logger);
+ open(repositoryRoot: string, repositoryRootRealPath: string | undefined, dotGit: { path: string; commonPath?: string }, logger: LogOutputChannel): Repository {
+ return new Repository(this, repositoryRoot, repositoryRootRealPath, dotGit, logger);
}
async init(repository: string, options: InitOptions = {}): Promise {
@@ -956,6 +956,7 @@ export class Repository {
constructor(
private _git: Git,
private repositoryRoot: string,
+ private repositoryRootRealPath: string | undefined,
readonly dotGit: { path: string; commonPath?: string },
private logger: LogOutputChannel
) { }
@@ -968,6 +969,10 @@ export class Repository {
return this.repositoryRoot;
}
+ get rootRealPath(): string | undefined {
+ return this.repositoryRootRealPath;
+ }
+
async exec(args: string[], options: SpawnOptions = {}): Promise> {
return await this.git.exec(this.repositoryRoot, args, options);
}
diff --git a/extensions/git/src/model.ts b/extensions/git/src/model.ts
index eacfca8f035..02ff0ec8f5b 100644
--- a/extensions/git/src/model.ts
+++ b/extensions/git/src/model.ts
@@ -577,8 +577,8 @@ export class Model implements IBranchProtectionProviderRegistry, IRemoteSourcePu
}
// Open repository
- const dotGit = await this.git.getRepositoryDotGit(repositoryRoot);
- const repository = new Repository(this.git.open(repositoryRoot, dotGit, this.logger), this, this, this, this, this.globalState, this.logger, this.telemetryReporter);
+ const [dotGit, repositoryRootRealPath] = await Promise.all([this.git.getRepositoryDotGit(repositoryRoot), this.getRepositoryRootRealPath(repositoryRoot)]);
+ const repository = new Repository(this.git.open(repositoryRoot, repositoryRootRealPath, dotGit, this.logger), this, this, this, this, this.globalState, this.logger, this.telemetryReporter);
this.open(repository);
this._closedRepositoriesManager.deleteRepository(repository.root);
@@ -615,6 +615,16 @@ export class Model implements IBranchProtectionProviderRegistry, IRemoteSourcePu
}
}
+ private async getRepositoryRootRealPath(repositoryRoot: string): Promise {
+ try {
+ const repositoryRootRealPath = await fs.promises.realpath(repositoryRoot);
+ return !pathEquals(repositoryRoot, repositoryRootRealPath) ? repositoryRootRealPath : undefined;
+ } catch (err) {
+ this.logger.warn(`Failed to get repository realpath for: "${repositoryRoot}". ${err}`);
+ return undefined;
+ }
+ }
+
private shouldRepositoryBeIgnored(repositoryRoot: string): boolean {
const config = workspace.getConfiguration('git');
const ignoredRepos = config.get('ignoredRepositories') || [];
@@ -766,15 +776,25 @@ export class Model implements IBranchProtectionProviderRegistry, IRemoteSourcePu
}
private async getRepositoryExact(repoPath: string): Promise {
- const repoPathCanonical = await fs.promises.realpath(repoPath, { encoding: 'utf8' });
+ // Use the repository path
+ const openRepository = this.openRepositories
+ .find(r => pathEquals(r.repository.root, repoPath));
- for (const openRepository of this.openRepositories) {
- const rootPathCanonical = await fs.promises.realpath(openRepository.repository.root, { encoding: 'utf8' });
- if (pathEquals(rootPathCanonical, repoPathCanonical)) {
- return openRepository.repository;
- }
+ if (openRepository) {
+ return openRepository.repository;
+ }
+
+ try {
+ // Use the repository real path
+ const repoPathRealPath = await fs.promises.realpath(repoPath, { encoding: 'utf8' });
+ const openRepositoryRealPath = this.openRepositories
+ .find(r => pathEquals(r.repository.rootRealPath ?? '', repoPathRealPath));
+
+ return openRepositoryRealPath?.repository;
+ } catch (err) {
+ this.logger.warn(`Failed to get repository realpath for: "${repoPath}". ${err}`);
+ return undefined;
}
- return undefined;
}
private getOpenRepository(repository: Repository): OpenRepository | undefined;
diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts
index 77739e11ce9..c3092d37b63 100644
--- a/extensions/git/src/repository.ts
+++ b/extensions/git/src/repository.ts
@@ -765,6 +765,10 @@ export class Repository implements Disposable {
return this.repository.root;
}
+ get rootRealPath(): string | undefined {
+ return this.repository.rootRealPath;
+ }
+
get dotGit(): { path: string; commonPath?: string } {
return this.repository.dotGit;
}
diff --git a/extensions/git/yarn.lock b/extensions/git/yarn.lock
index bb3a09d947c..0b62d7472be 100644
--- a/extensions/git/yarn.lock
+++ b/extensions/git/yarn.lock
@@ -516,10 +516,10 @@ is-core-module@^2.13.0:
dependencies:
has "^1.0.3"
-isexe@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
- integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
+isexe@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/isexe/-/isexe-3.1.1.tgz#4a407e2bd78ddfb14bea0c27c6f7072dde775f0d"
+ integrity sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==
jschardet@3.0.0:
version "3.0.0"
@@ -679,12 +679,12 @@ vscode-uri@^2.0.0:
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.0.0.tgz#2df704222f72b8a71ff266ba0830ed6c51ac1542"
integrity sha512-lWXWofDSYD8r/TIyu64MdwB4FaSirQ608PP/TzUyslyOeHGwQ0eTHUZeJrK1ILOmwUHaJtV693m2JoUYroUDpw==
-which@3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/which/-/which-3.0.1.tgz#89f1cd0c23f629a8105ffe69b8172791c87b4be1"
- integrity sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==
+which@4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a"
+ integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==
dependencies:
- isexe "^2.0.0"
+ isexe "^3.1.1"
yallist@^4.0.0:
version "4.0.0"
diff --git a/extensions/github-authentication/src/flows.ts b/extensions/github-authentication/src/flows.ts
index 5bc9d095385..1e988d92d30 100644
--- a/extensions/github-authentication/src/flows.ts
+++ b/extensions/github-authentication/src/flows.ts
@@ -200,7 +200,9 @@ const allFlows: IFlow[] = [
// other flows that work well.
supportsGitHubEnterpriseServer: false,
supportsHostedGitHubEnterprise: true,
- supportsRemoteExtensionHost: true,
+ // Opening a port on the remote side can't be open in the browser on
+ // the client side so this flow won't work in remote extension hosts
+ supportsRemoteExtensionHost: false,
// Web worker can't open a port to listen for the redirect
supportsWebWorkerExtensionHost: false,
// exchanging a code for a token requires a client secret
diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json
index 58bd75f70e9..422fce5e7f6 100644
--- a/extensions/html-language-features/package.json
+++ b/extensions/html-language-features/package.json
@@ -258,8 +258,8 @@
]
},
"dependencies": {
- "@vscode/extension-telemetry": "^0.7.5",
- "vscode-languageclient": "^8.2.0-next.1",
+ "@vscode/extension-telemetry": "^0.8.4",
+ "vscode-languageclient": "^8.2.0-next.3",
"vscode-uri": "^3.0.7"
},
"devDependencies": {
diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json
index 3304c243b35..1816dca28f5 100644
--- a/extensions/html-language-features/server/package.json
+++ b/extensions/html-language-features/server/package.json
@@ -9,10 +9,10 @@
},
"main": "./out/node/htmlServerMain",
"dependencies": {
- "@vscode/l10n": "^0.0.14",
- "vscode-css-languageservice": "^6.2.6",
- "vscode-html-languageservice": "^5.0.6",
- "vscode-languageserver": "^8.2.0-next.1",
+ "@vscode/l10n": "^0.0.16",
+ "vscode-css-languageservice": "^6.2.7",
+ "vscode-html-languageservice": "^5.0.7",
+ "vscode-languageserver": "^8.2.0-next.3",
"vscode-languageserver-textdocument": "^1.0.8",
"vscode-uri": "^3.0.7"
},
diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock
index fe6c91e3cf8..22f945e7f84 100644
--- a/extensions/html-language-features/server/yarn.lock
+++ b/extensions/html-language-features/server/yarn.lock
@@ -12,65 +12,65 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469"
integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==
-"@vscode/l10n@^0.0.14":
- version "0.0.14"
- resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.14.tgz#431e5814c35c3cb11ee21873bc70a4b0fbf90fcf"
- integrity sha512-/yrv59IEnmh655z1oeDnGcvMYwnEzNzHLgeYcQCkhYX0xBvYWrAuefoiLcPBUkMpJsb46bqQ6Yv4pwTTQ4d3Qg==
+"@vscode/l10n@^0.0.16":
+ version "0.0.16"
+ resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.16.tgz#f075db346d0b08419a12540171b230bd803c42be"
+ integrity sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==
-vscode-css-languageservice@^6.2.6:
- version "6.2.6"
- resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.6.tgz#bc26c2abaaa2eb117b143fdb9387ee1701d9661a"
- integrity sha512-SA2WkeOecIpUiEbZnjOsP/fI5CRITZEiQGSHXKiDQDwLApfKcnLhZwMtOBbIifSzESVcQa7b/shX/nbnF4NoCg==
+vscode-css-languageservice@^6.2.7:
+ version "6.2.7"
+ resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.7.tgz#d64e347e9a432d2b9c1a12d1ea5bc77996a2e9dc"
+ integrity sha512-Jd8wpIg5kJ15CfrieoEPvu3gGFc36sbM3qXCtjVq5zrnLEX5NhHxikMDtf8AgQsYklXiDqiZLKoBnzkJtRbTHQ==
dependencies:
- "@vscode/l10n" "^0.0.14"
+ "@vscode/l10n" "^0.0.16"
vscode-languageserver-textdocument "^1.0.8"
vscode-languageserver-types "^3.17.3"
vscode-uri "^3.0.7"
-vscode-html-languageservice@^5.0.6:
- version "5.0.6"
- resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-5.0.6.tgz#e7a7f78e9f98d0f5341c5518dd9305e3cc438bb6"
- integrity sha512-gCixNg6fjPO7+kwSMBAVXcwDRHdjz1WOyNfI0n5Wx0J7dfHG8ggb3zD1FI8E2daTZrwS1cooOiSoc1Xxph4qRQ==
+vscode-html-languageservice@^5.0.7:
+ version "5.0.7"
+ resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-5.0.7.tgz#8d27773e0197799a9db777ee4fc134cf1c669d84"
+ integrity sha512-jX+7/kUXrdOaRT8vqYR/jLxrGDib+Far8I7n/A6apuEl88k+mhIHZPwc6ezuLeiCKUCaLG4b0dqFwjVa7QL3/w==
dependencies:
- "@vscode/l10n" "^0.0.14"
+ "@vscode/l10n" "^0.0.16"
vscode-languageserver-textdocument "^1.0.8"
vscode-languageserver-types "^3.17.3"
vscode-uri "^3.0.7"
-vscode-jsonrpc@8.2.0-next.0:
- version "8.2.0-next.0"
- resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.0.tgz#41409413c8cebf10f2f1b7cc87e330f0e292814c"
- integrity sha512-13jYzaFQpTz5qQ2P+l5c/iTVsj1wUpflP0CR/v4XaEpM0oToLEXZBTcuuox1WaGIbu3Av3xxmGNU4Hydl1iNKg==
+vscode-jsonrpc@8.2.0-next.2:
+ version "8.2.0-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.2.tgz#09d72832353fc7fb43b33c9c68b083907f6a8a68"
+ integrity sha512-1FQrqLselaLLe5ApFSU/8qGUbJ8tByWbqczMkT2PEDpDYthCQTe5wONPuVphe7BB+FvZwvBFI2kFkY7FtyHc1A==
-vscode-languageserver-protocol@3.17.4-next.1:
- version "3.17.4-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.1.tgz#a15480e1bc663853ae90ded226efafc5ab333616"
- integrity sha512-qrK4BycgPR/+nkRN9PRVTblkLp+kUPUmAgF6rDhFzZIPXW4/MqWwFUT8uswIMGdlTPPgCEkFO/AYEZK1fDXODg==
+vscode-languageserver-protocol@3.17.4-next.3:
+ version "3.17.4-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.3.tgz#7d1d4fcaaa3213a8f2b8a6f1efa8187163251b7c"
+ integrity sha512-GnW3ldfzlsDK9B1/L1edBW1ddSakC59r+DRipTYCcXIT/zCCbLID998Dxn+exgrL33e3/XLQ+7hQQiSz6TnhKQ==
dependencies:
- vscode-jsonrpc "8.2.0-next.0"
- vscode-languageserver-types "3.17.4-next.0"
+ vscode-jsonrpc "8.2.0-next.2"
+ vscode-languageserver-types "3.17.4-next.2"
vscode-languageserver-textdocument@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz#9eae94509cbd945ea44bca8dcfe4bb0c15bb3ac0"
integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==
-vscode-languageserver-types@3.17.4-next.0:
- version "3.17.4-next.0"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.0.tgz#4b5238d21cceaeb836d36a05d23c61a8c0238de2"
- integrity sha512-2FPKboHnT04xYjfM8JpJVBz4a/tryMw58jmzucaabZMZN5hzoFBrhc97jNG4n6edr9JUb9+QSwwcAcYpDTAoag==
+vscode-languageserver-types@3.17.4-next.2:
+ version "3.17.4-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.2.tgz#4099ff39b38edbd2680df13bfb1c05f0c07bfe8d"
+ integrity sha512-r6tXyCXyXQH7b6VHkvRT0Nd9v+DWQiosgTR6HQajCb4iJ1myr3KgueWEGBF1Ph5/YAiDy8kXUhf8dHl7wE1H2A==
vscode-languageserver-types@^3.17.3:
version "3.17.3"
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64"
integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==
-vscode-languageserver@^8.2.0-next.1:
- version "8.2.0-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.2.0-next.1.tgz#ad2558d74392b1cfaccd427febe9a368fc328f8b"
- integrity sha512-994AXMKBijzjlnpf8p9M+ntsNJDjR8pr55NJPYxKjy/nUhVkg962dAomelH6Z94401kBZmSbfP/K/20cB54aFA==
+vscode-languageserver@^8.2.0-next.3:
+ version "8.2.0-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.2.0-next.3.tgz#72e4998392260173fb0c35d2d556fb4015f56ce3"
+ integrity sha512-fqHRwcIRoxfKke7iLDSeUmdo3uk7o/uWNn/44xdWa4urdhsvpTZ5c1GsL1EX4TAvdDg0qeXy89NBZ5Gld2DkgQ==
dependencies:
- vscode-languageserver-protocol "3.17.4-next.1"
+ vscode-languageserver-protocol "3.17.4-next.3"
vscode-uri@^3.0.7:
version "3.0.7"
diff --git a/extensions/html-language-features/yarn.lock b/extensions/html-language-features/yarn.lock
index 8bf14ed8f82..57d4562ac85 100644
--- a/extensions/html-language-features/yarn.lock
+++ b/extensions/html-language-features/yarn.lock
@@ -17,7 +17,16 @@
"@azure/abort-controller" "^1.0.0"
tslib "^2.2.0"
-"@azure/core-rest-pipeline@^1.10.0":
+"@azure/core-auth@^1.5.0":
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.5.0.tgz#a41848c5c31cb3b7c84c409885267d55a2c92e44"
+ integrity sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==
+ dependencies:
+ "@azure/abort-controller" "^1.0.0"
+ "@azure/core-util" "^1.1.0"
+ tslib "^2.2.0"
+
+"@azure/core-rest-pipeline@1.10.1":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.1.tgz#348290847ca31b9eecf9cf5de7519aaccdd30968"
integrity sha512-Kji9k6TOFRDB5ZMTw8qUf2IJ+CeJtsuMdAHox9eqpTf1cefiNMpzrfnF6sINEBZJsaVaWgQ0o48B6kcUH68niA==
@@ -33,13 +42,21 @@
tslib "^2.2.0"
uuid "^8.3.0"
-"@azure/core-tracing@^1.0.1":
+"@azure/core-tracing@^1.0.0", "@azure/core-tracing@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.1.tgz#352a38cbea438c4a83c86b314f48017d70ba9503"
integrity sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==
dependencies:
tslib "^2.2.0"
+"@azure/core-util@1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.2.0.tgz#3499deba1fc36dda6f1912b791809b6f15d4a392"
+ integrity sha512-ffGIw+Qs8bNKNLxz5UPkz4/VBM/EZY07mPve1ZYFqYUdPwFqRj0RPk0U7LZMOfT7GCck9YjuT1Rfp1PApNl1ng==
+ dependencies:
+ "@azure/abort-controller" "^1.0.0"
+ tslib "^2.2.0"
+
"@azure/core-util@^1.0.0":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.1.1.tgz#8f87b3dd468795df0f0849d9f096c3e7b29452c1"
@@ -48,6 +65,14 @@
"@azure/abort-controller" "^1.0.0"
tslib "^2.2.0"
+"@azure/core-util@^1.1.0":
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.4.0.tgz#c120a56b3e48a9e4d20619a0b00268ae9de891c7"
+ integrity sha512-eGAyJpm3skVQoLiRqm/xPa+SXi/NPDdSHMxbRAz2lSprd+Zs+qrpQGQQ2VQ3Nttu+nSZR4XoYQC71LbEI7jsig==
+ dependencies:
+ "@azure/abort-controller" "^1.0.0"
+ tslib "^2.2.0"
+
"@azure/logger@^1.0.0":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@azure/logger/-/logger-1.0.3.tgz#6e36704aa51be7d4a1bae24731ea580836293c96"
@@ -55,66 +80,100 @@
dependencies:
tslib "^2.2.0"
-"@microsoft/1ds-core-js@3.2.8", "@microsoft/1ds-core-js@^3.2.8":
- version "3.2.8"
- resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-3.2.8.tgz#1b6b7d9bb858238c818ccf4e4b58ece7aeae5760"
- integrity sha512-9o9SUAamJiTXIYwpkQDuueYt83uZfXp8zp8YFix1IwVPwC9RmE36T2CX9gXOeq1nDckOuOduYpA8qHvdh5BGfQ==
+"@azure/opentelemetry-instrumentation-azure-sdk@^1.0.0-beta.5":
+ version "1.0.0-beta.5"
+ resolved "https://registry.yarnpkg.com/@azure/opentelemetry-instrumentation-azure-sdk/-/opentelemetry-instrumentation-azure-sdk-1.0.0-beta.5.tgz#78809e6c005d08450701e5d37f087f6fce2f86eb"
+ integrity sha512-fsUarKQDvjhmBO4nIfaZkfNSApm1hZBzcvpNbSrXdcUBxu7lRvKsV5DnwszX7cnhLyVOW9yl1uigtRQ1yDANjA==
dependencies:
- "@microsoft/applicationinsights-core-js" "2.8.9"
+ "@azure/core-tracing" "^1.0.0"
+ "@azure/logger" "^1.0.0"
+ "@opentelemetry/api" "^1.4.1"
+ "@opentelemetry/core" "^1.15.2"
+ "@opentelemetry/instrumentation" "^0.41.2"
+ tslib "^2.2.0"
+
+"@microsoft/1ds-core-js@3.2.13", "@microsoft/1ds-core-js@^3.2.13":
+ version "3.2.13"
+ resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-3.2.13.tgz#0c105ed75091bae3f1555c0334704fa9911c58fb"
+ integrity sha512-CluYTRWcEk0ObG5EWFNWhs87e2qchJUn0p2D21ZUa3PWojPZfPSBs4//WIE0MYV8Qg1Hdif2ZTwlM7TbYUjfAg==
+ dependencies:
+ "@microsoft/applicationinsights-core-js" "2.8.15"
"@microsoft/applicationinsights-shims" "^2.0.2"
"@microsoft/dynamicproto-js" "^1.1.7"
-"@microsoft/1ds-post-js@^3.2.8":
- version "3.2.8"
- resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-3.2.8.tgz#46793842cca161bf7a2a5b6053c349f429e55110"
- integrity sha512-SjlRoNcXcXBH6WQD/5SkkaCHIVqldH3gDu+bI7YagrOVJ5APxwT1Duw9gm3L1FjFa9S2i81fvJ3EVSKpp9wULA==
+"@microsoft/1ds-post-js@^3.2.13":
+ version "3.2.13"
+ resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-3.2.13.tgz#560aacac8a92fdbb79e8c2ebcb293d56e19f51aa"
+ integrity sha512-HgS574fdD19Bo2vPguyznL4eDw7Pcm1cVNpvbvBLWiW3x4e1FCQ3VMXChWnAxCae8Hb0XqlA2sz332ZobBavTA==
dependencies:
- "@microsoft/1ds-core-js" "3.2.8"
+ "@microsoft/1ds-core-js" "3.2.13"
"@microsoft/applicationinsights-shims" "^2.0.2"
"@microsoft/dynamicproto-js" "^1.1.7"
-"@microsoft/applicationinsights-channel-js@2.8.9":
- version "2.8.9"
- resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-2.8.9.tgz#840656f3c716de8b3eb0a98c122aa1b92bb8ebfb"
- integrity sha512-fMBsAEB7pWtPn43y72q9Xy5E5y55r6gMuDQqRRccccVoQDPXyS57VCj5IdATblctru0C6A8XpL2vRyNmEsu0Vg==
+"@microsoft/applicationinsights-channel-js@3.0.2":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.2.tgz#be49fbf74831c7b8c97950027c5052ea99d2a8a5"
+ integrity sha512-jDBNKbCHsJgmpv0CKNhJ/uN9ZphvfGdb93Svk+R4LjO8L3apNNMbDDPxBvXXi0uigRmA1TBcmyBG4IRKjabGhw==
dependencies:
- "@microsoft/applicationinsights-common" "2.8.9"
- "@microsoft/applicationinsights-core-js" "2.8.9"
- "@microsoft/applicationinsights-shims" "2.0.2"
- "@microsoft/dynamicproto-js" "^1.1.7"
+ "@microsoft/applicationinsights-common" "3.0.2"
+ "@microsoft/applicationinsights-core-js" "3.0.2"
+ "@microsoft/applicationinsights-shims" "3.0.1"
+ "@microsoft/dynamicproto-js" "^2.0.2"
+ "@nevware21/ts-async" ">= 0.2.4 < 2.x"
+ "@nevware21/ts-utils" ">= 0.9.5 < 2.x"
-"@microsoft/applicationinsights-common@2.8.9":
- version "2.8.9"
- resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-2.8.9.tgz#a75e4a3143a7fd797687830c0ddd2069fd900827"
- integrity sha512-mObn1moElyxZaGIRF/IU3cOaeKMgxghXnYEoHNUCA2e+rNwBIgxjyKkblFIpmGuHf4X7Oz3o3yBWpaC6AoMpig==
+"@microsoft/applicationinsights-common@3.0.2":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.2.tgz#37670bb07f4858ed41ff9759119e0759007d6e05"
+ integrity sha512-y+WXWop+OVim954Cu1uyYMnNx6PWO8okHpZIQi/1YSqtqaYdtJVPv4P0AVzwJdohxzVfgzKvqj9nec/VWqE2Zg==
dependencies:
- "@microsoft/applicationinsights-core-js" "2.8.9"
- "@microsoft/applicationinsights-shims" "2.0.2"
- "@microsoft/dynamicproto-js" "^1.1.7"
+ "@microsoft/applicationinsights-core-js" "3.0.2"
+ "@microsoft/applicationinsights-shims" "3.0.1"
+ "@microsoft/dynamicproto-js" "^2.0.2"
+ "@nevware21/ts-utils" ">= 0.9.5 < 2.x"
-"@microsoft/applicationinsights-core-js@2.8.9":
- version "2.8.9"
- resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.9.tgz#0e5d207acfae6986a6fc97249eeb6117e523bf1b"
- integrity sha512-HRuIuZ6aOWezcg/G5VyFDDWGL8hDNe/ljPP01J7ImH2kRPEgbtcfPSUMjkamGMefgdq81GZsSoC/NNGTP4pp2w==
+"@microsoft/applicationinsights-core-js@2.8.15":
+ version "2.8.15"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.15.tgz#8fa466474260e01967fe649f14dd9e5ff91dcdc8"
+ integrity sha512-yYAs9MyjGr2YijQdUSN9mVgT1ijI1FPMgcffpaPmYbHAVbQmF7bXudrBWHxmLzJlwl5rfep+Zgjli2e67lwUqQ==
dependencies:
"@microsoft/applicationinsights-shims" "2.0.2"
- "@microsoft/dynamicproto-js" "^1.1.7"
+ "@microsoft/dynamicproto-js" "^1.1.9"
+
+"@microsoft/applicationinsights-core-js@3.0.2":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.2.tgz#108e20df8c162bec92b1f66f9de2530a25d9f51a"
+ integrity sha512-WQhVhzlRlLDrQzn3OShCW/pL3BW5WC57t0oywSknX3q7lMzI3jDg7Ihh0iuIcNTzGCTbDkuqr4d6IjEDWIMtJQ==
+ dependencies:
+ "@microsoft/applicationinsights-shims" "3.0.1"
+ "@microsoft/dynamicproto-js" "^2.0.2"
+ "@nevware21/ts-async" ">= 0.2.4 < 2.x"
+ "@nevware21/ts-utils" ">= 0.9.5 < 2.x"
"@microsoft/applicationinsights-shims@2.0.2", "@microsoft/applicationinsights-shims@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz#92b36a09375e2d9cb2b4203383b05772be837085"
integrity sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==
-"@microsoft/applicationinsights-web-basic@^2.8.9":
- version "2.8.9"
- resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-2.8.9.tgz#eed2f3d1e19069962ed2155915c1656e6936e1d5"
- integrity sha512-CH0J8JFOy7MjK8JO4pXXU+EML+Ilix+94PMZTX5EJlBU1in+mrik74/8qSg3UC4ekPi12KwrXaHCQSVC3WseXQ==
+"@microsoft/applicationinsights-shims@3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f"
+ integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==
dependencies:
- "@microsoft/applicationinsights-channel-js" "2.8.9"
- "@microsoft/applicationinsights-common" "2.8.9"
- "@microsoft/applicationinsights-core-js" "2.8.9"
- "@microsoft/applicationinsights-shims" "2.0.2"
- "@microsoft/dynamicproto-js" "^1.1.7"
+ "@nevware21/ts-utils" ">= 0.9.4 < 2.x"
+
+"@microsoft/applicationinsights-web-basic@^3.0.2":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.2.tgz#f777a4d24b79dde3ae396d3b819e1fce06b7240a"
+ integrity sha512-6Lq0DE/pZp9RvSV+weGbcxN1NDmfczj6gNPhvZKV2YSQ3RK0LZE3+wjTWLXfuStq8a+nCBdsRpWk8tOKgsoxcg==
+ dependencies:
+ "@microsoft/applicationinsights-channel-js" "3.0.2"
+ "@microsoft/applicationinsights-common" "3.0.2"
+ "@microsoft/applicationinsights-core-js" "3.0.2"
+ "@microsoft/applicationinsights-shims" "3.0.1"
+ "@microsoft/dynamicproto-js" "^2.0.2"
+ "@nevware21/ts-async" ">= 0.2.4 < 2.x"
+ "@nevware21/ts-utils" ">= 0.9.5 < 2.x"
"@microsoft/applicationinsights-web-snippet@^1.0.1":
version "1.0.1"
@@ -126,39 +185,74 @@
resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.7.tgz#ede48dd3f85af14ee369c805e5ed5b84222b9fe2"
integrity sha512-SK3D3aVt+5vOOccKPnGaJWB5gQ8FuKfjboUJHedMP7gu54HqSCXX5iFXhktGD8nfJb0Go30eDvs/UDoTnR2kOA==
-"@opentelemetry/api@^1.0.4":
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.2.0.tgz#89ef99401cde6208cff98760b67663726ef26686"
- integrity sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g==
+"@microsoft/dynamicproto-js@^1.1.9":
+ version "1.1.9"
+ resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz#7437db7aa061162ee94e4131b69a62b8dad5dea6"
+ integrity sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==
-"@opentelemetry/core@1.7.0", "@opentelemetry/core@^1.0.1":
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.7.0.tgz#83bdd1b7a4ceafcdffd6590420657caec5f7b34c"
- integrity sha512-AVqAi5uc8DrKJBimCTFUT4iFI+5eXpo4sYmGbQ0CypG0piOTHE2g9c5aSoTGYXu3CzOmJZf7pT6Xh+nwm5d6yQ==
+"@microsoft/dynamicproto-js@^2.0.2":
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6"
+ integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==
dependencies:
- "@opentelemetry/semantic-conventions" "1.7.0"
+ "@nevware21/ts-utils" ">= 0.9.4 < 2.x"
-"@opentelemetry/resources@1.7.0":
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.7.0.tgz#90ccd3a6a86b4dfba4e833e73944bd64958d78c5"
- integrity sha512-u1M0yZotkjyKx8dj+46Sg5thwtOTBmtRieNXqdCRiWUp6SfFiIP0bI+1XK3LhuXqXkBXA1awJZaTqKduNMStRg==
+"@nevware21/ts-async@>= 0.2.4 < 2.x":
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c"
+ integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==
dependencies:
- "@opentelemetry/core" "1.7.0"
- "@opentelemetry/semantic-conventions" "1.7.0"
+ "@nevware21/ts-utils" ">= 0.10.0 < 2.x"
-"@opentelemetry/sdk-trace-base@^1.0.1":
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.7.0.tgz#b498424e0c6340a9d80de63fd408c5c2130a60a5"
- integrity sha512-Iz84C+FVOskmauh9FNnj4+VrA+hG5o+tkMzXuoesvSfunVSioXib0syVFeNXwOm4+M5GdWCuW632LVjqEXStIg==
+"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x", "@nevware21/ts-utils@>= 0.9.5 < 2.x":
+ version "0.10.1"
+ resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7"
+ integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==
+
+"@opentelemetry/api@^1.4.1":
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.4.1.tgz#ff22eb2e5d476fbc2450a196e40dd243cc20c28f"
+ integrity sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==
+
+"@opentelemetry/core@1.15.2", "@opentelemetry/core@^1.15.2":
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.15.2.tgz#5b170bf223a2333884bbc2d29d95812cdbda7c9f"
+ integrity sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==
dependencies:
- "@opentelemetry/core" "1.7.0"
- "@opentelemetry/resources" "1.7.0"
- "@opentelemetry/semantic-conventions" "1.7.0"
+ "@opentelemetry/semantic-conventions" "1.15.2"
-"@opentelemetry/semantic-conventions@1.7.0", "@opentelemetry/semantic-conventions@^1.0.1":
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.7.0.tgz#af80a1ef7cf110ea3a68242acd95648991bcd763"
- integrity sha512-FGBx/Qd09lMaqQcogCHyYrFEpTx4cAjeS+48lMIR12z7LdH+zofGDVQSubN59nL6IpubfKqTeIDu9rNO28iHVA==
+"@opentelemetry/instrumentation@^0.41.2":
+ version "0.41.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.41.2.tgz#cae11fa64485dcf03dae331f35b315b64bc6189f"
+ integrity sha512-rxU72E0pKNH6ae2w5+xgVYZLzc5mlxAbGzF4shxMVK8YC2QQsfN38B2GPbj0jvrKWWNUElfclQ+YTykkNg/grw==
+ dependencies:
+ "@types/shimmer" "^1.0.2"
+ import-in-the-middle "1.4.2"
+ require-in-the-middle "^7.1.1"
+ semver "^7.5.1"
+ shimmer "^1.2.1"
+
+"@opentelemetry/resources@1.15.2":
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.15.2.tgz#0c9e26cb65652a1402834a3c030cce6028d6dd9d"
+ integrity sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==
+ dependencies:
+ "@opentelemetry/core" "1.15.2"
+ "@opentelemetry/semantic-conventions" "1.15.2"
+
+"@opentelemetry/sdk-trace-base@^1.15.2":
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz#4821f94033c55a6c8bbd35ae387b715b6108517a"
+ integrity sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==
+ dependencies:
+ "@opentelemetry/core" "1.15.2"
+ "@opentelemetry/resources" "1.15.2"
+ "@opentelemetry/semantic-conventions" "1.15.2"
+
+"@opentelemetry/semantic-conventions@1.15.2", "@opentelemetry/semantic-conventions@^1.15.2":
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz#3bafb5de3e20e841dff6cb3c66f4d6e9694c4241"
+ integrity sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==
"@tootallnate/once@2":
version "2.0.0"
@@ -170,15 +264,30 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469"
integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==
-"@vscode/extension-telemetry@^0.7.5":
- version "0.7.5"
- resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.7.5.tgz#bf965731816e08c3f146f96d901ec67954fc913b"
- integrity sha512-fJ5y3TcpqqkFYHneabYaoB4XAhDdVflVm+TDKshw9VOs77jkgNS4UA7LNXrWeO0eDne3Sh3JgURf+xzc1rk69w==
+"@types/shimmer@^1.0.2":
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/@types/shimmer/-/shimmer-1.0.2.tgz#93eb2c243c351f3f17d5c580c7467ae5d686b65f"
+ integrity sha512-dKkr1bTxbEsFlh2ARpKzcaAmsYixqt9UyCdoEZk8rHyE4iQYcDCyvSjDSf7JUWJHlJiTtbIoQjxKh6ViywqDAg==
+
+"@vscode/extension-telemetry@^0.8.4":
+ version "0.8.4"
+ resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.8.4.tgz#c078c6f55df1c9e0592de3b4ce0f685dd345bfe7"
+ integrity sha512-UqM9+KZDDK3MyoHTsg6XNM+XO6pweQxzCpqJz33BoBEYAGsbBviRYcVpJglgay2oReuDD2pOI1Nio3BKNDLhWA==
dependencies:
- "@microsoft/1ds-core-js" "^3.2.8"
- "@microsoft/1ds-post-js" "^3.2.8"
- "@microsoft/applicationinsights-web-basic" "^2.8.9"
- applicationinsights "2.4.1"
+ "@microsoft/1ds-core-js" "^3.2.13"
+ "@microsoft/1ds-post-js" "^3.2.13"
+ "@microsoft/applicationinsights-web-basic" "^3.0.2"
+ applicationinsights "^2.7.1"
+
+acorn-import-assertions@^1.9.0:
+ version "1.9.0"
+ resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac"
+ integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==
+
+acorn@^8.8.2:
+ version "8.10.0"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5"
+ integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==
agent-base@6:
version "6.0.2"
@@ -187,22 +296,24 @@ agent-base@6:
dependencies:
debug "4"
-applicationinsights@2.4.1:
- version "2.4.1"
- resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-2.4.1.tgz#4de4c4dd3c7c4a44445cfbf3d15808fc0dcc423d"
- integrity sha512-0n0Ikd0gzSm460xm+M0UTWIwXrhrH/0bqfZatcJjYObWyefxfAxapGEyNnSGd1Tg90neHz+Yhf+Ff/zgvPiQYA==
+applicationinsights@^2.7.1:
+ version "2.7.3"
+ resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-2.7.3.tgz#8781454d29c0b14c9773f2e892b4cf5e7468ffa5"
+ integrity sha512-JY8+kTEkjbA+kAVNWDtpfW2lqsrDALfDXuxOs74KLPu2y13fy/9WB52V4LfYVTVcW1/jYOXjTxNS2gPZIDh1iw==
dependencies:
- "@azure/core-auth" "^1.4.0"
- "@azure/core-rest-pipeline" "^1.10.0"
+ "@azure/core-auth" "^1.5.0"
+ "@azure/core-rest-pipeline" "1.10.1"
+ "@azure/core-util" "1.2.0"
+ "@azure/opentelemetry-instrumentation-azure-sdk" "^1.0.0-beta.5"
"@microsoft/applicationinsights-web-snippet" "^1.0.1"
- "@opentelemetry/api" "^1.0.4"
- "@opentelemetry/core" "^1.0.1"
- "@opentelemetry/sdk-trace-base" "^1.0.1"
- "@opentelemetry/semantic-conventions" "^1.0.1"
+ "@opentelemetry/api" "^1.4.1"
+ "@opentelemetry/core" "^1.15.2"
+ "@opentelemetry/sdk-trace-base" "^1.15.2"
+ "@opentelemetry/semantic-conventions" "^1.15.2"
cls-hooked "^4.2.2"
continuation-local-storage "^3.2.1"
- diagnostic-channel "1.1.0"
- diagnostic-channel-publishers "1.0.5"
+ diagnostic-channel "1.1.1"
+ diagnostic-channel-publishers "1.0.7"
async-hook-jl@^1.7.6:
version "1.7.6"
@@ -236,6 +347,11 @@ brace-expansion@^2.0.1:
dependencies:
balanced-match "^1.0.0"
+cjs-module-lexer@^1.2.2:
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107"
+ integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==
+
cls-hooked@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/cls-hooked/-/cls-hooked-4.2.2.tgz#ad2e9a4092680cdaffeb2d3551da0e225eae1908"
@@ -260,7 +376,7 @@ continuation-local-storage@^3.2.1:
async-listener "^0.6.0"
emitter-listener "^1.1.1"
-debug@4:
+debug@4, debug@^4.1.1:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
@@ -272,17 +388,17 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
-diagnostic-channel-publishers@1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.5.tgz#df8c317086c50f5727fdfb5d2fce214d2e4130ae"
- integrity sha512-dJwUS0915pkjjimPJVDnS/QQHsH0aOYhnZsLJdnZIMOrB+csj8RnZhWTuwnm8R5v3Z7OZs+ksv5luC14DGB7eg==
+diagnostic-channel-publishers@1.0.7:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.7.tgz#9b7f8d5ee1295481aee19c827d917e96fedf2c4a"
+ integrity sha512-SEECbY5AiVt6DfLkhkaHNeshg1CogdLLANA8xlG/TKvS+XUgvIKl7VspJGYiEdL5OUyzMVnr7o0AwB7f+/Mjtg==
-diagnostic-channel@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-1.1.0.tgz#6985e9dfedfbc072d91dc4388477e4087147756e"
- integrity sha512-fwujyMe1gj6rk6dYi9hMZm0c8Mz8NDMVl2LB4iaYh3+LIAThZC8RKFGXWG0IML2OxAit/ZFRgZhMkhQ3d/bobQ==
+diagnostic-channel@1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-1.1.1.tgz#44b60972de9ee055c16216535b0e9db3f6a0efd0"
+ integrity sha512-r2HV5qFkUICyoaKlBEpLKHjxMXATUf/l+h8UZPGBHGLy4DDiY2sOLcIctax4eRnTw5wH2jTMExLntGPJ8eOJxw==
dependencies:
- semver "^5.3.0"
+ semver "^7.5.3"
emitter-listener@^1.0.1, emitter-listener@^1.1.1:
version "1.1.2"
@@ -300,6 +416,18 @@ form-data@^4.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"
+function-bind@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
+ integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
+
+has@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
+ integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
+ dependencies:
+ function-bind "^1.1.1"
+
http-proxy-agent@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43"
@@ -317,6 +445,23 @@ https-proxy-agent@^5.0.0:
agent-base "6"
debug "4"
+import-in-the-middle@1.4.2:
+ version "1.4.2"
+ resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.4.2.tgz#2a266676e3495e72c04bbaa5ec14756ba168391b"
+ integrity sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==
+ dependencies:
+ acorn "^8.8.2"
+ acorn-import-assertions "^1.9.0"
+ cjs-module-lexer "^1.2.2"
+ module-details-from-path "^1.0.3"
+
+is-core-module@^2.13.0:
+ version "2.13.0"
+ resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db"
+ integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==
+ dependencies:
+ has "^1.0.3"
+
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
@@ -343,24 +488,52 @@ minimatch@^5.1.0:
dependencies:
brace-expansion "^2.0.1"
+module-details-from-path@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b"
+ integrity sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==
+
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
+path-parse@^1.0.7:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
+ integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
+
+require-in-the-middle@^7.1.1:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz#b539de8f00955444dc8aed95e17c69b0a4f10fcf"
+ integrity sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==
+ dependencies:
+ debug "^4.1.1"
+ module-details-from-path "^1.0.3"
+ resolve "^1.22.1"
+
+resolve@^1.22.1:
+ version "1.22.4"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34"
+ integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==
+ dependencies:
+ is-core-module "^2.13.0"
+ path-parse "^1.0.7"
+ supports-preserve-symlinks-flag "^1.0.0"
+
semver@^5.3.0, semver@^5.4.1:
version "5.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
-semver@^7.3.7:
+semver@^7.3.7, semver@^7.5.1, semver@^7.5.3:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"
-shimmer@^1.1.0, shimmer@^1.2.0:
+shimmer@^1.1.0, shimmer@^1.2.0, shimmer@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337"
integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==
@@ -370,6 +543,11 @@ stack-chain@^1.3.7:
resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285"
integrity sha512-D8cWtWVdIe/jBA7v5p5Hwl5yOSOrmZPWDPe2KxQ5UAGD+nxbxU0lKXA4h85Ta6+qgdKVL3vUxsbIZjc1kBG7ug==
+supports-preserve-symlinks-flag@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
+ integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
+
tslib@^2.2.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e"
@@ -380,32 +558,32 @@ uuid@^8.3.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
-vscode-jsonrpc@8.2.0-next.0:
- version "8.2.0-next.0"
- resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.0.tgz#41409413c8cebf10f2f1b7cc87e330f0e292814c"
- integrity sha512-13jYzaFQpTz5qQ2P+l5c/iTVsj1wUpflP0CR/v4XaEpM0oToLEXZBTcuuox1WaGIbu3Av3xxmGNU4Hydl1iNKg==
+vscode-jsonrpc@8.2.0-next.2:
+ version "8.2.0-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.2.tgz#09d72832353fc7fb43b33c9c68b083907f6a8a68"
+ integrity sha512-1FQrqLselaLLe5ApFSU/8qGUbJ8tByWbqczMkT2PEDpDYthCQTe5wONPuVphe7BB+FvZwvBFI2kFkY7FtyHc1A==
-vscode-languageclient@^8.2.0-next.1:
- version "8.2.0-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.2.0-next.1.tgz#a3f98b80cfa3225fde0583aa6a5c9b20219fa37e"
- integrity sha512-oITaqHQ10PM3zXCUu/104wriMeDutXMkQXMaRBWh1jKihcNcUBLC/os7RhqiVGypY0nl+F0pwStAf4Koc8inaw==
+vscode-languageclient@^8.2.0-next.3:
+ version "8.2.0-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.2.0-next.3.tgz#a5086f451a679ce77106d8fd1e05c8cbf8e9b886"
+ integrity sha512-Ojo6L2cb7GSiyD864k8vGb9fHxBdZeciHQQOF595C3IDHWg0w4KQ7iN7qGWVdl4wDNwlGTX3wWZawGfPTxnrPQ==
dependencies:
minimatch "^5.1.0"
semver "^7.3.7"
- vscode-languageserver-protocol "3.17.4-next.1"
+ vscode-languageserver-protocol "3.17.4-next.3"
-vscode-languageserver-protocol@3.17.4-next.1:
- version "3.17.4-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.1.tgz#a15480e1bc663853ae90ded226efafc5ab333616"
- integrity sha512-qrK4BycgPR/+nkRN9PRVTblkLp+kUPUmAgF6rDhFzZIPXW4/MqWwFUT8uswIMGdlTPPgCEkFO/AYEZK1fDXODg==
+vscode-languageserver-protocol@3.17.4-next.3:
+ version "3.17.4-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.3.tgz#7d1d4fcaaa3213a8f2b8a6f1efa8187163251b7c"
+ integrity sha512-GnW3ldfzlsDK9B1/L1edBW1ddSakC59r+DRipTYCcXIT/zCCbLID998Dxn+exgrL33e3/XLQ+7hQQiSz6TnhKQ==
dependencies:
- vscode-jsonrpc "8.2.0-next.0"
- vscode-languageserver-types "3.17.4-next.0"
+ vscode-jsonrpc "8.2.0-next.2"
+ vscode-languageserver-types "3.17.4-next.2"
-vscode-languageserver-types@3.17.4-next.0:
- version "3.17.4-next.0"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.0.tgz#4b5238d21cceaeb836d36a05d23c61a8c0238de2"
- integrity sha512-2FPKboHnT04xYjfM8JpJVBz4a/tryMw58jmzucaabZMZN5hzoFBrhc97jNG4n6edr9JUb9+QSwwcAcYpDTAoag==
+vscode-languageserver-types@3.17.4-next.2:
+ version "3.17.4-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.2.tgz#4099ff39b38edbd2680df13bfb1c05f0c07bfe8d"
+ integrity sha512-r6tXyCXyXQH7b6VHkvRT0Nd9v+DWQiosgTR6HQajCb4iJ1myr3KgueWEGBF1Ph5/YAiDy8kXUhf8dHl7wE1H2A==
vscode-uri@^3.0.7:
version "3.0.7"
diff --git a/extensions/ipynb/package.json b/extensions/ipynb/package.json
index f5e25ac3695..25d08040183 100644
--- a/extensions/ipynb/package.json
+++ b/extensions/ipynb/package.json
@@ -58,8 +58,8 @@
"title": "%cleanInvalidImageAttachment.title%"
},
{
- "command": "notebook.cellOutput.copyToClipboard",
- "title": "%copyOutputToClipboard.title%"
+ "command": "notebook.cellOutput.copy",
+ "title": "%copyCellOutput.title%"
}
],
"notebooks": [
@@ -106,7 +106,7 @@
],
"webview/context": [
{
- "command": "notebook.cellOutput.copyToClipboard",
+ "command": "notebook.cellOutput.copy",
"when": "webviewId == 'notebook.output' && webviewSection == 'image'"
}
]
diff --git a/extensions/ipynb/package.nls.json b/extensions/ipynb/package.nls.json
index 45aa2aa03e8..1f281c32dd3 100644
--- a/extensions/ipynb/package.nls.json
+++ b/extensions/ipynb/package.nls.json
@@ -6,7 +6,7 @@
"newUntitledIpynb.shortTitle": "Jupyter Notebook",
"openIpynbInNotebookEditor.title": "Open IPYNB File In Notebook Editor",
"cleanInvalidImageAttachment.title": "Clean Invalid Image Attachment Reference",
- "copyOutputToClipboard.title": "Copy Output to Clipboard",
+ "copyCellOutput.title": "Copy Output",
"markdownAttachmentRenderer.displayName": {
"message": "Markdown-It ipynb Cell Attachment renderer",
"comment": [
diff --git a/extensions/json-language-features/client/src/jsonClient.ts b/extensions/json-language-features/client/src/jsonClient.ts
index 23410ebb814..3f191f165cf 100644
--- a/extensions/json-language-features/client/src/jsonClient.ts
+++ b/extensions/json-language-features/client/src/jsonClient.ts
@@ -8,7 +8,7 @@ export type JSONLanguageStatus = { schemas: string[] };
import {
workspace, window, languages, commands, ExtensionContext, extensions, Uri, ColorInformation,
Diagnostic, StatusBarAlignment, TextEditor, TextDocument, FormattingOptions, CancellationToken, FoldingRange,
- ProviderResult, TextEdit, Range, Position, Disposable, CompletionItem, CompletionList, CompletionContext, Hover, MarkdownString, FoldingContext, DocumentSymbol, SymbolInformation, l10n, TextEditorOptions
+ ProviderResult, TextEdit, Range, Position, Disposable, CompletionItem, CompletionList, CompletionContext, Hover, MarkdownString, FoldingContext, DocumentSymbol, SymbolInformation, l10n
} from 'vscode';
import {
LanguageClientOptions, RequestType, NotificationType, FormattingOptions as LSPFormattingOptions,
@@ -102,7 +102,6 @@ export type JSONSchemaSettings = {
export namespace SettingIds {
export const enableFormatter = 'json.format.enable';
export const enableKeepLines = 'json.format.keepLines';
- export const enableSortOnSave = 'json.sortOnSave.enable';
export const enableValidation = 'json.validate.enable';
export const enableSchemaDownload = 'json.schemaDownload.enable';
export const maxItemsComputed = 'json.maxItemsComputed';
@@ -171,15 +170,6 @@ export async function startClient(context: ExtensionContext, newLanguageClient:
window.showInformationMessage(l10n.t('JSON schema cache cleared.'));
}));
- toDispose.push(workspace.onWillSaveTextDocument(event => {
- const sortOnSave = workspace.getConfiguration().get(SettingIds.enableSortOnSave);
- const document = event.document;
- if (sortOnSave && (document.languageId === 'json' || document.languageId === 'jsonc')) {
- const documentOptions = getOptionsForDocument(document);
- const textEditsPromise = getSortTextEdits(document, documentOptions?.tabSize, documentOptions?.insertSpaces);
- event.waitUntil(textEditsPromise);
- }
- }));
toDispose.push(commands.registerCommand('json.sort', async () => {
@@ -643,12 +633,3 @@ function updateMarkdownString(h: MarkdownString): MarkdownString {
function isSchemaResolveError(d: Diagnostic) {
return d.code === /* SchemaResolveError */ 0x300;
}
-
-function getOptionsForDocument(document: TextDocument): TextEditorOptions | undefined {
- for (const editor of window.visibleTextEditors) {
- if (editor.document.uri.toString() === document.uri.toString()) {
- return editor.options;
- }
- }
- return;
-}
diff --git a/extensions/json-language-features/package.json b/extensions/json-language-features/package.json
index 05075ec1389..f804c30da79 100644
--- a/extensions/json-language-features/package.json
+++ b/extensions/json-language-features/package.json
@@ -91,12 +91,6 @@
"default": false,
"description": "%json.format.keepLines.desc%"
},
- "json.sortOnSave.enable": {
- "type": "boolean",
- "scope": "window",
- "default": false,
- "description": "%json.sortOnSave.enable.desc%"
- },
"json.trace.server": {
"type": "string",
"scope": "window",
@@ -164,9 +158,9 @@
]
},
"dependencies": {
- "@vscode/extension-telemetry": "^0.7.5",
+ "@vscode/extension-telemetry": "^0.8.4",
"request-light": "^0.7.0",
- "vscode-languageclient": "^8.2.0-next.1"
+ "vscode-languageclient": "^8.2.0-next.3"
},
"devDependencies": {
"@types/node": "18.x"
diff --git a/extensions/json-language-features/package.nls.json b/extensions/json-language-features/package.nls.json
index df68b3f8eac..2586bc6ab0a 100644
--- a/extensions/json-language-features/package.nls.json
+++ b/extensions/json-language-features/package.nls.json
@@ -8,7 +8,6 @@
"json.schemas.schema.desc": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.",
"json.format.enable.desc": "Enable/disable default JSON formatter",
"json.format.keepLines.desc" : "Keep all existing new lines when formatting.",
- "json.sortOnSave.enable.desc": "Enable/disable default sorting on save",
"json.validate.enable.desc": "Enable/disable JSON validation.",
"json.tracing.desc": "Traces the communication between VS Code and the JSON language server.",
"json.colorDecorators.enable.desc": "Enables or disables color decorators",
diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json
index b0012a72816..8d100ef9087 100644
--- a/extensions/json-language-features/server/package.json
+++ b/extensions/json-language-features/server/package.json
@@ -12,11 +12,11 @@
},
"main": "./out/node/jsonServerMain",
"dependencies": {
- "@vscode/l10n": "^0.0.14",
+ "@vscode/l10n": "^0.0.16",
"jsonc-parser": "^3.2.0",
"request-light": "^0.7.0",
- "vscode-json-languageservice": "^5.3.5",
- "vscode-languageserver": "^8.2.0-next.1",
+ "vscode-json-languageservice": "^5.3.6",
+ "vscode-languageserver": "^8.2.0-next.3",
"vscode-uri": "^3.0.7"
},
"devDependencies": {
diff --git a/extensions/json-language-features/server/src/jsonServer.ts b/extensions/json-language-features/server/src/jsonServer.ts
index 0282e6fa939..36ca0dc591d 100644
--- a/extensions/json-language-features/server/src/jsonServer.ts
+++ b/extensions/json-language-features/server/src/jsonServer.ts
@@ -6,7 +6,7 @@
import {
Connection,
TextDocuments, InitializeParams, InitializeResult, NotificationType, RequestType,
- DocumentRangeFormattingRequest, Disposable, ServerCapabilities, TextDocumentSyncKind, TextEdit, DocumentFormattingRequest, TextDocumentIdentifier, FormattingOptions, Diagnostic
+ DocumentRangeFormattingRequest, Disposable, ServerCapabilities, TextDocumentSyncKind, TextEdit, DocumentFormattingRequest, TextDocumentIdentifier, FormattingOptions, Diagnostic, CodeAction, CodeActionKind
} from 'vscode-languageserver';
import { runSafe, runSafeAsync } from './utils/runner';
@@ -14,6 +14,7 @@ import { DiagnosticsSupport, registerDiagnosticsPullSupport, registerDiagnostics
import { TextDocument, JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration, ClientCapabilities, Range, Position, SortOptions } from 'vscode-json-languageservice';
import { getLanguageModelCache } from './languageModelCache';
import { Utils, URI } from 'vscode-uri';
+import * as l10n from '@vscode/l10n';
type ISchemaAssociations = Record;
@@ -188,7 +189,8 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
documentSelector: null,
interFileDependencies: false,
workspaceDiagnostics: false
- }
+ },
+ codeActionProvider: true
};
return { capabilities };
@@ -424,6 +426,21 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}, [], `Error while computing document symbols for ${documentSymbolParams.textDocument.uri}`, token);
});
+ connection.onCodeAction((codeActionParams, token) => {
+ return runSafeAsync(runtime, async () => {
+ const document = documents.get(codeActionParams.textDocument.uri);
+ if (document) {
+ const sortCodeAction = CodeAction.create('Sort JSON', CodeActionKind.Source.concat('.sort', '.json'));
+ sortCodeAction.command = {
+ command: 'json.sort',
+ title: l10n.t('Sort JSON')
+ };
+ return [sortCodeAction];
+ }
+ return [];
+ }, [], `Error while computing code actions for ${codeActionParams.textDocument.uri}`, token);
+ });
+
function onFormat(textDocument: TextDocumentIdentifier, range: Range | undefined, options: FormattingOptions): TextEdit[] {
options.keepLines = keepLinesEnabled;
diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock
index 48f16a0f42f..c433012b1a3 100644
--- a/extensions/json-language-features/server/yarn.lock
+++ b/extensions/json-language-features/server/yarn.lock
@@ -12,15 +12,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469"
integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==
-"@vscode/l10n@^0.0.13":
- version "0.0.13"
- resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.13.tgz#f51ff130b8c98f189476c5f812d214b8efb09590"
- integrity sha512-A3uY356uOU9nGa+TQIT/i3ziWUgJjVMUrGGXSrtRiTwklyCFjGVWIOHoEIHbJpiyhDkJd9kvIWUOfXK1IkK8XQ==
-
-"@vscode/l10n@^0.0.14":
- version "0.0.14"
- resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.14.tgz#431e5814c35c3cb11ee21873bc70a4b0fbf90fcf"
- integrity sha512-/yrv59IEnmh655z1oeDnGcvMYwnEzNzHLgeYcQCkhYX0xBvYWrAuefoiLcPBUkMpJsb46bqQ6Yv4pwTTQ4d3Qg==
+"@vscode/l10n@^0.0.16":
+ version "0.0.16"
+ resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.16.tgz#f075db346d0b08419a12540171b230bd803c42be"
+ integrity sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==
jsonc-parser@^3.2.0:
version "3.2.0"
@@ -32,51 +27,51 @@ request-light@^0.7.0:
resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.7.0.tgz#885628bb2f8040c26401ebf258ec51c4ae98ac2a"
integrity sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==
-vscode-json-languageservice@^5.3.5:
- version "5.3.5"
- resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-5.3.5.tgz#20acd827e13ea4bdeb9976df84ec2bfbb2452c73"
- integrity sha512-DasT+bKtpaS2rTPEB4VMROnvO1WES2KD8RZZxXbumnk9sk5wco10VdB6sJgTlsKQN14tHQLZDXuHnSoSAlE8LQ==
+vscode-json-languageservice@^5.3.6:
+ version "5.3.6"
+ resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-5.3.6.tgz#8cbe39dfdf29e7f7e97c9b6966b76031991290f6"
+ integrity sha512-P4kthBi3GMLKi7Lmp24nkKHAWxbFfCsIDBPlMrK1Tag1aqbl3l60UferDkfAasupDVBM2dekbArzGycUjw8OHA==
dependencies:
- "@vscode/l10n" "^0.0.13"
+ "@vscode/l10n" "^0.0.16"
jsonc-parser "^3.2.0"
vscode-languageserver-textdocument "^1.0.8"
vscode-languageserver-types "^3.17.3"
vscode-uri "^3.0.7"
-vscode-jsonrpc@8.2.0-next.0:
- version "8.2.0-next.0"
- resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.0.tgz#41409413c8cebf10f2f1b7cc87e330f0e292814c"
- integrity sha512-13jYzaFQpTz5qQ2P+l5c/iTVsj1wUpflP0CR/v4XaEpM0oToLEXZBTcuuox1WaGIbu3Av3xxmGNU4Hydl1iNKg==
+vscode-jsonrpc@8.2.0-next.2:
+ version "8.2.0-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.2.tgz#09d72832353fc7fb43b33c9c68b083907f6a8a68"
+ integrity sha512-1FQrqLselaLLe5ApFSU/8qGUbJ8tByWbqczMkT2PEDpDYthCQTe5wONPuVphe7BB+FvZwvBFI2kFkY7FtyHc1A==
-vscode-languageserver-protocol@3.17.4-next.1:
- version "3.17.4-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.1.tgz#a15480e1bc663853ae90ded226efafc5ab333616"
- integrity sha512-qrK4BycgPR/+nkRN9PRVTblkLp+kUPUmAgF6rDhFzZIPXW4/MqWwFUT8uswIMGdlTPPgCEkFO/AYEZK1fDXODg==
+vscode-languageserver-protocol@3.17.4-next.3:
+ version "3.17.4-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.3.tgz#7d1d4fcaaa3213a8f2b8a6f1efa8187163251b7c"
+ integrity sha512-GnW3ldfzlsDK9B1/L1edBW1ddSakC59r+DRipTYCcXIT/zCCbLID998Dxn+exgrL33e3/XLQ+7hQQiSz6TnhKQ==
dependencies:
- vscode-jsonrpc "8.2.0-next.0"
- vscode-languageserver-types "3.17.4-next.0"
+ vscode-jsonrpc "8.2.0-next.2"
+ vscode-languageserver-types "3.17.4-next.2"
vscode-languageserver-textdocument@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz#9eae94509cbd945ea44bca8dcfe4bb0c15bb3ac0"
integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==
-vscode-languageserver-types@3.17.4-next.0:
- version "3.17.4-next.0"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.0.tgz#4b5238d21cceaeb836d36a05d23c61a8c0238de2"
- integrity sha512-2FPKboHnT04xYjfM8JpJVBz4a/tryMw58jmzucaabZMZN5hzoFBrhc97jNG4n6edr9JUb9+QSwwcAcYpDTAoag==
+vscode-languageserver-types@3.17.4-next.2:
+ version "3.17.4-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.2.tgz#4099ff39b38edbd2680df13bfb1c05f0c07bfe8d"
+ integrity sha512-r6tXyCXyXQH7b6VHkvRT0Nd9v+DWQiosgTR6HQajCb4iJ1myr3KgueWEGBF1Ph5/YAiDy8kXUhf8dHl7wE1H2A==
vscode-languageserver-types@^3.17.3:
version "3.17.3"
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64"
integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==
-vscode-languageserver@^8.2.0-next.1:
- version "8.2.0-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.2.0-next.1.tgz#ad2558d74392b1cfaccd427febe9a368fc328f8b"
- integrity sha512-994AXMKBijzjlnpf8p9M+ntsNJDjR8pr55NJPYxKjy/nUhVkg962dAomelH6Z94401kBZmSbfP/K/20cB54aFA==
+vscode-languageserver@^8.2.0-next.3:
+ version "8.2.0-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.2.0-next.3.tgz#72e4998392260173fb0c35d2d556fb4015f56ce3"
+ integrity sha512-fqHRwcIRoxfKke7iLDSeUmdo3uk7o/uWNn/44xdWa4urdhsvpTZ5c1GsL1EX4TAvdDg0qeXy89NBZ5Gld2DkgQ==
dependencies:
- vscode-languageserver-protocol "3.17.4-next.1"
+ vscode-languageserver-protocol "3.17.4-next.3"
vscode-uri@^3.0.7:
version "3.0.7"
diff --git a/extensions/json-language-features/yarn.lock b/extensions/json-language-features/yarn.lock
index 98083a9489f..1ea64055bdd 100644
--- a/extensions/json-language-features/yarn.lock
+++ b/extensions/json-language-features/yarn.lock
@@ -17,7 +17,16 @@
"@azure/abort-controller" "^1.0.0"
tslib "^2.2.0"
-"@azure/core-rest-pipeline@^1.10.0":
+"@azure/core-auth@^1.5.0":
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.5.0.tgz#a41848c5c31cb3b7c84c409885267d55a2c92e44"
+ integrity sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==
+ dependencies:
+ "@azure/abort-controller" "^1.0.0"
+ "@azure/core-util" "^1.1.0"
+ tslib "^2.2.0"
+
+"@azure/core-rest-pipeline@1.10.1":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.1.tgz#348290847ca31b9eecf9cf5de7519aaccdd30968"
integrity sha512-Kji9k6TOFRDB5ZMTw8qUf2IJ+CeJtsuMdAHox9eqpTf1cefiNMpzrfnF6sINEBZJsaVaWgQ0o48B6kcUH68niA==
@@ -33,13 +42,21 @@
tslib "^2.2.0"
uuid "^8.3.0"
-"@azure/core-tracing@^1.0.1":
+"@azure/core-tracing@^1.0.0", "@azure/core-tracing@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.1.tgz#352a38cbea438c4a83c86b314f48017d70ba9503"
integrity sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==
dependencies:
tslib "^2.2.0"
+"@azure/core-util@1.2.0":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.2.0.tgz#3499deba1fc36dda6f1912b791809b6f15d4a392"
+ integrity sha512-ffGIw+Qs8bNKNLxz5UPkz4/VBM/EZY07mPve1ZYFqYUdPwFqRj0RPk0U7LZMOfT7GCck9YjuT1Rfp1PApNl1ng==
+ dependencies:
+ "@azure/abort-controller" "^1.0.0"
+ tslib "^2.2.0"
+
"@azure/core-util@^1.0.0":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.1.1.tgz#8f87b3dd468795df0f0849d9f096c3e7b29452c1"
@@ -48,6 +65,14 @@
"@azure/abort-controller" "^1.0.0"
tslib "^2.2.0"
+"@azure/core-util@^1.1.0":
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.4.0.tgz#c120a56b3e48a9e4d20619a0b00268ae9de891c7"
+ integrity sha512-eGAyJpm3skVQoLiRqm/xPa+SXi/NPDdSHMxbRAz2lSprd+Zs+qrpQGQQ2VQ3Nttu+nSZR4XoYQC71LbEI7jsig==
+ dependencies:
+ "@azure/abort-controller" "^1.0.0"
+ tslib "^2.2.0"
+
"@azure/logger@^1.0.0":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@azure/logger/-/logger-1.0.3.tgz#6e36704aa51be7d4a1bae24731ea580836293c96"
@@ -55,66 +80,100 @@
dependencies:
tslib "^2.2.0"
-"@microsoft/1ds-core-js@3.2.8", "@microsoft/1ds-core-js@^3.2.8":
- version "3.2.8"
- resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-3.2.8.tgz#1b6b7d9bb858238c818ccf4e4b58ece7aeae5760"
- integrity sha512-9o9SUAamJiTXIYwpkQDuueYt83uZfXp8zp8YFix1IwVPwC9RmE36T2CX9gXOeq1nDckOuOduYpA8qHvdh5BGfQ==
+"@azure/opentelemetry-instrumentation-azure-sdk@^1.0.0-beta.5":
+ version "1.0.0-beta.5"
+ resolved "https://registry.yarnpkg.com/@azure/opentelemetry-instrumentation-azure-sdk/-/opentelemetry-instrumentation-azure-sdk-1.0.0-beta.5.tgz#78809e6c005d08450701e5d37f087f6fce2f86eb"
+ integrity sha512-fsUarKQDvjhmBO4nIfaZkfNSApm1hZBzcvpNbSrXdcUBxu7lRvKsV5DnwszX7cnhLyVOW9yl1uigtRQ1yDANjA==
dependencies:
- "@microsoft/applicationinsights-core-js" "2.8.9"
+ "@azure/core-tracing" "^1.0.0"
+ "@azure/logger" "^1.0.0"
+ "@opentelemetry/api" "^1.4.1"
+ "@opentelemetry/core" "^1.15.2"
+ "@opentelemetry/instrumentation" "^0.41.2"
+ tslib "^2.2.0"
+
+"@microsoft/1ds-core-js@3.2.13", "@microsoft/1ds-core-js@^3.2.13":
+ version "3.2.13"
+ resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-3.2.13.tgz#0c105ed75091bae3f1555c0334704fa9911c58fb"
+ integrity sha512-CluYTRWcEk0ObG5EWFNWhs87e2qchJUn0p2D21ZUa3PWojPZfPSBs4//WIE0MYV8Qg1Hdif2ZTwlM7TbYUjfAg==
+ dependencies:
+ "@microsoft/applicationinsights-core-js" "2.8.15"
"@microsoft/applicationinsights-shims" "^2.0.2"
"@microsoft/dynamicproto-js" "^1.1.7"
-"@microsoft/1ds-post-js@^3.2.8":
- version "3.2.8"
- resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-3.2.8.tgz#46793842cca161bf7a2a5b6053c349f429e55110"
- integrity sha512-SjlRoNcXcXBH6WQD/5SkkaCHIVqldH3gDu+bI7YagrOVJ5APxwT1Duw9gm3L1FjFa9S2i81fvJ3EVSKpp9wULA==
+"@microsoft/1ds-post-js@^3.2.13":
+ version "3.2.13"
+ resolved "https://registry.yarnpkg.com/@microsoft/1ds-post-js/-/1ds-post-js-3.2.13.tgz#560aacac8a92fdbb79e8c2ebcb293d56e19f51aa"
+ integrity sha512-HgS574fdD19Bo2vPguyznL4eDw7Pcm1cVNpvbvBLWiW3x4e1FCQ3VMXChWnAxCae8Hb0XqlA2sz332ZobBavTA==
dependencies:
- "@microsoft/1ds-core-js" "3.2.8"
+ "@microsoft/1ds-core-js" "3.2.13"
"@microsoft/applicationinsights-shims" "^2.0.2"
"@microsoft/dynamicproto-js" "^1.1.7"
-"@microsoft/applicationinsights-channel-js@2.8.9":
- version "2.8.9"
- resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-2.8.9.tgz#840656f3c716de8b3eb0a98c122aa1b92bb8ebfb"
- integrity sha512-fMBsAEB7pWtPn43y72q9Xy5E5y55r6gMuDQqRRccccVoQDPXyS57VCj5IdATblctru0C6A8XpL2vRyNmEsu0Vg==
+"@microsoft/applicationinsights-channel-js@3.0.2":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.2.tgz#be49fbf74831c7b8c97950027c5052ea99d2a8a5"
+ integrity sha512-jDBNKbCHsJgmpv0CKNhJ/uN9ZphvfGdb93Svk+R4LjO8L3apNNMbDDPxBvXXi0uigRmA1TBcmyBG4IRKjabGhw==
dependencies:
- "@microsoft/applicationinsights-common" "2.8.9"
- "@microsoft/applicationinsights-core-js" "2.8.9"
- "@microsoft/applicationinsights-shims" "2.0.2"
- "@microsoft/dynamicproto-js" "^1.1.7"
+ "@microsoft/applicationinsights-common" "3.0.2"
+ "@microsoft/applicationinsights-core-js" "3.0.2"
+ "@microsoft/applicationinsights-shims" "3.0.1"
+ "@microsoft/dynamicproto-js" "^2.0.2"
+ "@nevware21/ts-async" ">= 0.2.4 < 2.x"
+ "@nevware21/ts-utils" ">= 0.9.5 < 2.x"
-"@microsoft/applicationinsights-common@2.8.9":
- version "2.8.9"
- resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-2.8.9.tgz#a75e4a3143a7fd797687830c0ddd2069fd900827"
- integrity sha512-mObn1moElyxZaGIRF/IU3cOaeKMgxghXnYEoHNUCA2e+rNwBIgxjyKkblFIpmGuHf4X7Oz3o3yBWpaC6AoMpig==
+"@microsoft/applicationinsights-common@3.0.2":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.2.tgz#37670bb07f4858ed41ff9759119e0759007d6e05"
+ integrity sha512-y+WXWop+OVim954Cu1uyYMnNx6PWO8okHpZIQi/1YSqtqaYdtJVPv4P0AVzwJdohxzVfgzKvqj9nec/VWqE2Zg==
dependencies:
- "@microsoft/applicationinsights-core-js" "2.8.9"
- "@microsoft/applicationinsights-shims" "2.0.2"
- "@microsoft/dynamicproto-js" "^1.1.7"
+ "@microsoft/applicationinsights-core-js" "3.0.2"
+ "@microsoft/applicationinsights-shims" "3.0.1"
+ "@microsoft/dynamicproto-js" "^2.0.2"
+ "@nevware21/ts-utils" ">= 0.9.5 < 2.x"
-"@microsoft/applicationinsights-core-js@2.8.9":
- version "2.8.9"
- resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.9.tgz#0e5d207acfae6986a6fc97249eeb6117e523bf1b"
- integrity sha512-HRuIuZ6aOWezcg/G5VyFDDWGL8hDNe/ljPP01J7ImH2kRPEgbtcfPSUMjkamGMefgdq81GZsSoC/NNGTP4pp2w==
+"@microsoft/applicationinsights-core-js@2.8.15":
+ version "2.8.15"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.15.tgz#8fa466474260e01967fe649f14dd9e5ff91dcdc8"
+ integrity sha512-yYAs9MyjGr2YijQdUSN9mVgT1ijI1FPMgcffpaPmYbHAVbQmF7bXudrBWHxmLzJlwl5rfep+Zgjli2e67lwUqQ==
dependencies:
"@microsoft/applicationinsights-shims" "2.0.2"
- "@microsoft/dynamicproto-js" "^1.1.7"
+ "@microsoft/dynamicproto-js" "^1.1.9"
+
+"@microsoft/applicationinsights-core-js@3.0.2":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.2.tgz#108e20df8c162bec92b1f66f9de2530a25d9f51a"
+ integrity sha512-WQhVhzlRlLDrQzn3OShCW/pL3BW5WC57t0oywSknX3q7lMzI3jDg7Ihh0iuIcNTzGCTbDkuqr4d6IjEDWIMtJQ==
+ dependencies:
+ "@microsoft/applicationinsights-shims" "3.0.1"
+ "@microsoft/dynamicproto-js" "^2.0.2"
+ "@nevware21/ts-async" ">= 0.2.4 < 2.x"
+ "@nevware21/ts-utils" ">= 0.9.5 < 2.x"
"@microsoft/applicationinsights-shims@2.0.2", "@microsoft/applicationinsights-shims@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz#92b36a09375e2d9cb2b4203383b05772be837085"
integrity sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==
-"@microsoft/applicationinsights-web-basic@^2.8.9":
- version "2.8.9"
- resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-2.8.9.tgz#eed2f3d1e19069962ed2155915c1656e6936e1d5"
- integrity sha512-CH0J8JFOy7MjK8JO4pXXU+EML+Ilix+94PMZTX5EJlBU1in+mrik74/8qSg3UC4ekPi12KwrXaHCQSVC3WseXQ==
+"@microsoft/applicationinsights-shims@3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz#3865b73ace8405b9c4618cc5c571f2fe3876f06f"
+ integrity sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==
dependencies:
- "@microsoft/applicationinsights-channel-js" "2.8.9"
- "@microsoft/applicationinsights-common" "2.8.9"
- "@microsoft/applicationinsights-core-js" "2.8.9"
- "@microsoft/applicationinsights-shims" "2.0.2"
- "@microsoft/dynamicproto-js" "^1.1.7"
+ "@nevware21/ts-utils" ">= 0.9.4 < 2.x"
+
+"@microsoft/applicationinsights-web-basic@^3.0.2":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.2.tgz#f777a4d24b79dde3ae396d3b819e1fce06b7240a"
+ integrity sha512-6Lq0DE/pZp9RvSV+weGbcxN1NDmfczj6gNPhvZKV2YSQ3RK0LZE3+wjTWLXfuStq8a+nCBdsRpWk8tOKgsoxcg==
+ dependencies:
+ "@microsoft/applicationinsights-channel-js" "3.0.2"
+ "@microsoft/applicationinsights-common" "3.0.2"
+ "@microsoft/applicationinsights-core-js" "3.0.2"
+ "@microsoft/applicationinsights-shims" "3.0.1"
+ "@microsoft/dynamicproto-js" "^2.0.2"
+ "@nevware21/ts-async" ">= 0.2.4 < 2.x"
+ "@nevware21/ts-utils" ">= 0.9.5 < 2.x"
"@microsoft/applicationinsights-web-snippet@^1.0.1":
version "1.0.1"
@@ -126,39 +185,74 @@
resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.7.tgz#ede48dd3f85af14ee369c805e5ed5b84222b9fe2"
integrity sha512-SK3D3aVt+5vOOccKPnGaJWB5gQ8FuKfjboUJHedMP7gu54HqSCXX5iFXhktGD8nfJb0Go30eDvs/UDoTnR2kOA==
-"@opentelemetry/api@^1.0.4":
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.2.0.tgz#89ef99401cde6208cff98760b67663726ef26686"
- integrity sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g==
+"@microsoft/dynamicproto-js@^1.1.9":
+ version "1.1.9"
+ resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz#7437db7aa061162ee94e4131b69a62b8dad5dea6"
+ integrity sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==
-"@opentelemetry/core@1.7.0", "@opentelemetry/core@^1.0.1":
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.7.0.tgz#83bdd1b7a4ceafcdffd6590420657caec5f7b34c"
- integrity sha512-AVqAi5uc8DrKJBimCTFUT4iFI+5eXpo4sYmGbQ0CypG0piOTHE2g9c5aSoTGYXu3CzOmJZf7pT6Xh+nwm5d6yQ==
+"@microsoft/dynamicproto-js@^2.0.2":
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz#e57fbec2e7067d48b7e8e1e1c1d354028ef718a6"
+ integrity sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==
dependencies:
- "@opentelemetry/semantic-conventions" "1.7.0"
+ "@nevware21/ts-utils" ">= 0.9.4 < 2.x"
-"@opentelemetry/resources@1.7.0":
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.7.0.tgz#90ccd3a6a86b4dfba4e833e73944bd64958d78c5"
- integrity sha512-u1M0yZotkjyKx8dj+46Sg5thwtOTBmtRieNXqdCRiWUp6SfFiIP0bI+1XK3LhuXqXkBXA1awJZaTqKduNMStRg==
+"@nevware21/ts-async@>= 0.2.4 < 2.x":
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/@nevware21/ts-async/-/ts-async-0.3.0.tgz#a8b97ba01065fc930de9a3f4dd4a05e862becc6c"
+ integrity sha512-ZUcgUH12LN/F6nzN0cYd0F/rJaMLmXr0EHVTyYfaYmK55bdwE4338uue4UiVoRqHVqNW4KDUrJc49iGogHKeWA==
dependencies:
- "@opentelemetry/core" "1.7.0"
- "@opentelemetry/semantic-conventions" "1.7.0"
+ "@nevware21/ts-utils" ">= 0.10.0 < 2.x"
-"@opentelemetry/sdk-trace-base@^1.0.1":
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.7.0.tgz#b498424e0c6340a9d80de63fd408c5c2130a60a5"
- integrity sha512-Iz84C+FVOskmauh9FNnj4+VrA+hG5o+tkMzXuoesvSfunVSioXib0syVFeNXwOm4+M5GdWCuW632LVjqEXStIg==
+"@nevware21/ts-utils@>= 0.10.0 < 2.x", "@nevware21/ts-utils@>= 0.9.4 < 2.x", "@nevware21/ts-utils@>= 0.9.5 < 2.x":
+ version "0.10.1"
+ resolved "https://registry.yarnpkg.com/@nevware21/ts-utils/-/ts-utils-0.10.1.tgz#aa65abc71eba06749a396598f22263d26f796ac7"
+ integrity sha512-pMny25NnF2/MJwdqC3Iyjm2pGIXNxni4AROpcqDeWa+td9JMUY4bUS9uU9XW+BoBRqTLUL+WURF9SOd/6OQzRg==
+
+"@opentelemetry/api@^1.4.1":
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.4.1.tgz#ff22eb2e5d476fbc2450a196e40dd243cc20c28f"
+ integrity sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==
+
+"@opentelemetry/core@1.15.2", "@opentelemetry/core@^1.15.2":
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.15.2.tgz#5b170bf223a2333884bbc2d29d95812cdbda7c9f"
+ integrity sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==
dependencies:
- "@opentelemetry/core" "1.7.0"
- "@opentelemetry/resources" "1.7.0"
- "@opentelemetry/semantic-conventions" "1.7.0"
+ "@opentelemetry/semantic-conventions" "1.15.2"
-"@opentelemetry/semantic-conventions@1.7.0", "@opentelemetry/semantic-conventions@^1.0.1":
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.7.0.tgz#af80a1ef7cf110ea3a68242acd95648991bcd763"
- integrity sha512-FGBx/Qd09lMaqQcogCHyYrFEpTx4cAjeS+48lMIR12z7LdH+zofGDVQSubN59nL6IpubfKqTeIDu9rNO28iHVA==
+"@opentelemetry/instrumentation@^0.41.2":
+ version "0.41.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.41.2.tgz#cae11fa64485dcf03dae331f35b315b64bc6189f"
+ integrity sha512-rxU72E0pKNH6ae2w5+xgVYZLzc5mlxAbGzF4shxMVK8YC2QQsfN38B2GPbj0jvrKWWNUElfclQ+YTykkNg/grw==
+ dependencies:
+ "@types/shimmer" "^1.0.2"
+ import-in-the-middle "1.4.2"
+ require-in-the-middle "^7.1.1"
+ semver "^7.5.1"
+ shimmer "^1.2.1"
+
+"@opentelemetry/resources@1.15.2":
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.15.2.tgz#0c9e26cb65652a1402834a3c030cce6028d6dd9d"
+ integrity sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==
+ dependencies:
+ "@opentelemetry/core" "1.15.2"
+ "@opentelemetry/semantic-conventions" "1.15.2"
+
+"@opentelemetry/sdk-trace-base@^1.15.2":
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz#4821f94033c55a6c8bbd35ae387b715b6108517a"
+ integrity sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==
+ dependencies:
+ "@opentelemetry/core" "1.15.2"
+ "@opentelemetry/resources" "1.15.2"
+ "@opentelemetry/semantic-conventions" "1.15.2"
+
+"@opentelemetry/semantic-conventions@1.15.2", "@opentelemetry/semantic-conventions@^1.15.2":
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz#3bafb5de3e20e841dff6cb3c66f4d6e9694c4241"
+ integrity sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==
"@tootallnate/once@2":
version "2.0.0"
@@ -170,15 +264,30 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469"
integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==
-"@vscode/extension-telemetry@^0.7.5":
- version "0.7.5"
- resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.7.5.tgz#bf965731816e08c3f146f96d901ec67954fc913b"
- integrity sha512-fJ5y3TcpqqkFYHneabYaoB4XAhDdVflVm+TDKshw9VOs77jkgNS4UA7LNXrWeO0eDne3Sh3JgURf+xzc1rk69w==
+"@types/shimmer@^1.0.2":
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/@types/shimmer/-/shimmer-1.0.2.tgz#93eb2c243c351f3f17d5c580c7467ae5d686b65f"
+ integrity sha512-dKkr1bTxbEsFlh2ARpKzcaAmsYixqt9UyCdoEZk8rHyE4iQYcDCyvSjDSf7JUWJHlJiTtbIoQjxKh6ViywqDAg==
+
+"@vscode/extension-telemetry@^0.8.4":
+ version "0.8.4"
+ resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.8.4.tgz#c078c6f55df1c9e0592de3b4ce0f685dd345bfe7"
+ integrity sha512-UqM9+KZDDK3MyoHTsg6XNM+XO6pweQxzCpqJz33BoBEYAGsbBviRYcVpJglgay2oReuDD2pOI1Nio3BKNDLhWA==
dependencies:
- "@microsoft/1ds-core-js" "^3.2.8"
- "@microsoft/1ds-post-js" "^3.2.8"
- "@microsoft/applicationinsights-web-basic" "^2.8.9"
- applicationinsights "2.4.1"
+ "@microsoft/1ds-core-js" "^3.2.13"
+ "@microsoft/1ds-post-js" "^3.2.13"
+ "@microsoft/applicationinsights-web-basic" "^3.0.2"
+ applicationinsights "^2.7.1"
+
+acorn-import-assertions@^1.9.0:
+ version "1.9.0"
+ resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac"
+ integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==
+
+acorn@^8.8.2:
+ version "8.10.0"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5"
+ integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==
agent-base@6:
version "6.0.2"
@@ -187,22 +296,24 @@ agent-base@6:
dependencies:
debug "4"
-applicationinsights@2.4.1:
- version "2.4.1"
- resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-2.4.1.tgz#4de4c4dd3c7c4a44445cfbf3d15808fc0dcc423d"
- integrity sha512-0n0Ikd0gzSm460xm+M0UTWIwXrhrH/0bqfZatcJjYObWyefxfAxapGEyNnSGd1Tg90neHz+Yhf+Ff/zgvPiQYA==
+applicationinsights@^2.7.1:
+ version "2.7.3"
+ resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-2.7.3.tgz#8781454d29c0b14c9773f2e892b4cf5e7468ffa5"
+ integrity sha512-JY8+kTEkjbA+kAVNWDtpfW2lqsrDALfDXuxOs74KLPu2y13fy/9WB52V4LfYVTVcW1/jYOXjTxNS2gPZIDh1iw==
dependencies:
- "@azure/core-auth" "^1.4.0"
- "@azure/core-rest-pipeline" "^1.10.0"
+ "@azure/core-auth" "^1.5.0"
+ "@azure/core-rest-pipeline" "1.10.1"
+ "@azure/core-util" "1.2.0"
+ "@azure/opentelemetry-instrumentation-azure-sdk" "^1.0.0-beta.5"
"@microsoft/applicationinsights-web-snippet" "^1.0.1"
- "@opentelemetry/api" "^1.0.4"
- "@opentelemetry/core" "^1.0.1"
- "@opentelemetry/sdk-trace-base" "^1.0.1"
- "@opentelemetry/semantic-conventions" "^1.0.1"
+ "@opentelemetry/api" "^1.4.1"
+ "@opentelemetry/core" "^1.15.2"
+ "@opentelemetry/sdk-trace-base" "^1.15.2"
+ "@opentelemetry/semantic-conventions" "^1.15.2"
cls-hooked "^4.2.2"
continuation-local-storage "^3.2.1"
- diagnostic-channel "1.1.0"
- diagnostic-channel-publishers "1.0.5"
+ diagnostic-channel "1.1.1"
+ diagnostic-channel-publishers "1.0.7"
async-hook-jl@^1.7.6:
version "1.7.6"
@@ -236,6 +347,11 @@ brace-expansion@^2.0.1:
dependencies:
balanced-match "^1.0.0"
+cjs-module-lexer@^1.2.2:
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107"
+ integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==
+
cls-hooked@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/cls-hooked/-/cls-hooked-4.2.2.tgz#ad2e9a4092680cdaffeb2d3551da0e225eae1908"
@@ -260,7 +376,7 @@ continuation-local-storage@^3.2.1:
async-listener "^0.6.0"
emitter-listener "^1.1.1"
-debug@4:
+debug@4, debug@^4.1.1:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
@@ -272,17 +388,17 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
-diagnostic-channel-publishers@1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.5.tgz#df8c317086c50f5727fdfb5d2fce214d2e4130ae"
- integrity sha512-dJwUS0915pkjjimPJVDnS/QQHsH0aOYhnZsLJdnZIMOrB+csj8RnZhWTuwnm8R5v3Z7OZs+ksv5luC14DGB7eg==
+diagnostic-channel-publishers@1.0.7:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.7.tgz#9b7f8d5ee1295481aee19c827d917e96fedf2c4a"
+ integrity sha512-SEECbY5AiVt6DfLkhkaHNeshg1CogdLLANA8xlG/TKvS+XUgvIKl7VspJGYiEdL5OUyzMVnr7o0AwB7f+/Mjtg==
-diagnostic-channel@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-1.1.0.tgz#6985e9dfedfbc072d91dc4388477e4087147756e"
- integrity sha512-fwujyMe1gj6rk6dYi9hMZm0c8Mz8NDMVl2LB4iaYh3+LIAThZC8RKFGXWG0IML2OxAit/ZFRgZhMkhQ3d/bobQ==
+diagnostic-channel@1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-1.1.1.tgz#44b60972de9ee055c16216535b0e9db3f6a0efd0"
+ integrity sha512-r2HV5qFkUICyoaKlBEpLKHjxMXATUf/l+h8UZPGBHGLy4DDiY2sOLcIctax4eRnTw5wH2jTMExLntGPJ8eOJxw==
dependencies:
- semver "^5.3.0"
+ semver "^7.5.3"
emitter-listener@^1.0.1, emitter-listener@^1.1.1:
version "1.1.2"
@@ -300,6 +416,18 @@ form-data@^4.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"
+function-bind@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
+ integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
+
+has@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
+ integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
+ dependencies:
+ function-bind "^1.1.1"
+
http-proxy-agent@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43"
@@ -317,6 +445,23 @@ https-proxy-agent@^5.0.0:
agent-base "6"
debug "4"
+import-in-the-middle@1.4.2:
+ version "1.4.2"
+ resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.4.2.tgz#2a266676e3495e72c04bbaa5ec14756ba168391b"
+ integrity sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==
+ dependencies:
+ acorn "^8.8.2"
+ acorn-import-assertions "^1.9.0"
+ cjs-module-lexer "^1.2.2"
+ module-details-from-path "^1.0.3"
+
+is-core-module@^2.13.0:
+ version "2.13.0"
+ resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db"
+ integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==
+ dependencies:
+ has "^1.0.3"
+
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
@@ -343,29 +488,57 @@ minimatch@^5.1.0:
dependencies:
brace-expansion "^2.0.1"
+module-details-from-path@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b"
+ integrity sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==
+
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
+path-parse@^1.0.7:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
+ integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
+
request-light@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.7.0.tgz#885628bb2f8040c26401ebf258ec51c4ae98ac2a"
integrity sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==
+require-in-the-middle@^7.1.1:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz#b539de8f00955444dc8aed95e17c69b0a4f10fcf"
+ integrity sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==
+ dependencies:
+ debug "^4.1.1"
+ module-details-from-path "^1.0.3"
+ resolve "^1.22.1"
+
+resolve@^1.22.1:
+ version "1.22.4"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34"
+ integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==
+ dependencies:
+ is-core-module "^2.13.0"
+ path-parse "^1.0.7"
+ supports-preserve-symlinks-flag "^1.0.0"
+
semver@^5.3.0, semver@^5.4.1:
version "5.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
-semver@^7.3.7:
+semver@^7.3.7, semver@^7.5.1, semver@^7.5.3:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"
-shimmer@^1.1.0, shimmer@^1.2.0:
+shimmer@^1.1.0, shimmer@^1.2.0, shimmer@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337"
integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==
@@ -375,6 +548,11 @@ stack-chain@^1.3.7:
resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285"
integrity sha512-D8cWtWVdIe/jBA7v5p5Hwl5yOSOrmZPWDPe2KxQ5UAGD+nxbxU0lKXA4h85Ta6+qgdKVL3vUxsbIZjc1kBG7ug==
+supports-preserve-symlinks-flag@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
+ integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
+
tslib@^2.2.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e"
@@ -385,32 +563,32 @@ uuid@^8.3.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
-vscode-jsonrpc@8.2.0-next.0:
- version "8.2.0-next.0"
- resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.0.tgz#41409413c8cebf10f2f1b7cc87e330f0e292814c"
- integrity sha512-13jYzaFQpTz5qQ2P+l5c/iTVsj1wUpflP0CR/v4XaEpM0oToLEXZBTcuuox1WaGIbu3Av3xxmGNU4Hydl1iNKg==
+vscode-jsonrpc@8.2.0-next.2:
+ version "8.2.0-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0-next.2.tgz#09d72832353fc7fb43b33c9c68b083907f6a8a68"
+ integrity sha512-1FQrqLselaLLe5ApFSU/8qGUbJ8tByWbqczMkT2PEDpDYthCQTe5wONPuVphe7BB+FvZwvBFI2kFkY7FtyHc1A==
-vscode-languageclient@^8.2.0-next.1:
- version "8.2.0-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.2.0-next.1.tgz#a3f98b80cfa3225fde0583aa6a5c9b20219fa37e"
- integrity sha512-oITaqHQ10PM3zXCUu/104wriMeDutXMkQXMaRBWh1jKihcNcUBLC/os7RhqiVGypY0nl+F0pwStAf4Koc8inaw==
+vscode-languageclient@^8.2.0-next.3:
+ version "8.2.0-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.2.0-next.3.tgz#a5086f451a679ce77106d8fd1e05c8cbf8e9b886"
+ integrity sha512-Ojo6L2cb7GSiyD864k8vGb9fHxBdZeciHQQOF595C3IDHWg0w4KQ7iN7qGWVdl4wDNwlGTX3wWZawGfPTxnrPQ==
dependencies:
minimatch "^5.1.0"
semver "^7.3.7"
- vscode-languageserver-protocol "3.17.4-next.1"
+ vscode-languageserver-protocol "3.17.4-next.3"
-vscode-languageserver-protocol@3.17.4-next.1:
- version "3.17.4-next.1"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.1.tgz#a15480e1bc663853ae90ded226efafc5ab333616"
- integrity sha512-qrK4BycgPR/+nkRN9PRVTblkLp+kUPUmAgF6rDhFzZIPXW4/MqWwFUT8uswIMGdlTPPgCEkFO/AYEZK1fDXODg==
+vscode-languageserver-protocol@3.17.4-next.3:
+ version "3.17.4-next.3"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.4-next.3.tgz#7d1d4fcaaa3213a8f2b8a6f1efa8187163251b7c"
+ integrity sha512-GnW3ldfzlsDK9B1/L1edBW1ddSakC59r+DRipTYCcXIT/zCCbLID998Dxn+exgrL33e3/XLQ+7hQQiSz6TnhKQ==
dependencies:
- vscode-jsonrpc "8.2.0-next.0"
- vscode-languageserver-types "3.17.4-next.0"
+ vscode-jsonrpc "8.2.0-next.2"
+ vscode-languageserver-types "3.17.4-next.2"
-vscode-languageserver-types@3.17.4-next.0:
- version "3.17.4-next.0"
- resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.0.tgz#4b5238d21cceaeb836d36a05d23c61a8c0238de2"
- integrity sha512-2FPKboHnT04xYjfM8JpJVBz4a/tryMw58jmzucaabZMZN5hzoFBrhc97jNG4n6edr9JUb9+QSwwcAcYpDTAoag==
+vscode-languageserver-types@3.17.4-next.2:
+ version "3.17.4-next.2"
+ resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.4-next.2.tgz#4099ff39b38edbd2680df13bfb1c05f0c07bfe8d"
+ integrity sha512-r6tXyCXyXQH7b6VHkvRT0Nd9v+DWQiosgTR6HQajCb4iJ1myr3KgueWEGBF1Ph5/YAiDy8kXUhf8dHl7wE1H2A==
yallist@^4.0.0:
version "4.0.0"
diff --git a/extensions/tunnel-forwarding/src/extension.ts b/extensions/tunnel-forwarding/src/extension.ts
index 3dd6fdfef19..f6ef85e71b1 100644
--- a/extensions/tunnel-forwarding/src/extension.ts
+++ b/extensions/tunnel-forwarding/src/extension.ts
@@ -25,7 +25,7 @@ const cliPath = process.env.VSCODE_FORWARDING_IS_DEV
? path.join(__dirname, '../../../cli/target/debug/code')
: path.join(
vscode.env.appRoot,
- process.platform === 'win32' ? '../../bin' : 'bin',
+ process.platform === 'darwin' ? 'bin' : '../../bin',
vscode.env.appQuality === 'stable' ? 'code-tunnel' : 'code-tunnel-insiders',
) + (process.platform === 'win32' ? '.exe' : '');
@@ -231,8 +231,8 @@ class TunnelProvider implements vscode.TunnelProvider {
];
this.logger.log('info', '[forwarding] starting CLI');
- const process = spawn(cliPath, args, { stdio: 'pipe' });
- this.state = { state: State.Starting, process };
+ const child = spawn(cliPath, args, { stdio: 'pipe', env: { ...process.env, NO_COLOR: '1' } });
+ this.state = { state: State.Starting, process: child };
const progressP = new DeferredPromise();
vscode.window.withProgress(
@@ -248,29 +248,29 @@ class TunnelProvider implements vscode.TunnelProvider {
);
let lastPortFormat: string | undefined;
- process.on('exit', status => {
+ child.on('exit', status => {
const msg = `[forwarding] exited with code ${status}`;
this.logger.log('info', msg);
progressP.complete(); // make sure to clear progress on unexpected exit
- if (this.isInStateWithProcess(process)) {
+ if (this.isInStateWithProcess(child)) {
this.state = { state: State.Error, error: msg };
}
});
- process.on('error', err => {
+ child.on('error', err => {
this.logger.log('error', `[forwarding] ${err}`);
progressP.complete(); // make sure to clear progress on unexpected exit
- if (this.isInStateWithProcess(process)) {
+ if (this.isInStateWithProcess(child)) {
this.state = { state: State.Error, error: String(err) };
}
});
- process.stdout
+ child.stdout
.pipe(splitNewLines())
.on('data', line => this.logger.log('info', `[forwarding] ${line}`))
.resume();
- process.stderr
+ child.stderr
.pipe(splitNewLines())
.on('data', line => {
try {
@@ -278,7 +278,7 @@ class TunnelProvider implements vscode.TunnelProvider {
if (l.port_format && l.port_format !== lastPortFormat) {
this.state = {
state: State.Active,
- portFormat: l.port_format, process,
+ portFormat: l.port_format, process: child,
cleanupTimeout: 'cleanupTimeout' in this.state ? this.state.cleanupTimeout : undefined,
};
progressP.complete();
@@ -290,8 +290,8 @@ class TunnelProvider implements vscode.TunnelProvider {
.resume();
await new Promise((resolve, reject) => {
- process.on('spawn', resolve);
- process.on('error', reject);
+ child.on('spawn', resolve);
+ child.on('error', reject);
});
}
}
diff --git a/extensions/tunnel-forwarding/src/split.ts b/extensions/tunnel-forwarding/src/split.ts
index 6e9d7474604..33ad055ac67 100644
--- a/extensions/tunnel-forwarding/src/split.ts
+++ b/extensions/tunnel-forwarding/src/split.ts
@@ -9,6 +9,8 @@ export const splitNewLines = () => new StreamSplitter('\n'.charCodeAt(0));
/**
* Copied and simplified from src\vs\base\node\nodeStreams.ts
+ *
+ * Exception: does not include the split character in the output.
*/
export class StreamSplitter extends Transform {
private buffer: Buffer | undefined;
@@ -31,7 +33,7 @@ export class StreamSplitter extends Transform {
break;
}
- this.push(this.buffer.subarray(offset, index + 1));
+ this.push(this.buffer.subarray(offset, index));
offset = index + 1;
}
diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts
index 6e0c8e59404..e69eecff5d1 100644
--- a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts
+++ b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts
@@ -977,6 +977,22 @@ suite('vscode API - workspace', () => {
assert.strictEqual(document.getText(), expected);
});
+
+ test('[Bug] Failed to create new test file when in an untitled file #1261', async function () {
+ const uri = vscode.Uri.parse('untitled:Untitled-5.test');
+ const contents = `Hello Test File ${uri.toString()}`;
+ const we = new vscode.WorkspaceEdit();
+ we.createFile(uri, { ignoreIfExists: true });
+ we.replace(uri, new vscode.Range(0, 0, 0, 0), contents);
+
+ const success = await vscode.workspace.applyEdit(we);
+
+ assert.ok(success);
+
+ const doc = await vscode.workspace.openTextDocument(uri);
+ assert.strictEqual(doc.getText(), contents);
+ });
+
test('Should send a single FileWillRenameEvent instead of separate events when moving multiple files at once#111867, 1/3', async function () {
const file1 = await createRandomFile();
diff --git a/package.json b/package.json
index 080af3cecd2..4a0405868b6 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
- "version": "1.82.0",
- "distro": "56bfb9ce4a8d2298f475a1b8d9c7a7b5a72204f2",
+ "version": "1.83.0",
+ "distro": "46e7bb69af9f06de037c3d7e8f61de4a679f9ef1",
"author": {
"name": "Microsoft Corporation"
},
@@ -150,10 +150,10 @@
"cssnano": "^4.1.11",
"debounce": "^1.0.0",
"deemon": "^1.8.0",
- "electron": "25.5.0",
+ "electron": "25.8.0",
"eslint": "8.36.0",
"eslint-plugin-header": "3.1.1",
- "eslint-plugin-jsdoc": "^39.3.2",
+ "eslint-plugin-jsdoc": "^46.5.0",
"eslint-plugin-local": "^1.0.0",
"event-stream": "3.3.4",
"fancy-log": "^1.3.3",
diff --git a/product.json b/product.json
index 2ae3ee8f0f8..acb24971c39 100644
--- a/product.json
+++ b/product.json
@@ -52,8 +52,8 @@
},
{
"name": "ms-vscode.js-debug",
- "version": "1.81.0",
- "sha256": "6d1c7ee89881afd65e8fee47445b6a1c5fb345bf30e2bdf70cd2fdd8d1ff6dec",
+ "version": "1.82.0",
+ "sha256": "4fba41b4b764c3f5a6591d6d9a5bdc59b417f2d799071c889c2b54163f256282",
"repo": "https://github.com/microsoft/vscode-js-debug",
"metadata": {
"id": "25629058-ddac-4e17-abba-74678e126c5d",
diff --git a/remote/.yarnrc b/remote/.yarnrc
index c4421581246..26dc815d0f8 100644
--- a/remote/.yarnrc
+++ b/remote/.yarnrc
@@ -1,5 +1,5 @@
disturl "https://nodejs.org/dist"
target "18.15.0"
-ms_build_id "223745"
+ms_build_id "229541"
runtime "node"
build_from_source "true"
diff --git a/scripts/debugger-scripts-api.d.ts b/scripts/debugger-scripts-api.d.ts
new file mode 100644
index 00000000000..149912bc04f
--- /dev/null
+++ b/scripts/debugger-scripts-api.d.ts
@@ -0,0 +1,22 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+type RunFunction = ((debugSession: IDebugSession) => IDisposable) | ((debugSession: IDebugSession) => Promise);
+
+interface IDebugSession {
+ name: string;
+ eval(expression: string): Promise;
+ evalJs(bodyFn: (...args: T) => void, ...args: T): Promise;
+}
+
+interface IDisposable {
+ dispose(): void;
+}
+
+interface GlobalThisAddition extends globalThis {
+ $hotReload_applyNewExports?(oldExports: Record): AcceptNewExportsFn | undefined;
+}
+
+type AcceptNewExportsFn = (newExports: Record) => boolean;
diff --git a/scripts/hot-reload-injected-script.js b/scripts/hot-reload-injected-script.js
new file mode 100644
index 00000000000..c6311f3b9c9
--- /dev/null
+++ b/scripts/hot-reload-injected-script.js
@@ -0,0 +1,267 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+// @ts-check
+///
+
+const path = require('path');
+const fsPromise = require('fs/promises');
+const parcelWatcher = require('@parcel/watcher');
+
+// This file is loaded by the vscode-diagnostic-tools extension and injected into the debugger.
+
+/** @type {RunFunction} */
+module.exports.run = async function (debugSession) {
+ const watcher = await DirWatcher.watchRecursively(path.join(__dirname, '../out/'));
+
+ const sub = watcher.onDidChange(changes => {
+ const supportedChanges = changes.filter(c => c.path.endsWith('.js') || c.path.endsWith('.css'));
+ debugSession.evalJs(function (changes, debugSessionName) {
+ // This function is stringified and injected into the debuggee.
+
+ /** @type {{ count: number; originalWindowTitle: any; timeout: any; shouldReload: boolean }} */
+ const hotReloadData = globalThis.$hotReloadData || (globalThis.$hotReloadData = { count: 0, messageHideTimeout: undefined, shouldReload: false });
+
+ /**
+ * @param {string} path
+ * @param {string} newSrc
+ */
+ function handleChange(path, newSrc) {
+ const relativePath = path.replace(/\\/g, '/').split('/out/')[1];
+ if (relativePath.endsWith('.css')) {
+ handleCssChange(relativePath);
+ } else if (relativePath.endsWith('.js')) {
+ handleJsChange(relativePath, newSrc);
+ }
+ }
+
+ /**
+ * @param {string} relativePath
+ */
+ function handleCssChange(relativePath) {
+ if (typeof document === 'undefined') {
+ return;
+ }
+
+ const styleSheet = (/** @type {HTMLLinkElement[]} */ ([...document.querySelectorAll(`link[rel='stylesheet']`)]))
+ .find(l => new URL(l.href, document.location.href).pathname.endsWith(relativePath));
+ if (styleSheet) {
+ setMessage(`reload ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`);
+ console.log(debugSessionName, 'css reloaded', relativePath);
+ styleSheet.href = styleSheet.href.replace(/\?.*/, '') + '?' + Date.now();
+ } else {
+ setMessage(`could not reload ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`);
+ console.log(debugSessionName, 'ignoring css change, as stylesheet is not loaded', relativePath);
+ }
+ }
+
+ /**
+ * @param {string} relativePath
+ * @param {string} newSrc
+ */
+ function handleJsChange(relativePath, newSrc) {
+ const moduleIdStr = trimEnd(relativePath, '.js');
+
+ /** @type {any} */
+ const requireFn = globalThis.require;
+ const moduleManager = requireFn.moduleManager;
+ if (!moduleManager) {
+ console.log(debugSessionName, 'ignoring js change, as moduleManager is not available', relativePath);
+ return;
+ }
+
+ const moduleId = moduleManager._moduleIdProvider.getModuleId(moduleIdStr);
+ const oldModule = moduleManager._modules2[moduleId];
+
+ if (!oldModule) {
+ console.log(debugSessionName, 'ignoring js change, as module is not loaded', relativePath);
+ return;
+ }
+
+ // Check if we can reload
+ const g = /** @type {GlobalThisAddition} */ (globalThis);
+
+ // A frozen copy of the previous exports
+ const oldExports = Object.freeze({ ...oldModule.exports });
+ const reloadFn = g.$hotReload_applyNewExports?.(oldExports);
+
+ if (!reloadFn) {
+ console.log(debugSessionName, 'ignoring js change, as module does not support hot-reload', relativePath);
+ hotReloadData.shouldReload = true;
+ setMessage(`hot reload not supported for ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`);
+ return;
+ }
+
+ const newScript = new Function('define', newSrc); // CodeQL [SM01632] This code is only executed during development. It is required for the hot-reload functionality.
+
+ newScript(/* define */ function (deps, callback) {
+ // Evaluating the new code was successful.
+
+ // Redefine the module
+ delete moduleManager._modules2[moduleId];
+ moduleManager.defineModule(moduleIdStr, deps, callback);
+ const newModule = moduleManager._modules2[moduleId];
+
+
+ // Patch the exports of the old module, so that modules using the old module get the new exports
+ Object.assign(oldModule.exports, newModule.exports);
+ // We override the exports so that future reloads still patch the initial exports.
+ newModule.exports = oldModule.exports;
+
+ const successful = reloadFn(newModule.exports);
+ if (!successful) {
+ hotReloadData.shouldReload = true;
+ setMessage(`hot reload failed ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`);
+ console.log(debugSessionName, 'hot reload was not successful', relativePath);
+ return;
+ }
+
+ console.log(debugSessionName, 'hot reloaded', moduleIdStr);
+ setMessage(`successfully reloaded ${formatPath(relativePath)} - ${new Date().toLocaleTimeString()}`);
+ });
+ }
+
+ /**
+ * @param {string} message
+ */
+ function setMessage(message) {
+ const domElem = /** @type {HTMLDivElement | undefined} */ (document.querySelector('.titlebar-center .window-title'));
+ if (!domElem) { return; }
+ if (!hotReloadData.timeout) {
+ hotReloadData.originalWindowTitle = domElem.innerText;
+ } else {
+ clearTimeout(hotReloadData.timeout);
+ }
+ if (hotReloadData.shouldReload) {
+ message += ' (manual reload required)';
+ }
+
+ domElem.innerText = message;
+ hotReloadData.timeout = setTimeout(() => {
+ hotReloadData.timeout = undefined;
+ // If wanted, we can restore the previous title message
+ // domElem.replaceChildren(hotReloadData.originalWindowTitle);
+ }, 5000);
+ }
+
+ /**
+ * @param {string} path
+ * @returns {string}
+ */
+ function formatPath(path) {
+ const parts = path.split('/');
+ parts.reverse();
+ let result = parts[0];
+ parts.shift();
+ for (const p of parts) {
+ if (result.length + p.length > 40) {
+ break;
+ }
+ result = p + '/' + result;
+ if (result.length > 20) {
+ break;
+ }
+ }
+ return result;
+ }
+
+ function trimEnd(str, suffix) {
+ if (str.endsWith(suffix)) {
+ return str.substring(0, str.length - suffix.length);
+ }
+ return str;
+ }
+
+ for (const change of changes) {
+ handleChange(change.path, change.newContent);
+ }
+
+ }, supportedChanges, debugSession.name.substring(0, 25));
+ });
+
+ return {
+ dispose() {
+ sub.dispose();
+ watcher.dispose();
+ }
+ };
+};
+
+class DirWatcher {
+ /**
+ *
+ * @param {string} dir
+ * @returns {Promise}
+ */
+ static async watchRecursively(dir) {
+ /** @type {((changes: { path: string, newContent: string }[]) => void)[]} */
+ const listeners = [];
+ /** @type {Map } */
+ const fileContents = new Map();
+ /** @type {Map} */
+ const changes = new Map();
+ /** @type {(handler: (changes: { path: string, newContent: string }[]) => void) => IDisposable} */
+ const event = (handler) => {
+ listeners.push(handler);
+ return {
+ dispose: () => {
+ const idx = listeners.indexOf(handler);
+ if (idx >= 0) {
+ listeners.splice(idx, 1);
+ }
+ }
+ };
+ };
+ const r = parcelWatcher.subscribe(dir, async (err, events) => {
+ for (const e of events) {
+ if (e.type === 'update') {
+ const newContent = await fsPromise.readFile(e.path, 'utf8');
+ if (fileContents.get(e.path) !== newContent) {
+ fileContents.set(e.path, newContent);
+ changes.set(e.path, { path: e.path, newContent });
+ }
+ }
+ }
+ if (changes.size > 0) {
+ debounce(() => {
+ const uniqueChanges = Array.from(changes.values());
+ changes.clear();
+ listeners.forEach(l => l(uniqueChanges));
+ })();
+ }
+ });
+ const result = await r;
+ return new DirWatcher(event, () => result.unsubscribe());
+ }
+
+ /**
+ * @param {(handler: (changes: { path: string, newContent: string }[]) => void) => IDisposable} onDidChange
+ * @param {() => void} unsub
+ */
+ constructor(onDidChange, unsub) {
+ this.onDidChange = onDidChange;
+ this.unsub = unsub;
+ }
+
+ dispose() {
+ this.unsub();
+ }
+}
+
+/**
+ * Debounce function calls
+ * @param {() => void} fn
+ * @param {number} delay
+ */
+function debounce(fn, delay = 50) {
+ let timeoutId;
+ return function (...args) {
+ clearTimeout(timeoutId);
+ timeoutId = setTimeout(() => {
+ fn.apply(this, args);
+ }, delay);
+ };
+}
+
diff --git a/src/vs/base/browser/ui/codicons/codicon/codicon.ttf b/src/vs/base/browser/ui/codicons/codicon/codicon.ttf
index b5623b0a55c..91105610d11 100644
Binary files a/src/vs/base/browser/ui/codicons/codicon/codicon.ttf and b/src/vs/base/browser/ui/codicons/codicon/codicon.ttf differ
diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts
index ee900068b4b..262d3ca9e2e 100644
--- a/src/vs/base/browser/ui/list/listWidget.ts
+++ b/src/vs/base/browser/ui/list/listWidget.ts
@@ -532,13 +532,16 @@ class TypeNavigationController implements IDisposable {
const prefix = matchesPrefix(word, labelStr);
const fuzzy = matchesFuzzy2(word, labelStr);
- // ensures that when fuzzy matching, it doesn't clash with prefix matching (1 input vs 1+ should be prefix and fuzzy respecitvely)
- const fuzzyScore = fuzzy ? fuzzy[0].end - fuzzy[0].start : 0;
- if (prefix || fuzzyScore > 1) {
- this.previouslyFocused = start;
- this.list.setFocus([index]);
- this.list.reveal(index);
- return;
+ if (fuzzy) {
+ const fuzzyScore = fuzzy[0].end - fuzzy[0].start;
+
+ // ensures that when fuzzy matching, doesn't clash with prefix matching (1 input vs 1+ should be prefix and fuzzy respecitvely). Also makes sure that exact matches are prioritized.
+ if (prefix || (fuzzyScore > 1 && fuzzy.length === 1)) {
+ this.previouslyFocused = start;
+ this.list.setFocus([index]);
+ this.list.reveal(index);
+ return;
+ }
}
}
} else {
@@ -729,10 +732,6 @@ export class MouseController implements IDisposable {
return;
}
- if (this.isSelectionRangeChangeEvent(e)) {
- return this.changeSelection(e);
- }
-
if (this.isSelectionChangeEvent(e)) {
return this.changeSelection(e);
}
diff --git a/src/vs/base/common/arrays.ts b/src/vs/base/common/arrays.ts
index 22c2859f5e9..71bedc3a440 100644
--- a/src/vs/base/common/arrays.ts
+++ b/src/vs/base/common/arrays.ts
@@ -177,6 +177,30 @@ export function groupBy(data: ReadonlyArray, compare: (a: T, b: T) => numb
return result;
}
+/**
+ * Splits the given items into a list of (non-empty) groups.
+ * `shouldBeGrouped` is used to decide if two consecutive items should be in the same group.
+ * The order of the items is preserved.
+ */
+export function* groupAdjacentBy(items: Iterable, shouldBeGrouped: (item1: T, item2: T) => boolean): Iterable {
+ let currentGroup: T[] | undefined;
+ let last: T | undefined;
+ for (const item of items) {
+ if (last !== undefined && shouldBeGrouped(last, item)) {
+ currentGroup!.push(item);
+ } else {
+ if (currentGroup) {
+ yield currentGroup;
+ }
+ currentGroup = [item];
+ }
+ last = item;
+ }
+ if (currentGroup) {
+ yield currentGroup;
+ }
+}
+
interface IMutableSplice extends ISplice {
readonly toInsert: T[];
deleteCount: number;
@@ -666,6 +690,10 @@ export namespace CompareResult {
return result < 0;
}
+ export function isLessThanOrEqual(result: CompareResult): boolean {
+ return result <= 0;
+ }
+
export function isGreaterThan(result: CompareResult): boolean {
return result > 0;
}
diff --git a/src/vs/base/common/arraysFind.ts b/src/vs/base/common/arraysFind.ts
new file mode 100644
index 00000000000..91a1b710823
--- /dev/null
+++ b/src/vs/base/common/arraysFind.ts
@@ -0,0 +1,109 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+/**
+ * Finds the last item where predicate is true using binary search.
+ * `predicate` must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!
+ *
+ * @returns `undefined` if no item matches, otherwise the last item that matches the predicate.
+ */
+export function findLastMonotonous(arr: T[], predicate: (item: T) => boolean): T | undefined {
+ const idx = findLastIdxMonotonous(arr, predicate);
+ return idx === -1 ? undefined : arr[idx];
+}
+
+/**
+ * Finds the last item where predicate is true using binary search.
+ * `predicate` must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!
+ *
+ * @returns `startIdx - 1` if predicate is false for all items, otherwise the index of the last item that matches the predicate.
+ */
+export function findLastIdxMonotonous(arr: T[], predicate: (item: T) => boolean, startIdx = 0, endIdxEx = arr.length): number {
+ let i = startIdx;
+ let j = endIdxEx;
+ while (i < j) {
+ const k = Math.floor((i + j) / 2);
+ if (predicate(arr[k])) {
+ i = k + 1;
+ } else {
+ j = k;
+ }
+ }
+ return i - 1;
+}
+
+
+/**
+ * Finds the first item where predicate is true using binary search.
+ * `predicate` must be monotonous, i.e. `arr.map(predicate)` must be like `[false, ..., false, true, ..., true]`!
+ *
+ * @returns `undefined` if no item matches, otherwise the first item that matches the predicate.
+ */
+export function findFirstMonotonous(arr: T[], predicate: (item: T) => boolean): T | undefined {
+ const idx = findFirstIdxMonotonousOrArrLen(arr, predicate);
+ return idx === arr.length ? undefined : arr[idx];
+}
+
+/**
+ * Finds the first item where predicate is true using binary search.
+ * `predicate` must be monotonous, i.e. `arr.map(predicate)` must be like `[false, ..., false, true, ..., true]`!
+ *
+ * @returns `endIdxEx` if predicate is false for all items, otherwise the index of the first item that matches the predicate.
+ */
+export function findFirstIdxMonotonousOrArrLen(arr: T[], predicate: (item: T) => boolean, startIdx = 0, endIdxEx = arr.length): number {
+ let i = startIdx;
+ let j = endIdxEx;
+ while (i < j) {
+ const k = Math.floor((i + j) / 2);
+ if (predicate(arr[k])) {
+ j = k;
+ } else {
+ i = k + 1;
+ }
+ }
+ return i;
+}
+
+export function findFirstIdxMonotonous(arr: T[], predicate: (item: T) => boolean, startIdx = 0, endIdxEx = arr.length): number {
+ const idx = findFirstIdxMonotonousOrArrLen(arr, predicate, startIdx, endIdxEx);
+ return idx === arr.length ? -1 : idx;
+}
+
+/**
+ * Use this when
+ * * You have a sorted array
+ * * You query this array with a monotonous predicate to find the last item that has a certain property.
+ * * You query this array multiple times with monotonous predicates that get weaker and weaker.
+ */
+export class MonotonousArray {
+ public static assertInvariants = false;
+
+ private _findLastMonotonousLastIdx = 0;
+ private _lastPredicate: ((item: T) => boolean) | undefined;
+
+ constructor(private readonly _items: T[]) {
+ }
+
+ /**
+ * The predicate must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!
+ * For subsequent calls, current predicate must be weaker than (or equal to) the previous predicate, i.e. more entries must be `true`.
+ */
+ findLastMonotonous(predicate: (item: T) => boolean): T | undefined {
+ if (MonotonousArray.assertInvariants) {
+ if (this._lastPredicate) {
+ for (const item of this._items) {
+ if (this._lastPredicate(item) && !predicate(item)) {
+ throw new Error('MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.');
+ }
+ }
+ }
+ this._lastPredicate = predicate;
+ }
+
+ const idx = findLastIdxMonotonous(this._items, predicate, this._findLastMonotonousLastIdx);
+ this._findLastMonotonousLastIdx = idx + 1;
+ return idx === -1 ? undefined : this._items[idx];
+ }
+}
diff --git a/src/vs/base/common/codicons.ts b/src/vs/base/common/codicons.ts
index 48dd3abfb72..0c5fd5a01e8 100644
--- a/src/vs/base/common/codicons.ts
+++ b/src/vs/base/common/codicons.ts
@@ -567,6 +567,7 @@ export const Codicon = {
send: register('send', 0xec0f),
sparkle: register('sparkle', 0xec10),
insert: register('insert', 0xec11),
+ mic: register('mic', 0xec12),
// derived icons, that could become separate icons
diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts
index 52a4b2d20f6..c26c0271f39 100644
--- a/src/vs/base/common/event.ts
+++ b/src/vs/base/common/event.ts
@@ -557,6 +557,24 @@ export namespace Event {
return new Promise(resolve => once(event)(resolve));
}
+ /**
+ * Creates an event out of a promise that fires once when the promise is
+ * resolved with the result of the promise or `undefined`.
+ */
+ export function fromPromise(promise: Promise): Event {
+ const result = new Emitter();
+
+ promise.then(res => {
+ result.fire(res);
+ }, () => {
+ result.fire(undefined);
+ }).finally(() => {
+ result.dispose();
+ });
+
+ return result.event;
+ }
+
/**
* Adds a listener to an event and calls the listener immediately with undefined as the event object.
*
diff --git a/src/vs/base/common/hotReload.ts b/src/vs/base/common/hotReload.ts
new file mode 100644
index 00000000000..17724907937
--- /dev/null
+++ b/src/vs/base/common/hotReload.ts
@@ -0,0 +1,59 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import { IDisposable } from 'vs/base/common/lifecycle';
+import { env } from 'vs/base/common/process';
+
+export function isHotReloadEnabled(): boolean {
+ return !!env['VSCODE_DEV'];
+}
+export function registerHotReloadHandler(handler: HotReloadHandler): IDisposable {
+ if (!isHotReloadEnabled()) {
+ return { dispose() { } };
+ } else {
+ const handlers = registerGlobalHotReloadHandler();
+
+ handlers.add(handler);
+ return {
+ dispose() { handlers.delete(handler); }
+ };
+ }
+}
+
+/**
+ * Takes the old exports of the module to reload and returns a function to apply the new exports.
+ * If `undefined` is returned, this handler is not able to handle the module.
+ *
+ * If no handler can apply the new exports, the module will not be reloaded.
+ */
+export type HotReloadHandler = (oldExports: Record) => AcceptNewExportsHandler | undefined;
+export type AcceptNewExportsHandler = (newExports: Record) => boolean;
+
+function registerGlobalHotReloadHandler() {
+ if (!hotReloadHandlers) {
+ hotReloadHandlers = new Set();
+ }
+
+ const g = globalThis as unknown as GlobalThisAddition;
+ if (!g.$hotReload_applyNewExports) {
+ g.$hotReload_applyNewExports = oldExports => {
+ for (const h of hotReloadHandlers!) {
+ const result = h(oldExports);
+ if (result) { return result; }
+ }
+ return undefined;
+ };
+ }
+
+ return hotReloadHandlers;
+}
+
+let hotReloadHandlers: Set<(oldExports: Record) => AcceptNewExportsFn | undefined> | undefined = undefined;
+
+interface GlobalThisAddition {
+ $hotReload_applyNewExports?(oldExports: Record): AcceptNewExportsFn | undefined;
+}
+
+type AcceptNewExportsFn = (newExports: Record) => boolean;
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
index 47b2de558c4..ea129e9298a 100644
--- a/src/vs/base/common/product.ts
+++ b/src/vs/base/common/product.ts
@@ -186,6 +186,7 @@ export interface IProductConfiguration {
readonly profileTemplatesUrl?: string;
readonly commonlyUsedSettings?: string[];
+ readonly aiGeneratedWorkspaceTrust?: IAiGeneratedWorkspaceTrust;
}
export interface ITunnelApplicationConfig {
@@ -279,3 +280,11 @@ export interface ISurveyData {
editCount: number;
userProbability: number;
}
+
+export interface IAiGeneratedWorkspaceTrust {
+ readonly title: string;
+ readonly checkboxText: string;
+ readonly trustOption: string;
+ readonly dontTrustOption: string;
+ readonly startupTrustRequestLearnMore: string;
+}
diff --git a/src/vs/base/test/common/arraysFind.test.ts b/src/vs/base/test/common/arraysFind.test.ts
new file mode 100644
index 00000000000..db9fcc44b82
--- /dev/null
+++ b/src/vs/base/test/common/arraysFind.test.ts
@@ -0,0 +1,58 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import assert = require('assert');
+import { MonotonousArray, findFirstMonotonous, findLastMonotonous } from 'vs/base/common/arraysFind';
+
+suite('Arrays', () => {
+ test('findLastMonotonous', () => {
+ const array = [1, 4, 5, 7, 55, 59, 60, 61, 64, 69];
+
+ const result = findLastMonotonous(array, n => n <= 60);
+ assert.strictEqual(result, 60);
+
+ const result2 = findLastMonotonous(array, n => n <= 62);
+ assert.strictEqual(result2, 61);
+
+ const result3 = findLastMonotonous(array, n => n <= 1);
+ assert.strictEqual(result3, 1);
+
+ const result4 = findLastMonotonous(array, n => n <= 70);
+ assert.strictEqual(result4, 69);
+
+ const result5 = findLastMonotonous(array, n => n <= 0);
+ assert.strictEqual(result5, undefined);
+ });
+
+ test('findFirstMonotonous', () => {
+ const array = [1, 4, 5, 7, 55, 59, 60, 61, 64, 69];
+
+ const result = findFirstMonotonous(array, n => n >= 60);
+ assert.strictEqual(result, 60);
+
+ const result2 = findFirstMonotonous(array, n => n >= 62);
+ assert.strictEqual(result2, 64);
+
+ const result3 = findFirstMonotonous(array, n => n >= 1);
+ assert.strictEqual(result3, 1);
+
+ const result4 = findFirstMonotonous(array, n => n >= 70);
+ assert.strictEqual(result4, undefined);
+
+ const result5 = findFirstMonotonous(array, n => n >= 0);
+ assert.strictEqual(result5, 1);
+ });
+
+ test('MonotonousArray', () => {
+ const arr = new MonotonousArray([1, 4, 5, 7, 55, 59, 60, 61, 64, 69]);
+ assert.strictEqual(arr.findLastMonotonous(n => n <= 0), undefined);
+ assert.strictEqual(arr.findLastMonotonous(n => n <= 0), undefined);
+ assert.strictEqual(arr.findLastMonotonous(n => n <= 5), 5);
+ assert.strictEqual(arr.findLastMonotonous(n => n <= 6), 5);
+ assert.strictEqual(arr.findLastMonotonous(n => n <= 55), 55);
+ assert.strictEqual(arr.findLastMonotonous(n => n <= 60), 60);
+ assert.strictEqual(arr.findLastMonotonous(n => n <= 80), 69);
+ });
+});
diff --git a/src/vs/base/test/common/event.test.ts b/src/vs/base/test/common/event.test.ts
index 8f14d7d47cd..30320370f2a 100644
--- a/src/vs/base/test/common/event.test.ts
+++ b/src/vs/base/test/common/event.test.ts
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { stub } from 'sinon';
-import { timeout } from 'vs/base/common/async';
+import { DeferredPromise, timeout } from 'vs/base/common/async';
import { CancellationToken } from 'vs/base/common/cancellation';
import { errorHandler, setUnexpectedErrorHandler } from 'vs/base/common/errors';
import { AsyncEmitter, DebounceEmitter, DynamicListEventMultiplexer, Emitter, Event, EventBufferer, EventMultiplexer, IWaitUntil, MicrotaskEmitter, PauseableEmitter, Relay, createEventDeliveryQueue } from 'vs/base/common/event';
@@ -1158,6 +1158,48 @@ suite('Event utils', () => {
listener.dispose(); // should not crash
});
+ suite('fromPromise', () => {
+
+ test('not yet resolved', async function () {
+ return new Promise(resolve => {
+ let promise = new DeferredPromise();
+
+ Event.fromPromise(promise.p)(e => {
+ assert.strictEqual(e, 1);
+
+ promise = new DeferredPromise();
+
+ Event.fromPromise(promise.p)(() => {
+ resolve();
+ });
+
+ promise.error(undefined);
+ });
+
+ promise.complete(1);
+ });
+ });
+
+ test('already resolved', async function () {
+ return new Promise(resolve => {
+ let promise = new DeferredPromise();
+ promise.complete(1);
+
+ Event.fromPromise(promise.p)(e => {
+ assert.strictEqual(e, 1);
+
+ promise = new DeferredPromise();
+ promise.error(undefined);
+
+ Event.fromPromise(promise.p)(() => {
+ resolve();
+ });
+ });
+
+ });
+ });
+ });
+
suite('Relay', () => {
test('should input work', () => {
const e1 = new Emitter();
diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts
index 3ceea02d892..962e2f4c314 100644
--- a/src/vs/code/browser/workbench/workbench.ts
+++ b/src/vs/code/browser/workbench/workbench.ts
@@ -4,31 +4,197 @@
*--------------------------------------------------------------------------------------------*/
import { isStandalone } from 'vs/base/browser/browser';
-import { parse } from 'vs/base/common/marshalling';
+import { VSBuffer, decodeBase64, encodeBase64 } from 'vs/base/common/buffer';
import { Emitter } from 'vs/base/common/event';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
+import { parse } from 'vs/base/common/marshalling';
import { Schemas } from 'vs/base/common/network';
+import { posix } from 'vs/base/common/path';
import { isEqual } from 'vs/base/common/resources';
+import { ltrim } from 'vs/base/common/strings';
import { URI, UriComponents } from 'vs/base/common/uri';
import product from 'vs/platform/product/common/product';
-import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/window/common/window';
-import { create } from 'vs/workbench/workbench.web.main';
-import { posix } from 'vs/base/common/path';
-import { ltrim } from 'vs/base/common/strings';
-import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
-import type { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api';
-import type { IWorkspace, IWorkspaceProvider } from 'vs/workbench/services/host/browser/browserHostService';
import { ISecretStorageProvider } from 'vs/platform/secrets/common/secrets';
+import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/window/common/window';
+import type { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api';
import { AuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
+import type { IWorkspace, IWorkspaceProvider } from 'vs/workbench/services/host/browser/browserHostService';
+import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
+import { create } from 'vs/workbench/workbench.web.main';
-class LocalStorageSecretStorageProvider implements ISecretStorageProvider {
- private static readonly STORAGE_KEY = 'secrets.provider';
+interface ISecretStorageCrypto {
+ seal(data: string): Promise;
+ unseal(data: string): Promise;
+}
- private _secrets: Record | undefined;
+class TransparentCrypto implements ISecretStorageCrypto {
+ async seal(data: string): Promise {
+ return data;
+ }
+
+ async unseal(data: string): Promise {
+ return data;
+ }
+}
+
+const enum AESConstants {
+ ALGORITHM = 'AES-GCM',
+ KEY_LENGTH = 256,
+ IV_LENGTH = 12,
+}
+
+class ServerKeyedAESCrypto implements ISecretStorageCrypto {
+ private _serverKey: Uint8Array | undefined;
+
+ /** Gets whether the algorithm is supported; requires a secure context */
+ public static supported() {
+ return !!crypto.subtle;
+ }
+
+ constructor(private readonly authEndpoint: string) { }
+
+ async seal(data: string): Promise {
+ // Get a new key and IV on every change, to avoid the risk of reusing the same key and IV pair with AES-GCM
+ // (see also: https://developer.mozilla.org/en-US/docs/Web/API/AesGcmParams#properties)
+ const iv = window.crypto.getRandomValues(new Uint8Array(AESConstants.IV_LENGTH));
+ // crypto.getRandomValues isn't a good-enough PRNG to generate crypto keys, so we need to use crypto.subtle.generateKey and export the key instead
+ const clientKeyObj = await window.crypto.subtle.generateKey(
+ { name: AESConstants.ALGORITHM as const, length: AESConstants.KEY_LENGTH as const },
+ true,
+ ['encrypt', 'decrypt']
+ );
+
+ const clientKey = new Uint8Array(await window.crypto.subtle.exportKey('raw', clientKeyObj));
+ const key = await this.getKey(clientKey);
+ const dataUint8Array = new TextEncoder().encode(data);
+ const cipherText: ArrayBuffer = await window.crypto.subtle.encrypt(
+ { name: AESConstants.ALGORITHM as const, iv },
+ key,
+ dataUint8Array
+ );
+
+ // Base64 encode the result and store the ciphertext, the key, and the IV in localStorage
+ // Note that the clientKey and IV don't need to be secret
+ const result = new Uint8Array([...clientKey, ...iv, ...new Uint8Array(cipherText)]);
+ return encodeBase64(VSBuffer.wrap(result));
+ }
+
+ async unseal(data: string): Promise {
+ // encrypted should contain, in order: the key (32-byte), the IV for AES-GCM (12-byte) and the ciphertext (which has the GCM auth tag at the end)
+ // Minimum length must be 44 (key+IV length) + 16 bytes (1 block encrypted with AES - regardless of key size)
+ const dataUint8Array = decodeBase64(data);
+
+ if (dataUint8Array.byteLength < 60) {
+ throw Error('Invalid length for the value for credentials.crypto');
+ }
+
+ const keyLength = AESConstants.KEY_LENGTH / 8;
+ const clientKey = dataUint8Array.slice(0, keyLength);
+ const iv = dataUint8Array.slice(keyLength, keyLength + AESConstants.IV_LENGTH);
+ const cipherText = dataUint8Array.slice(keyLength + AESConstants.IV_LENGTH);
+
+ // Do the decryption and parse the result as JSON
+ const key = await this.getKey(clientKey.buffer);
+ const decrypted = await window.crypto.subtle.decrypt(
+ { name: AESConstants.ALGORITHM as const, iv: iv.buffer },
+ key,
+ cipherText.buffer
+ );
+
+ return new TextDecoder().decode(new Uint8Array(decrypted));
+ }
+
+ /**
+ * Given a clientKey, returns the CryptoKey object that is used to encrypt/decrypt the data.
+ * The actual key is (clientKey XOR serverKey)
+ */
+ private async getKey(clientKey: Uint8Array): Promise {
+ if (!clientKey || clientKey.byteLength !== AESConstants.KEY_LENGTH / 8) {
+ throw Error('Invalid length for clientKey');
+ }
+
+ const serverKey = await this.getServerKeyPart();
+ const keyData = new Uint8Array(AESConstants.KEY_LENGTH / 8);
+
+ for (let i = 0; i < keyData.byteLength; i++) {
+ keyData[i] = clientKey[i]! ^ serverKey[i]!;
+ }
+
+ return window.crypto.subtle.importKey(
+ 'raw',
+ keyData,
+ {
+ name: AESConstants.ALGORITHM as const,
+ length: AESConstants.KEY_LENGTH as const,
+ },
+ true,
+ ['encrypt', 'decrypt']
+ );
+ }
+
+ private async getServerKeyPart(): Promise {
+ if (this._serverKey) {
+ return this._serverKey;
+ }
+
+ let attempt = 0;
+ let lastError: unknown | undefined;
+
+ while (attempt <= 3) {
+ try {
+ const res = await fetch(this.authEndpoint, { credentials: 'include', method: 'POST' });
+ if (!res.ok) {
+ throw new Error(res.statusText);
+ }
+ const serverKey = new Uint8Array(await await res.arrayBuffer());
+ if (serverKey.byteLength !== AESConstants.KEY_LENGTH / 8) {
+ throw Error(`The key retrieved by the server is not ${AESConstants.KEY_LENGTH} bit long.`);
+ }
+ this._serverKey = serverKey;
+ return this._serverKey;
+ } catch (e) {
+ lastError = e;
+ attempt++;
+
+ // exponential backoff
+ await new Promise(resolve => setTimeout(resolve, attempt * attempt * 100));
+ }
+ }
+
+ throw lastError;
+ }
+}
+
+export class LocalStorageSecretStorageProvider implements ISecretStorageProvider {
+ private readonly _storageKey = 'secrets.provider';
+
+ private _secretsPromise: Promise> = this.load();
type: 'in-memory' | 'persisted' | 'unknown' = 'persisted';
- constructor() {
+ constructor(
+ private readonly crypto: ISecretStorageCrypto,
+ ) { }
+
+ private async load(): Promise> {
+ const record = this.loadAuthSessionFromElement();
+ // Get the secrets from localStorage
+ const encrypted = window.localStorage.getItem(this._storageKey);
+ if (encrypted) {
+ try {
+ const decrypted = JSON.parse(await this.crypto.unseal(encrypted));
+ return { ...record, ...decrypted };
+ } catch (err) {
+ // TODO: send telemetry
+ console.error('Failed to decrypt secrets from localStorage', err);
+ window.localStorage.removeItem(this._storageKey);
+ }
+ }
+
+ return record;
+ }
+
+ private loadAuthSessionFromElement(): Record {
let authSessionInfo: (AuthenticationSessionInfo & { scopes: string[][] }) | undefined;
const authSessionElement = document.getElementById('vscode-workbench-auth-session');
const authSessionElementAttribute = authSessionElement ? authSessionElement.getAttribute('data-settings') : undefined;
@@ -38,65 +204,59 @@ class LocalStorageSecretStorageProvider implements ISecretStorageProvider {
} catch (error) { /* Invalid session is passed. Ignore. */ }
}
- if (authSessionInfo) {
- // Settings Sync Entry
- this.set(`${product.urlProtocol}.loginAccount`, JSON.stringify(authSessionInfo));
-
- // Auth extension Entry
- if (authSessionInfo.providerId !== 'github') {
- console.error(`Unexpected auth provider: ${authSessionInfo.providerId}. Expected 'github'.`);
- return;
- }
- const authAccount = JSON.stringify({ extensionId: 'vscode.github-authentication', key: 'github.auth' });
- this.set(authAccount, JSON.stringify(authSessionInfo.scopes.map(scopes => ({
- id: authSessionInfo!.id,
- scopes,
- accessToken: authSessionInfo!.accessToken
- }))));
+ if (!authSessionInfo) {
+ return {};
}
+
+ const record: Record = {};
+
+ // Settings Sync Entry
+ record[`${product.urlProtocol}.loginAccount`] = JSON.stringify(authSessionInfo);
+
+ // Auth extension Entry
+ if (authSessionInfo.providerId !== 'github') {
+ console.error(`Unexpected auth provider: ${authSessionInfo.providerId}. Expected 'github'.`);
+ return record;
+ }
+
+ const authAccount = JSON.stringify({ extensionId: 'vscode.github-authentication', key: 'github.auth' });
+ record[authAccount] = JSON.stringify(authSessionInfo.scopes.map(scopes => ({
+ id: authSessionInfo!.id,
+ scopes,
+ accessToken: authSessionInfo!.accessToken
+ })));
+
+ return record;
}
- get(key: string): Promise {
- return Promise.resolve(this.secrets[key]);
+ async get(key: string): Promise {
+ const secrets = await this._secretsPromise;
+ return secrets[key];
}
- set(key: string, value: string): Promise {
- this.secrets[key] = value;
+ async set(key: string, value: string): Promise {
+ const secrets = await this._secretsPromise;
+ secrets[key] = value;
+ this._secretsPromise = Promise.resolve(secrets);
this.save();
-
- return Promise.resolve();
}
async delete(key: string): Promise {
- delete this.secrets[key];
-
+ const secrets = await this._secretsPromise;
+ delete secrets[key];
+ this._secretsPromise = Promise.resolve(secrets);
this.save();
-
- return Promise.resolve();
}
- private get secrets(): Record {
- if (!this._secrets) {
- try {
- const serializedCredentials = window.localStorage.getItem(LocalStorageSecretStorageProvider.STORAGE_KEY);
- if (serializedCredentials) {
- this._secrets = JSON.parse(serializedCredentials);
- }
- } catch (error) {
- // ignore
- }
-
- if (!(this._secrets instanceof Object)) {
- this._secrets = {};
- }
+ private async save(): Promise {
+ try {
+ const encrypted = await this.crypto.seal(JSON.stringify(await this._secretsPromise));
+ window.localStorage.setItem(this._storageKey, encrypted);
+ } catch (err) {
+ console.error(err);
}
-
- return this._secrets;
- }
-
- private save(): void {
- window.localStorage.setItem(LocalStorageSecretStorageProvider.STORAGE_KEY, JSON.stringify(this.secrets));
}
}
+
class LocalStorageURLCallbackProvider extends Disposable implements IURLCallbackProvider {
private static REQUEST_ID = 0;
@@ -390,6 +550,17 @@ class WorkspaceProvider implements IWorkspaceProvider {
}
}
+function readCookie(name: string): string | undefined {
+ const cookies = document.cookie.split('; ');
+ for (const cookie of cookies) {
+ if (cookie.startsWith(name + '=')) {
+ return cookie.substring(name.length + 1);
+ }
+ }
+
+ return undefined;
+}
+
(function () {
// Find config by checking for DOM
@@ -399,6 +570,9 @@ class WorkspaceProvider implements IWorkspaceProvider {
throw new Error('Missing web configuration element');
}
const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
+ const secretStorageKeyPath = readCookie('vscode-secret-key-path');
+ const secretStorageCrypto = secretStorageKeyPath && ServerKeyedAESCrypto.supported()
+ ? new ServerKeyedAESCrypto(secretStorageKeyPath) : new TransparentCrypto();
// Create workbench
create(document.body, {
@@ -407,6 +581,8 @@ class WorkspaceProvider implements IWorkspaceProvider {
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
workspaceProvider: WorkspaceProvider.create(config),
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
- secretStorageProvider: config.remoteAuthority ? undefined /* with a remote, we don't use a local secret storage provider */ : new LocalStorageSecretStorageProvider()
+ secretStorageProvider: config.remoteAuthority && !secretStorageKeyPath
+ ? undefined /* with a remote without embedder-preferred storage, store on the remote */
+ : new LocalStorageSecretStorageProvider(secretStorageCrypto),
});
})();
diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts
index c6536298e05..49f3c2703cd 100644
--- a/src/vs/code/electron-main/app.ts
+++ b/src/vs/code/electron-main/app.ts
@@ -774,7 +774,17 @@ export class CodeApplication extends Disposable {
if (secondSlash !== -1) {
const authority = uri.path.substring(1, secondSlash);
const path = uri.path.substring(secondSlash);
- const remoteUri = URI.from({ scheme: Schemas.vscodeRemote, authority, path, query: uri.query, fragment: uri.fragment });
+
+ let query = uri.query;
+ const params = new URLSearchParams(uri.query);
+ if (params.get('windowId') === '_blank') {
+ // Make sure to unset any `windowId=_blank` here
+ // https://github.com/microsoft/vscode/issues/191902
+ params.delete('windowId');
+ query = params.toString();
+ }
+
+ const remoteUri = URI.from({ scheme: Schemas.vscodeRemote, authority, path, query, fragment: uri.fragment });
if (hasWorkspaceFileExtension(path)) {
return { workspaceUri: remoteUri };
diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts
index 0174a24c3c8..7bdb1e1a459 100644
--- a/src/vs/code/electron-main/main.ts
+++ b/src/vs/code/electron-main/main.ts
@@ -251,10 +251,10 @@ class CodeMain {
Promise.all([
environmentMainService.extensionsPath,
environmentMainService.codeCachePath,
- environmentMainService.logsHome.fsPath,
- userDataProfilesMainService.defaultProfile.globalStorageHome.fsPath,
- environmentMainService.workspaceStorageHome.fsPath,
- environmentMainService.localHistoryHome.fsPath,
+ environmentMainService.logsHome.with({ scheme: Schemas.file }).fsPath,
+ userDataProfilesMainService.defaultProfile.globalStorageHome.with({ scheme: Schemas.file }).fsPath,
+ environmentMainService.workspaceStorageHome.with({ scheme: Schemas.file }).fsPath,
+ environmentMainService.localHistoryHome.with({ scheme: Schemas.file }).fsPath,
environmentMainService.backupHome
].map(path => path ? FSPromises.mkdir(path, { recursive: true }) : undefined)),
diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts
index a003267c043..b97aa7a0be8 100644
--- a/src/vs/code/node/cliProcessMain.ts
+++ b/src/vs/code/node/cliProcessMain.ts
@@ -121,7 +121,7 @@ class CliMain extends Disposable {
// Init folders
await Promise.all([
- environmentService.appSettingsHome.fsPath,
+ environmentService.appSettingsHome.with({ scheme: Schemas.file }).fsPath,
environmentService.extensionsPath
].map(path => path ? Promises.mkdir(path, { recursive: true }) : undefined));
diff --git a/src/vs/code/node/sharedProcess/contrib/logsDataCleaner.ts b/src/vs/code/node/sharedProcess/contrib/logsDataCleaner.ts
index ab5f8a1d87a..60a3652edf0 100644
--- a/src/vs/code/node/sharedProcess/contrib/logsDataCleaner.ts
+++ b/src/vs/code/node/sharedProcess/contrib/logsDataCleaner.ts
@@ -6,7 +6,9 @@
import { RunOnceScheduler } from 'vs/base/common/async';
import { onUnexpectedError } from 'vs/base/common/errors';
import { Disposable } from 'vs/base/common/lifecycle';
-import { basename, dirname, joinPath } from 'vs/base/common/resources';
+import { Schemas } from 'vs/base/common/network';
+import { join } from 'vs/base/common/path';
+import { basename, dirname } from 'vs/base/common/resources';
import { Promises } from 'vs/base/node/pfs';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { ILogService } from 'vs/platform/log/common/log';
@@ -30,9 +32,8 @@ export class LogsDataCleaner extends Disposable {
try {
const currentLog = basename(this.environmentService.logsHome);
- const logsRoot = dirname(this.environmentService.logsHome);
-
- const logFiles = await Promises.readdir(logsRoot.fsPath);
+ const logsRoot = dirname(this.environmentService.logsHome.with({ scheme: Schemas.file })).fsPath;
+ const logFiles = await Promises.readdir(logsRoot);
const allSessions = logFiles.filter(logFile => /^\d{8}T\d{6}$/.test(logFile));
const oldSessions = allSessions.sort().filter(session => session !== currentLog);
@@ -41,7 +42,7 @@ export class LogsDataCleaner extends Disposable {
if (sessionsToDelete.length > 0) {
this.logService.trace(`[logs cleanup]: Removing log folders '${sessionsToDelete.join(', ')}'`);
- await Promise.all(sessionsToDelete.map(sessionToDelete => Promises.rm(joinPath(logsRoot, sessionToDelete).fsPath)));
+ await Promise.all(sessionsToDelete.map(sessionToDelete => Promises.rm(join(logsRoot, sessionToDelete))));
}
} catch (error) {
onUnexpectedError(error);
diff --git a/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts b/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts
index fc3f2eb117a..da67be66109 100644
--- a/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts
+++ b/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts
@@ -15,6 +15,7 @@ import { EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE } from 'vs/platform/worksp
import { NON_EMPTY_WORKSPACE_ID_LENGTH } from 'vs/platform/workspaces/node/workspaces';
import { INativeHostService } from 'vs/platform/native/common/native';
import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService';
+import { Schemas } from 'vs/base/common/network';
export class UnusedWorkspaceStorageDataCleaner extends Disposable {
@@ -36,11 +37,12 @@ export class UnusedWorkspaceStorageDataCleaner extends Disposable {
this.logService.trace('[storage cleanup]: Starting to clean up workspace storage folders for unused empty workspaces.');
try {
- const workspaceStorageFolders = await Promises.readdir(this.environmentService.workspaceStorageHome.fsPath);
+ const workspaceStorageHome = this.environmentService.workspaceStorageHome.with({ scheme: Schemas.file }).fsPath;
+ const workspaceStorageFolders = await Promises.readdir(workspaceStorageHome);
const storageClient = new StorageClient(this.mainProcessService.getChannel('storage'));
await Promise.all(workspaceStorageFolders.map(async workspaceStorageFolder => {
- const workspaceStoragePath = join(this.environmentService.workspaceStorageHome.fsPath, workspaceStorageFolder);
+ const workspaceStoragePath = join(workspaceStorageHome, workspaceStorageFolder);
if (workspaceStorageFolder.length === NON_EMPTY_WORKSPACE_ID_LENGTH) {
return; // keep workspace storage for folders/workspaces that can be accessed still
diff --git a/src/vs/editor/browser/config/elementSizeObserver.ts b/src/vs/editor/browser/config/elementSizeObserver.ts
index 3529822e209..f6b344f1872 100644
--- a/src/vs/editor/browser/config/elementSizeObserver.ts
+++ b/src/vs/editor/browser/config/elementSizeObserver.ts
@@ -41,12 +41,42 @@ export class ElementSizeObserver extends Disposable {
public startObserving(): void {
if (!this._resizeObserver && this._referenceDomElement) {
- this._resizeObserver = new ResizeObserver((entries) => {
- if (entries && entries[0] && entries[0].contentRect) {
- this.observe({ width: entries[0].contentRect.width, height: entries[0].contentRect.height });
+ // We want to react to the resize observer only once per animation frame
+ // The first time the resize observer fires, we will react to it immediately.
+ // Otherwise we will postpone to the next animation frame.
+ // We'll use `observeContentRect` to store the content rect we received.
+
+ let observeContentRect: DOMRectReadOnly | null = null;
+ const observeNow = () => {
+ if (observeContentRect) {
+ this.observe({ width: observeContentRect.width, height: observeContentRect.height });
} else {
this.observe();
}
+ };
+
+ let shouldObserve = false;
+ let alreadyObservedThisAnimationFrame = false;
+
+ const update = () => {
+ if (shouldObserve && !alreadyObservedThisAnimationFrame) {
+ try {
+ shouldObserve = false;
+ alreadyObservedThisAnimationFrame = true;
+ observeNow();
+ } finally {
+ requestAnimationFrame(() => {
+ alreadyObservedThisAnimationFrame = false;
+ update();
+ });
+ }
+ }
+ };
+
+ this._resizeObserver = new ResizeObserver((entries) => {
+ observeContentRect = (entries && entries[0] && entries[0].contentRect ? entries[0].contentRect : null);
+ shouldObserve = true;
+ update();
});
this._resizeObserver.observe(this._referenceDomElement);
}
diff --git a/src/vs/editor/browser/services/editorWorkerService.ts b/src/vs/editor/browser/services/editorWorkerService.ts
index 993fe8e813c..5b411eeec3c 100644
--- a/src/vs/editor/browser/services/editorWorkerService.ts
+++ b/src/vs/editor/browser/services/editorWorkerService.ts
@@ -26,7 +26,8 @@ import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost';
import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';
import { IChange } from 'vs/editor/common/diff/legacyLinesDiffComputer';
import { IDocumentDiff, IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider';
-import { ILinesDiffComputerOptions, LineRangeMapping, MovedText, RangeMapping, SimpleLineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { ILinesDiffComputerOptions, MovedText } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping, RangeMapping, LineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { LineRange } from 'vs/editor/common/core/lineRange';
/**
@@ -107,15 +108,15 @@ export class EditorWorkerService extends Disposable implements IEditorWorkerServ
quitEarly: result.quitEarly,
changes: toLineRangeMappings(result.changes),
moves: result.moves.map(m => new MovedText(
- new SimpleLineRangeMapping(new LineRange(m[0], m[1]), new LineRange(m[2], m[3])),
+ new LineRangeMapping(new LineRange(m[0], m[1]), new LineRange(m[2], m[3])),
toLineRangeMappings(m[4])
))
};
return diff;
- function toLineRangeMappings(changes: readonly ILineChange[]): readonly LineRangeMapping[] {
+ function toLineRangeMappings(changes: readonly ILineChange[]): readonly DetailedLineRangeMapping[] {
return changes.map(
- (c) => new LineRangeMapping(
+ (c) => new DetailedLineRangeMapping(
new LineRange(c[0], c[1]),
new LineRange(c[2], c[3]),
c[4]?.map(
diff --git a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts
index 86db61f97e1..31e38a56c4d 100644
--- a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts
+++ b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts
@@ -17,6 +17,7 @@ import { EditorTheme } from 'vs/editor/common/editorTheme';
import * as viewEvents from 'vs/editor/common/viewEvents';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
import { OverviewRulerDecorationsGroup } from 'vs/editor/common/viewModel';
+import { equals } from 'vs/base/common/arrays';
class Settings {
@@ -212,13 +213,24 @@ const enum OverviewRulerLane {
Full = 7
}
+const enum ShouldRenderValue {
+ NotNeeded = 0,
+ Maybe = 1,
+ Needed = 2
+}
+
export class DecorationsOverviewRuler extends ViewPart {
+ private _actualShouldRender: ShouldRenderValue = ShouldRenderValue.NotNeeded;
+
private readonly _tokensColorTrackerListener: IDisposable;
private readonly _domNode: FastDomNode;
private _settings!: Settings;
private _cursorPositions: Position[];
+ private _renderedDecorations: OverviewRulerDecorationsGroup[] = [];
+ private _renderedCursorPositions: Position[] = [];
+
constructor(context: ViewContext) {
super(context);
@@ -270,8 +282,18 @@ export class DecorationsOverviewRuler extends ViewPart {
// ---- begin view event handlers
+ private _markRenderingIsNeeded(): true {
+ this._actualShouldRender = ShouldRenderValue.Needed;
+ return true;
+ }
+
+ private _markRenderingIsMaybeNeeded(): true {
+ this._actualShouldRender = ShouldRenderValue.Maybe;
+ return true;
+ }
+
public override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
- return this._updateSettings(false);
+ return this._updateSettings(false) ? this._markRenderingIsNeeded() : false;
}
public override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {
this._cursorPositions = [];
@@ -279,25 +301,25 @@ export class DecorationsOverviewRuler extends ViewPart {
this._cursorPositions[i] = e.selections[i].getPosition();
}
this._cursorPositions.sort(Position.compare);
- return true;
+ return this._markRenderingIsMaybeNeeded();
}
public override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {
if (e.affectsOverviewRuler) {
- return true;
+ return this._markRenderingIsMaybeNeeded();
}
return false;
}
public override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {
- return true;
+ return this._markRenderingIsNeeded();
}
public override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {
- return e.scrollHeightChanged;
+ return e.scrollHeightChanged ? this._markRenderingIsNeeded() : false;
}
public override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {
- return true;
+ return this._markRenderingIsNeeded();
}
public override onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {
- return this._updateSettings(false);
+ return this._updateSettings(false) ? this._markRenderingIsNeeded() : false;
}
// ---- end view event handlers
@@ -312,6 +334,7 @@ export class DecorationsOverviewRuler extends ViewPart {
public render(editorCtx: RestrictedRenderingContext): void {
this._render();
+ this._actualShouldRender = ShouldRenderValue.NotNeeded;
}
private _render(): void {
@@ -322,6 +345,23 @@ export class DecorationsOverviewRuler extends ViewPart {
this._domNode.setDisplay('none');
return;
}
+
+ const decorations = this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);
+ decorations.sort(OverviewRulerDecorationsGroup.cmp);
+
+ if (this._actualShouldRender === ShouldRenderValue.Maybe && !OverviewRulerDecorationsGroup.equalsArr(this._renderedDecorations, decorations)) {
+ this._actualShouldRender = ShouldRenderValue.Needed;
+ }
+ if (this._actualShouldRender === ShouldRenderValue.Maybe && !equals(this._renderedCursorPositions, this._cursorPositions, (a, b) => a.lineNumber === b.lineNumber)) {
+ this._actualShouldRender = ShouldRenderValue.Needed;
+ }
+ if (this._actualShouldRender === ShouldRenderValue.Maybe) {
+ // both decorations and cursor positions are unchanged, nothing to do
+ return;
+ }
+ this._renderedDecorations = decorations;
+ this._renderedCursorPositions = this._cursorPositions;
+
this._domNode.setDisplay('block');
const canvasWidth = this._settings.canvasWidth;
const canvasHeight = this._settings.canvasHeight;
@@ -329,7 +369,6 @@ export class DecorationsOverviewRuler extends ViewPart {
const viewLayout = this._context.viewLayout;
const outerHeight = this._context.viewLayout.getScrollHeight();
const heightRatio = canvasHeight / outerHeight;
- const decorations = this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);
const minDecorationHeight = (Constants.MIN_DECORATION_HEIGHT * this._settings.pixelRatio) | 0;
const halfMinDecorationHeight = (minDecorationHeight / 2) | 0;
@@ -355,7 +394,7 @@ export class DecorationsOverviewRuler extends ViewPart {
const x = this._settings.x;
const w = this._settings.w;
- decorations.sort(OverviewRulerDecorationsGroup.cmp);
+
for (const decorationGroup of decorations) {
const color = decorationGroup.color;
diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts
index 5588ae6f5ec..47dba6865b7 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget.ts
@@ -297,7 +297,14 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
diffAlgorithm: 'advanced',
accessibilityVerbose: false,
experimental: {
- collapseUnchangedRegions: false,
+ showEmptyDecorations: false,
+ showMoves: false,
+ },
+ hideUnchangedRegions: {
+ enabled: false,
+ contextLineCount: 0,
+ minimumLineCount: 0,
+ revealLineCount: 0,
},
isInEmbeddedEditor: false,
onlyShowAccessibleDiffViewer: false,
@@ -1205,24 +1212,24 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
let modifiedEndLineNumber: number;
let innerChanges = m.innerChanges;
- if (m.originalRange.isEmpty) {
+ if (m.original.isEmpty) {
// Insertion
- originalStartLineNumber = m.originalRange.startLineNumber - 1;
+ originalStartLineNumber = m.original.startLineNumber - 1;
originalEndLineNumber = 0;
innerChanges = undefined;
} else {
- originalStartLineNumber = m.originalRange.startLineNumber;
- originalEndLineNumber = m.originalRange.endLineNumberExclusive - 1;
+ originalStartLineNumber = m.original.startLineNumber;
+ originalEndLineNumber = m.original.endLineNumberExclusive - 1;
}
- if (m.modifiedRange.isEmpty) {
+ if (m.modified.isEmpty) {
// Deletion
- modifiedStartLineNumber = m.modifiedRange.startLineNumber - 1;
+ modifiedStartLineNumber = m.modified.startLineNumber - 1;
modifiedEndLineNumber = 0;
innerChanges = undefined;
} else {
- modifiedStartLineNumber = m.modifiedRange.startLineNumber;
- modifiedEndLineNumber = m.modifiedRange.endLineNumberExclusive - 1;
+ modifiedStartLineNumber = m.modified.startLineNumber;
+ modifiedEndLineNumber = m.modified.endLineNumberExclusive - 1;
}
return {
@@ -2743,8 +2750,15 @@ function validateDiffEditorOptions(options: Readonly, defaul
diffWordWrap: validateDiffWordWrap(options.diffWordWrap, defaults.diffWordWrap),
diffAlgorithm: validateStringSetOption(options.diffAlgorithm, defaults.diffAlgorithm, ['legacy', 'advanced'], { 'smart': 'legacy', 'experimental': 'advanced' }),
accessibilityVerbose: validateBooleanOption(options.accessibilityVerbose, defaults.accessibilityVerbose),
+ hideUnchangedRegions: {
+ enabled: false,
+ contextLineCount: 0,
+ minimumLineCount: 0,
+ revealLineCount: 0,
+ },
experimental: {
- collapseUnchangedRegions: false,
+ showEmptyDecorations: false,
+ showMoves: false,
},
isInEmbeddedEditor: validateBooleanOption(options.isInEmbeddedEditor, defaults.isInEmbeddedEditor),
onlyShowAccessibleDiffViewer: false,
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/accessibleDiffViewer.ts b/src/vs/editor/browser/widget/diffEditorWidget2/accessibleDiffViewer.ts
index 32f45d85186..ce188250447 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/accessibleDiffViewer.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/accessibleDiffViewer.ts
@@ -21,7 +21,7 @@ import { LineRange } from 'vs/editor/common/core/lineRange';
import { OffsetRange } from 'vs/editor/common/core/offsetRange';
import { Position } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
-import { LineRangeMapping, SimpleLineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping, LineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { ILanguageIdCodec } from 'vs/editor/common/languages';
import { ILanguageService } from 'vs/editor/common/languages/language';
import { ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model';
@@ -45,7 +45,7 @@ export class AccessibleDiffViewer extends Disposable {
private readonly _canClose: IObservable,
private readonly _width: IObservable,
private readonly _height: IObservable,
- private readonly _diffs: IObservable,
+ private readonly _diffs: IObservable,
private readonly _editors: DiffEditorEditors,
@IInstantiationService private readonly _instantiationService: IInstantiationService,
) {
@@ -105,7 +105,7 @@ class ViewModel extends Disposable {
= this._currentElementIdx.map((idx, r) => this.currentGroup.read(r)?.lines[idx]);
constructor(
- private readonly _diffs: IObservable,
+ private readonly _diffs: IObservable,
private readonly _editors: DiffEditorEditors,
private readonly _setVisible: (visible: boolean, tx: ITransaction | undefined) => void,
public readonly canClose: IObservable,
@@ -154,7 +154,7 @@ class ViewModel extends Disposable {
// This ensures editor commands (like revert/stage) work
const currentViewItem = this.currentElement.read(reader);
if (currentViewItem && currentViewItem.type !== LineType.Header) {
- const lineNumber = currentViewItem.modifiedLineNumber ?? currentViewItem.diff.modifiedRange.startLineNumber;
+ const lineNumber = currentViewItem.modifiedLineNumber ?? currentViewItem.diff.modified.startLineNumber;
this._editors.modified.setSelection(Range.fromPositions(new Position(lineNumber, 1)));
}
}));
@@ -221,44 +221,44 @@ class ViewModel extends Disposable {
const viewElementGroupLineMargin = 3;
-function computeViewElementGroups(diffs: LineRangeMapping[], originalLineCount: number, modifiedLineCount: number): ViewElementGroup[] {
+function computeViewElementGroups(diffs: DetailedLineRangeMapping[], originalLineCount: number, modifiedLineCount: number): ViewElementGroup[] {
const result: ViewElementGroup[] = [];
- for (const g of group(diffs, (a, b) => (b.modifiedRange.startLineNumber - a.modifiedRange.endLineNumberExclusive < 2 * viewElementGroupLineMargin))) {
+ for (const g of group(diffs, (a, b) => (b.modified.startLineNumber - a.modified.endLineNumberExclusive < 2 * viewElementGroupLineMargin))) {
const viewElements: ViewElement[] = [];
viewElements.push(new HeaderViewElement());
const origFullRange = new LineRange(
- Math.max(1, g[0].originalRange.startLineNumber - viewElementGroupLineMargin),
- Math.min(g[g.length - 1].originalRange.endLineNumberExclusive + viewElementGroupLineMargin, originalLineCount + 1)
+ Math.max(1, g[0].original.startLineNumber - viewElementGroupLineMargin),
+ Math.min(g[g.length - 1].original.endLineNumberExclusive + viewElementGroupLineMargin, originalLineCount + 1)
);
const modifiedFullRange = new LineRange(
- Math.max(1, g[0].modifiedRange.startLineNumber - viewElementGroupLineMargin),
- Math.min(g[g.length - 1].modifiedRange.endLineNumberExclusive + viewElementGroupLineMargin, modifiedLineCount + 1)
+ Math.max(1, g[0].modified.startLineNumber - viewElementGroupLineMargin),
+ Math.min(g[g.length - 1].modified.endLineNumberExclusive + viewElementGroupLineMargin, modifiedLineCount + 1)
);
forEachAdjacentItems(g, (a, b) => {
- const origRange = new LineRange(a ? a.originalRange.endLineNumberExclusive : origFullRange.startLineNumber, b ? b.originalRange.startLineNumber : origFullRange.endLineNumberExclusive);
- const modifiedRange = new LineRange(a ? a.modifiedRange.endLineNumberExclusive : modifiedFullRange.startLineNumber, b ? b.modifiedRange.startLineNumber : modifiedFullRange.endLineNumberExclusive);
+ const origRange = new LineRange(a ? a.original.endLineNumberExclusive : origFullRange.startLineNumber, b ? b.original.startLineNumber : origFullRange.endLineNumberExclusive);
+ const modifiedRange = new LineRange(a ? a.modified.endLineNumberExclusive : modifiedFullRange.startLineNumber, b ? b.modified.startLineNumber : modifiedFullRange.endLineNumberExclusive);
origRange.forEach(origLineNumber => {
viewElements.push(new UnchangedLineViewElement(origLineNumber, modifiedRange.startLineNumber + (origLineNumber - origRange.startLineNumber)));
});
if (b) {
- b.originalRange.forEach(origLineNumber => {
+ b.original.forEach(origLineNumber => {
viewElements.push(new DeletedLineViewElement(b, origLineNumber));
});
- b.modifiedRange.forEach(modifiedLineNumber => {
+ b.modified.forEach(modifiedLineNumber => {
viewElements.push(new AddedLineViewElement(b, modifiedLineNumber));
});
}
});
- const modifiedRange = g[0].modifiedRange.join(g[g.length - 1].modifiedRange);
- const originalRange = g[0].originalRange.join(g[g.length - 1].originalRange);
+ const modifiedRange = g[0].modified.join(g[g.length - 1].modified);
+ const originalRange = g[0].original.join(g[g.length - 1].original);
- result.push(new ViewElementGroup(new SimpleLineRangeMapping(modifiedRange, originalRange), viewElements));
+ result.push(new ViewElementGroup(new LineRangeMapping(modifiedRange, originalRange), viewElements));
}
return result;
}
@@ -272,7 +272,7 @@ enum LineType {
class ViewElementGroup {
constructor(
- public readonly range: SimpleLineRangeMapping,
+ public readonly range: LineRangeMapping,
public readonly lines: readonly ViewElement[],
) { }
}
@@ -289,7 +289,7 @@ class DeletedLineViewElement {
public readonly modifiedLineNumber = undefined;
constructor(
- public readonly diff: LineRangeMapping,
+ public readonly diff: DetailedLineRangeMapping,
public readonly originalLineNumber: number,
) {
}
@@ -301,7 +301,7 @@ class AddedLineViewElement {
public readonly originalLineNumber = undefined;
constructor(
- public readonly diff: LineRangeMapping,
+ public readonly diff: DetailedLineRangeMapping,
public readonly modifiedLineNumber: number,
) {
}
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorDecorations.ts b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorDecorations.ts
index 9a4b5bcf094..504bfe8a12c 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorDecorations.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorDecorations.ts
@@ -42,45 +42,45 @@ export class DiffEditorDecorations extends Disposable {
const modifiedDecorations: IModelDeltaDecoration[] = [];
if (!movedTextToCompare) {
for (const m of diff.mappings) {
- if (!m.lineRangeMapping.originalRange.isEmpty) {
- originalDecorations.push({ range: m.lineRangeMapping.originalRange.toInclusiveRange()!, options: renderIndicators ? diffLineDeleteDecorationBackgroundWithIndicator : diffLineDeleteDecorationBackground });
+ if (!m.lineRangeMapping.original.isEmpty) {
+ originalDecorations.push({ range: m.lineRangeMapping.original.toInclusiveRange()!, options: renderIndicators ? diffLineDeleteDecorationBackgroundWithIndicator : diffLineDeleteDecorationBackground });
}
- if (!m.lineRangeMapping.modifiedRange.isEmpty) {
- modifiedDecorations.push({ range: m.lineRangeMapping.modifiedRange.toInclusiveRange()!, options: renderIndicators ? diffLineAddDecorationBackgroundWithIndicator : diffLineAddDecorationBackground });
+ if (!m.lineRangeMapping.modified.isEmpty) {
+ modifiedDecorations.push({ range: m.lineRangeMapping.modified.toInclusiveRange()!, options: renderIndicators ? diffLineAddDecorationBackgroundWithIndicator : diffLineAddDecorationBackground });
}
- if (m.lineRangeMapping.modifiedRange.isEmpty || m.lineRangeMapping.originalRange.isEmpty) {
- if (!m.lineRangeMapping.originalRange.isEmpty) {
- originalDecorations.push({ range: m.lineRangeMapping.originalRange.toInclusiveRange()!, options: diffWholeLineDeleteDecoration });
+ if (m.lineRangeMapping.modified.isEmpty || m.lineRangeMapping.original.isEmpty) {
+ if (!m.lineRangeMapping.original.isEmpty) {
+ originalDecorations.push({ range: m.lineRangeMapping.original.toInclusiveRange()!, options: diffWholeLineDeleteDecoration });
}
- if (!m.lineRangeMapping.modifiedRange.isEmpty) {
- modifiedDecorations.push({ range: m.lineRangeMapping.modifiedRange.toInclusiveRange()!, options: diffWholeLineAddDecoration });
+ if (!m.lineRangeMapping.modified.isEmpty) {
+ modifiedDecorations.push({ range: m.lineRangeMapping.modified.toInclusiveRange()!, options: diffWholeLineAddDecoration });
}
} else {
for (const i of m.lineRangeMapping.innerChanges || []) {
// Don't show empty markers outside the line range
- if (m.lineRangeMapping.originalRange.contains(i.originalRange.startLineNumber)) {
+ if (m.lineRangeMapping.original.contains(i.originalRange.startLineNumber)) {
originalDecorations.push({ range: i.originalRange, options: (i.originalRange.isEmpty() && showEmptyDecorations) ? diffDeleteDecorationEmpty : diffDeleteDecoration });
}
- if (m.lineRangeMapping.modifiedRange.contains(i.modifiedRange.startLineNumber)) {
+ if (m.lineRangeMapping.modified.contains(i.modifiedRange.startLineNumber)) {
modifiedDecorations.push({ range: i.modifiedRange, options: (i.modifiedRange.isEmpty() && showEmptyDecorations) ? diffAddDecorationEmpty : diffAddDecoration });
}
}
}
- if (!m.lineRangeMapping.modifiedRange.isEmpty && this._options.shouldRenderRevertArrows.read(reader) && !movedTextToCompare) {
- modifiedDecorations.push({ range: Range.fromPositions(new Position(m.lineRangeMapping.modifiedRange.startLineNumber, 1)), options: arrowRevertChange });
+ if (!m.lineRangeMapping.modified.isEmpty && this._options.shouldRenderRevertArrows.read(reader) && !movedTextToCompare) {
+ modifiedDecorations.push({ range: Range.fromPositions(new Position(m.lineRangeMapping.modified.startLineNumber, 1)), options: arrowRevertChange });
}
}
}
if (movedTextToCompare) {
for (const m of movedTextToCompare.changes) {
- const fullRangeOriginal = m.originalRange.toInclusiveRange();
+ const fullRangeOriginal = m.original.toInclusiveRange();
if (fullRangeOriginal) {
originalDecorations.push({ range: fullRangeOriginal, options: renderIndicators ? diffLineDeleteDecorationBackgroundWithIndicator : diffLineDeleteDecorationBackground });
}
- const fullRangeModified = m.modifiedRange.toInclusiveRange();
+ const fullRangeModified = m.modified.toInclusiveRange();
if (fullRangeModified) {
modifiedDecorations.push({ range: fullRangeModified, options: renderIndicators ? diffLineAddDecorationBackgroundWithIndicator : diffLineAddDecorationBackground });
}
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorEditors.ts b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorEditors.ts
index 642359aeae4..254ce84d2be 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorEditors.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorEditors.ts
@@ -147,7 +147,7 @@ export class DiffEditorEditors extends Disposable {
clonedOptions.minimap = { ...(clonedOptions.minimap || {}) };
clonedOptions.minimap.enabled = false;
- if (this._options.collapseUnchangedRegions.get()) {
+ if (this._options.hideUnchangedRegions.get()) {
clonedOptions.stickyScroll = { enabled: false };
} else {
clonedOptions.stickyScroll = this._options.editorOptions.get().stickyScroll;
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorOptions.ts b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorOptions.ts
index 97a4e2adaaf..ffb76330146 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorOptions.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorOptions.ts
@@ -6,6 +6,7 @@
import { IObservable, ISettableObservable, derived, observableValue } from 'vs/base/common/observable';
import { Constants } from 'vs/base/common/uint';
import { IDiffEditorConstructionOptions } from 'vs/editor/browser/editorBrowser';
+import { diffEditorDefaultOptions } from 'vs/editor/common/config/diffEditor';
import { IDiffEditorBaseOptions, IDiffEditorOptions, IEditorOptions, ValidDiffEditorBaseOptions, clampedFloat, clampedInt, boolean as validateBooleanOption, stringSet as validateStringSetOption } from 'vs/editor/common/config/editorOptions';
export class DiffEditorOptions {
@@ -37,7 +38,6 @@ export class DiffEditorOptions {
});
public readonly renderIndicators = derived(reader => /** @description renderIndicators */ this._options.read(reader).renderIndicators);
public readonly enableSplitViewResizing = derived(reader => /** @description enableSplitViewResizing */ this._options.read(reader).enableSplitViewResizing);
- public readonly collapseUnchangedRegions = derived(reader => /** @description hideUnchangedRegions */ this._options.read(reader).experimental.collapseUnchangedRegions!);
public readonly splitViewDefaultRatio = derived(reader => /** @description splitViewDefaultRatio */ this._options.read(reader).splitViewDefaultRatio);
public readonly ignoreTrimWhitespace = derived(reader => /** @description ignoreTrimWhitespace */ this._options.read(reader).ignoreTrimWhitespace);
public readonly maxComputationTimeMs = derived(reader => /** @description maxComputationTime */ this._options.read(reader).maxComputationTime);
@@ -51,6 +51,11 @@ export class DiffEditorOptions {
public readonly showEmptyDecorations = derived(reader => /** @description showEmptyDecorations */ this._options.read(reader).experimental.showEmptyDecorations!);
public readonly onlyShowAccessibleDiffViewer = derived(reader => /** @description onlyShowAccessibleDiffViewer */ this._options.read(reader).onlyShowAccessibleDiffViewer);
+ public readonly hideUnchangedRegions = derived(reader => /** @description hideUnchangedRegions */ this._options.read(reader).hideUnchangedRegions.enabled!);
+ public readonly hideUnchangedRegionsRevealLineCount = derived(reader => /** @description hideUnchangedRegions */ this._options.read(reader).hideUnchangedRegions.revealLineCount!);
+ public readonly hideUnchangedRegionsContextLineCount = derived(reader => /** @description hideUnchangedRegions */ this._options.read(reader).hideUnchangedRegions.contextLineCount!);
+ public readonly hideUnchangedRegionsminimumLineCount = derived(reader => /** @description hideUnchangedRegions */ this._options.read(reader).hideUnchangedRegions.minimumLineCount!);
+
public updateOptions(changedOptions: IDiffEditorOptions): void {
const newDiffEditorOptions = validateDiffEditorOptions(changedOptions, this._options.get());
const newOptions = { ...this._options.get(), ...changedOptions, ...newDiffEditorOptions };
@@ -58,32 +63,6 @@ export class DiffEditorOptions {
}
}
-const diffEditorDefaultOptions: ValidDiffEditorBaseOptions = {
- enableSplitViewResizing: true,
- splitViewDefaultRatio: 0.5,
- renderSideBySide: true,
- renderMarginRevertIcon: true,
- maxComputationTime: 5000,
- maxFileSize: 50,
- ignoreTrimWhitespace: true,
- renderIndicators: true,
- originalEditable: false,
- diffCodeLens: false,
- renderOverviewRuler: true,
- diffWordWrap: 'inherit',
- diffAlgorithm: 'advanced',
- accessibilityVerbose: false,
- experimental: {
- collapseUnchangedRegions: false,
- showMoves: false,
- showEmptyDecorations: true,
- },
- isInEmbeddedEditor: false,
- onlyShowAccessibleDiffViewer: false,
- renderSideBySideInlineBreakpoint: 900,
- useInlineViewWhenSpaceIsLimited: true,
-};
-
function validateDiffEditorOptions(options: Readonly, defaults: ValidDiffEditorBaseOptions): ValidDiffEditorBaseOptions {
return {
enableSplitViewResizing: validateBooleanOption(options.enableSplitViewResizing, defaults.enableSplitViewResizing),
@@ -101,10 +80,15 @@ function validateDiffEditorOptions(options: Readonly, defaul
diffAlgorithm: validateStringSetOption(options.diffAlgorithm, defaults.diffAlgorithm, ['legacy', 'advanced'], { 'smart': 'legacy', 'experimental': 'advanced' }),
accessibilityVerbose: validateBooleanOption(options.accessibilityVerbose, defaults.accessibilityVerbose),
experimental: {
- collapseUnchangedRegions: validateBooleanOption(options.experimental?.collapseUnchangedRegions, defaults.experimental.collapseUnchangedRegions!),
showMoves: validateBooleanOption(options.experimental?.showMoves, defaults.experimental.showMoves!),
showEmptyDecorations: validateBooleanOption(options.experimental?.showEmptyDecorations, defaults.experimental.showEmptyDecorations!),
},
+ hideUnchangedRegions: {
+ enabled: validateBooleanOption(options.hideUnchangedRegions?.enabled ?? (options.experimental as any)?.collapseUnchangedRegions, defaults.hideUnchangedRegions.enabled!),
+ contextLineCount: clampedInt(options.hideUnchangedRegions?.contextLineCount, defaults.hideUnchangedRegions.contextLineCount!, 0, Constants.MAX_SAFE_SMALL_INTEGER),
+ minimumLineCount: clampedInt(options.hideUnchangedRegions?.minimumLineCount, defaults.hideUnchangedRegions.minimumLineCount!, 0, Constants.MAX_SAFE_SMALL_INTEGER),
+ revealLineCount: clampedInt(options.hideUnchangedRegions?.revealLineCount, defaults.hideUnchangedRegions.revealLineCount!, 0, Constants.MAX_SAFE_SMALL_INTEGER),
+ },
isInEmbeddedEditor: validateBooleanOption(options.isInEmbeddedEditor, defaults.isInEmbeddedEditor),
onlyShowAccessibleDiffViewer: validateBooleanOption(options.onlyShowAccessibleDiffViewer, defaults.onlyShowAccessibleDiffViewer),
renderSideBySideInlineBreakpoint: clampedInt(options.renderSideBySideInlineBreakpoint, defaults.renderSideBySideInlineBreakpoint, 0, Constants.MAX_SAFE_SMALL_INTEGER),
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorViewModel.ts b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorViewModel.ts
index 039f82dd6ac..143b1834b66 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorViewModel.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorViewModel.ts
@@ -4,22 +4,20 @@
*--------------------------------------------------------------------------------------------*/
import { RunOnceScheduler } from 'vs/base/common/async';
+import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
import { IObservable, IReader, ISettableObservable, ITransaction, autorunWithStore, derived, observableSignal, observableSignalFromEvent, observableValue, transaction, waitForState } from 'vs/base/common/observable';
-import { isDefined } from 'vs/base/common/types';
+import { readHotReloadableExport } from 'vs/editor/browser/widget/diffEditorWidget2/utils';
import { ISerializedLineRange, LineRange } from 'vs/editor/common/core/lineRange';
-import { Range } from 'vs/editor/common/core/range';
+import { AdvancedLinesDiffComputer } from 'vs/editor/common/diff/advancedLinesDiffComputer';
import { IDocumentDiff, IDocumentDiffProvider } from 'vs/editor/common/diff/documentDiffProvider';
-import { LineRangeMapping, MovedText, RangeMapping, SimpleLineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
-import { AdvancedLinesDiffComputer, lineRangeMappingFromRangeMappings } from 'vs/editor/common/diff/advancedLinesDiffComputer';
+import { MovedText } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { IDiffEditorModel, IDiffEditorViewModel } from 'vs/editor/common/editorCommon';
import { ITextModel } from 'vs/editor/common/model';
import { TextEditInfo } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper';
import { combineTextEditInfos } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos';
-import { lengthAdd, lengthDiffNonNegative, lengthGetLineCount, lengthOfRange, lengthToPosition, lengthZero, positionToLength } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length';
import { DiffEditorOptions } from './diffEditorOptions';
-import { readHotReloadableExport } from 'vs/editor/browser/widget/diffEditorWidget2/utils';
-import { CancellationTokenSource } from 'vs/base/common/cancellation';
export class DiffEditorViewModel extends Disposable implements IDiffEditorViewModel {
private readonly _isDiffUpToDate = observableValue('isDiffUpToDate', false);
@@ -35,13 +33,13 @@ export class DiffEditorViewModel extends Disposable implements IDiffEditorViewMo
);
public readonly unchangedRegions: IObservable = derived(r => {
/** @description unchangedRegions */
- if (this._options.collapseUnchangedRegions.read(r)) {
+ if (this._options.hideUnchangedRegions.read(r)) {
return this._unchangedRegions.read(r).regions;
} else {
// Reset state
transaction(tx => {
for (const r of this._unchangedRegions.get().regions) {
- r.setState(0, 0, tx);
+ r.collapseAll(tx);
}
});
return [];
@@ -79,8 +77,14 @@ export class DiffEditorViewModel extends Disposable implements IDiffEditorViewMo
const contentChangedSignal = observableSignal('contentChangedSignal');
const debouncer = this._register(new RunOnceScheduler(() => contentChangedSignal.trigger(undefined), 200));
- const updateUnchangedRegions = (result: IDocumentDiff, tx: ITransaction) => {
- const newUnchangedRegions = UnchangedRegion.fromDiffs(result.changes, model.original.getLineCount(), model.modified.getLineCount());
+ const updateUnchangedRegions = (result: IDocumentDiff, tx: ITransaction, reader?: IReader) => {
+ const newUnchangedRegions = UnchangedRegion.fromDiffs(
+ result.changes,
+ model.original.getLineCount(),
+ model.modified.getLineCount(),
+ this._options.hideUnchangedRegionsminimumLineCount.read(reader),
+ this._options.hideUnchangedRegionsContextLineCount.read(reader),
+ );
// Transfer state from cur state
const lastUnchangedRegions = this._unchangedRegions.get();
@@ -122,7 +126,6 @@ export class DiffEditorViewModel extends Disposable implements IDiffEditorViewMo
);
};
-
this._register(model.modified.onDidChangeContent((e) => {
const diff = this._diff.get();
if (diff) {
@@ -164,6 +167,11 @@ export class DiffEditorViewModel extends Disposable implements IDiffEditorViewMo
this._register(autorunWithStore(async (reader, store) => {
/** @description compute diff */
+
+ // So that they get recomputed when these settings change
+ this._options.hideUnchangedRegionsminimumLineCount.read(reader);
+ this._options.hideUnchangedRegionsContextLineCount.read(reader);
+
debouncer.cancel();
contentChangedSignal.read(reader);
documentDiffProviderOptionChanged.read(reader);
@@ -286,7 +294,7 @@ export class DiffState {
export class DiffMapping {
constructor(
- readonly lineRangeMapping: LineRangeMapping,
+ readonly lineRangeMapping: DetailedLineRangeMapping,
) {
/*
readonly movedTo: MovedText | undefined,
@@ -310,22 +318,25 @@ export class DiffMapping {
}
export class UnchangedRegion {
- public static fromDiffs(changes: readonly LineRangeMapping[], originalLineCount: number, modifiedLineCount: number): UnchangedRegion[] {
- const inversedMappings = LineRangeMapping.inverse(changes, originalLineCount, modifiedLineCount);
+ public static fromDiffs(
+ changes: readonly DetailedLineRangeMapping[],
+ originalLineCount: number,
+ modifiedLineCount: number,
+ minHiddenLineCount: number,
+ minContext: number,
+ ): UnchangedRegion[] {
+ const inversedMappings = DetailedLineRangeMapping.inverse(changes, originalLineCount, modifiedLineCount);
const result: UnchangedRegion[] = [];
- const minHiddenLineCount = 3;
- const minContext = 3;
-
for (const mapping of inversedMappings) {
- let origStart = mapping.originalRange.startLineNumber;
- let modStart = mapping.modifiedRange.startLineNumber;
- let length = mapping.originalRange.length;
+ let origStart = mapping.original.startLineNumber;
+ let modStart = mapping.modified.startLineNumber;
+ let length = mapping.original.length;
const atStart = origStart === 1 && modStart === 1;
const atEnd = origStart + length === originalLineCount + 1 && modStart + length === modifiedLineCount + 1;
- if ((atStart || atEnd) && length > minContext + minHiddenLineCount) {
+ if ((atStart || atEnd) && length >= minContext + minHiddenLineCount) {
if (atStart && !atEnd) {
length -= minContext;
}
@@ -335,7 +346,7 @@ export class UnchangedRegion {
length -= minContext;
}
result.push(new UnchangedRegion(origStart, modStart, length, 0, 0));
- } else if (length > minContext * 2 + minHiddenLineCount) {
+ } else if (length >= minContext * 2 + minHiddenLineCount) {
origStart += minContext;
modStart += minContext;
length -= minContext * 2;
@@ -441,6 +452,11 @@ export class UnchangedRegion {
}
}
+ public collapseAll(tx: ITransaction | undefined): void {
+ this._visibleLineCountTop.set(0, tx);
+ this._visibleLineCountBottom.set(0, tx);
+ }
+
public setState(visibleLineCountTop: number, visibleLineCountBottom: number, tx: ITransaction | undefined): void {
visibleLineCountTop = Math.max(Math.min(visibleLineCountTop, this.lineCount), 0);
visibleLineCountBottom = Math.max(Math.min(visibleLineCountBottom, this.lineCount - visibleLineCountTop), 0);
@@ -451,6 +467,9 @@ export class UnchangedRegion {
}
function applyOriginalEdits(diff: IDocumentDiff, textEdits: TextEditInfo[], originalTextModel: ITextModel, modifiedTextModel: ITextModel): IDocumentDiff | undefined {
+ return undefined;
+ /*
+ TODO@hediet
if (textEdits.length === 0) {
return diff;
}
@@ -460,9 +479,9 @@ function applyOriginalEdits(diff: IDocumentDiff, textEdits: TextEditInfo[], orig
if (!diff3) {
return undefined;
}
- return flip(diff3);
+ return flip(diff3);*/
}
-
+/*
function flip(diff: IDocumentDiff): IDocumentDiff {
return {
changes: diff.changes.map(c => c.flip()),
@@ -471,8 +490,11 @@ function flip(diff: IDocumentDiff): IDocumentDiff {
quitEarly: diff.quitEarly,
};
}
-
+*/
function applyModifiedEdits(diff: IDocumentDiff, textEdits: TextEditInfo[], originalTextModel: ITextModel, modifiedTextModel: ITextModel): IDocumentDiff | undefined {
+ return undefined;
+ /*
+ TODO@hediet
if (textEdits.length === 0) {
return diff;
}
@@ -496,9 +518,9 @@ function applyModifiedEdits(diff: IDocumentDiff, textEdits: TextEditInfo[], orig
quitEarly: false,
changes,
moves,
- };
+ };*/
}
-
+/*
function applyEditToLineRange(range: LineRange, textEdits: TextEditInfo[]): LineRange | undefined {
let rangeStartLineNumber = range.startLineNumber;
let rangeEndLineNumberEx = range.endLineNumberExclusive;
@@ -565,3 +587,4 @@ function applyModifiedEditsToLineRangeMappings(changes: readonly LineRangeMappin
);
return newChanges;
}
+*/
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.ts b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.ts
index 6d538fe632d..79ef25a3e44 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.ts
@@ -23,7 +23,7 @@ export class ToggleCollapseUnchangedRegions extends Action2 {
title: { value: localize('toggleCollapseUnchangedRegions', "Toggle Collapse Unchanged Regions"), original: 'Toggle Collapse Unchanged Regions' },
icon: Codicon.map,
precondition: ContextKeyEqualsExpr.create('diffEditorVersion', 2),
- toggled: ContextKeyExpr.has('config.diffEditor.experimental.collapseUnchangedRegions'),
+ toggled: ContextKeyExpr.has('config.diffEditor.hideUnchangedRegions.enabled'),
menu: {
id: MenuId.EditorTitle,
order: 22,
@@ -35,8 +35,8 @@ export class ToggleCollapseUnchangedRegions extends Action2 {
run(accessor: ServicesAccessor, ...args: unknown[]): void {
const configurationService = accessor.get(IConfigurationService);
- const newValue = !configurationService.getValue('diffEditor.experimental.collapseUnchangedRegions');
- configurationService.updateValue('diffEditor.experimental.collapseUnchangedRegions', newValue);
+ const newValue = !configurationService.getValue('diffEditor.hideUnchangedRegions.enabled');
+ configurationService.updateValue('diffEditor.hideUnchangedRegions.enabled', newValue);
}
}
@@ -108,6 +108,7 @@ const diffEditorCategory: ILocalizedString = {
value: localize('diffEditor', 'Diff Editor'),
original: 'Diff Editor',
};
+
export class SwitchSide extends EditorAction2 {
constructor() {
super({
@@ -160,3 +161,47 @@ export class ExitCompareMove extends EditorAction2 {
}
registerAction2(ExitCompareMove);
+
+export class CollapseAllUnchangedRegions extends EditorAction2 {
+ constructor() {
+ super({
+ id: 'diffEditor.collapseAllUnchangedRegions',
+ title: { value: localize('collapseAllUnchangedRegions', "Collapse All Unchanged Regions"), original: 'Collapse All Unchanged Regions' },
+ icon: Codicon.fold,
+ precondition: ContextKeyExpr.and(ContextKeyEqualsExpr.create('diffEditorVersion', 2), ContextKeyExpr.has('isInDiffEditor')),
+ f1: true,
+ category: diffEditorCategory,
+ });
+ }
+
+ runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, ...args: unknown[]): void {
+ const diffEditor = findFocusedDiffEditor(accessor);
+ if (diffEditor instanceof DiffEditorWidget2) {
+ diffEditor.collapseAllUnchangedRegions();
+ }
+ }
+}
+
+registerAction2(CollapseAllUnchangedRegions);
+
+export class ShowAllUnchangedRegions extends EditorAction2 {
+ constructor() {
+ super({
+ id: 'diffEditor.showAllUnchangedRegions',
+ title: { value: localize('showAllUnchangedRegions', "Show All Unchanged Regions"), original: 'Show All Unchanged Regions' },
+ icon: Codicon.unfold,
+ precondition: ContextKeyExpr.and(ContextKeyEqualsExpr.create('diffEditorVersion', 2), ContextKeyExpr.has('isInDiffEditor')),
+ f1: true,
+ category: diffEditorCategory,
+ });
+ }
+
+ runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, ...args: unknown[]): void {
+ const diffEditor = findFocusedDiffEditor(accessor);
+ if (diffEditor instanceof DiffEditorWidget2) {
+ diffEditor.showAllUnchangedRegions();
+ }
+ }
+}
+
+registerAction2(ShowAllUnchangedRegions);
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.ts b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.ts
index 575f92e5f6b..94af3098934 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.ts
@@ -29,7 +29,7 @@ import { IDimension } from 'vs/editor/common/core/dimension';
import { Position } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
import { CursorChangeReason } from 'vs/editor/common/cursorEvents';
-import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { IDiffComputationResult, ILineChange } from 'vs/editor/common/diff/legacyLinesDiffComputer';
import { EditorType, IDiffEditorModel, IDiffEditorViewModel, IDiffEditorViewState } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
@@ -45,6 +45,7 @@ import { DiffEditorEditors } from './diffEditorEditors';
import { DiffEditorOptions } from './diffEditorOptions';
import { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewModel';
import { toDisposable } from 'vs/base/common/lifecycle';
+import { IEditorProgressService } from 'vs/platform/progress/common/progress';
export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
private readonly elements = h('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [
@@ -81,7 +82,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
private readonly movedBlocksLinesPart = observableValue('MovedBlocksLinesPart', undefined);
- public get collapseUnchangedRegions() { return this._options.collapseUnchangedRegions.get(); }
+ public get collapseUnchangedRegions() { return this._options.hideUnchangedRegions.get(); }
constructor(
private readonly _domElement: HTMLElement,
@@ -91,6 +92,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
@IInstantiationService private readonly _parentInstantiationService: IInstantiationService,
@ICodeEditorService codeEditorService: ICodeEditorService,
@IAudioCueService private readonly _audioCueService: IAudioCueService,
+ @IEditorProgressService private readonly _editorProgressService: IEditorProgressService,
) {
super();
codeEditorService.willCreateDiffEditor();
@@ -230,7 +232,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
this._register(applyStyle(this.elements.overlay, {
width: this._layoutInfo.map((i, r) => i.originalEditor.width + (this._options.renderSideBySide.read(r) ? 0 : i.modifiedEditor.width)),
- visibility: derived(reader => /** @description visibility */(this._options.collapseUnchangedRegions.read(reader) && this._diffModel.read(reader)?.diff.read(reader)?.mappings.length === 0)
+ visibility: derived(reader => /** @description visibility */(this._options.hideUnchangedRegions.read(reader) && this._diffModel.read(reader)?.diff.read(reader)?.mappings.length === 0)
? 'visible' : 'hidden'
),
}));
@@ -246,8 +248,8 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
const diffs = model.diff.get()?.mappings;
if (!diffs) { return; }
const diff = diffs.find(d =>
- viewZone?.detail.afterLineNumber === d.lineRangeMapping.modifiedRange.startLineNumber - 1 ||
- d.lineRangeMapping.modifiedRange.startLineNumber === lineNumber
+ viewZone?.detail.afterLineNumber === d.lineRangeMapping.modified.startLineNumber - 1 ||
+ d.lineRangeMapping.modified.startLineNumber === lineNumber
);
if (!diff) { return; }
this.revert(diff.lineRangeMapping);
@@ -258,16 +260,24 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
this._register(Event.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, (e) => {
if (e?.reason === CursorChangeReason.Explicit) {
- const diff = this._diffModel.get()?.diff.get()?.mappings.find(m => m.lineRangeMapping.modifiedRange.contains(e.position.lineNumber));
- if (diff?.lineRangeMapping.modifiedRange.isEmpty) {
+ const diff = this._diffModel.get()?.diff.get()?.mappings.find(m => m.lineRangeMapping.modified.contains(e.position.lineNumber));
+ if (diff?.lineRangeMapping.modified.isEmpty) {
this._audioCueService.playAudioCue(AudioCue.diffLineDeleted, { source: 'diffEditor.cursorPositionChanged' });
- } else if (diff?.lineRangeMapping.originalRange.isEmpty) {
+ } else if (diff?.lineRangeMapping.original.isEmpty) {
this._audioCueService.playAudioCue(AudioCue.diffLineInserted, { source: 'diffEditor.cursorPositionChanged' });
} else if (diff) {
this._audioCueService.playAudioCue(AudioCue.diffLineModified, { source: 'diffEditor.cursorPositionChanged' });
}
}
}));
+
+ const isDiffUpToDate = this._diffModel.map((m, reader) => m?.isDiffUpToDate.read(reader));
+ this._register(autorunWithStore((reader, store) => {
+ if (isDiffUpToDate.read(reader) === false) {
+ const r = this._editorProgressService.show(true, 1000);
+ store.add(toDisposable(() => r.done()));
+ }
+ }));
}
public getContentHeight() {
@@ -426,7 +436,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
};
}
- revert(diff: LineRangeMapping): void {
+ revert(diff: DetailedLineRangeMapping): void {
const model = this._diffModel.get()?.model;
if (!model) { return; }
@@ -437,8 +447,8 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
}))
: [
{
- range: diff.modifiedRange.toExclusiveRange(),
- text: model.original.getValueInRange(diff.originalRange.toExclusiveRange())
+ range: diff.modified.toExclusiveRange(),
+ text: model.original.getValueInRange(diff.original.toExclusiveRange())
}
];
@@ -446,8 +456,8 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
}
private _goTo(diff: DiffMapping): void {
- this._editors.modified.setPosition(new Position(diff.lineRangeMapping.modifiedRange.startLineNumber, 1));
- this._editors.modified.revealRangeInCenter(diff.lineRangeMapping.modifiedRange.toExclusiveRange());
+ this._editors.modified.setPosition(new Position(diff.lineRangeMapping.modified.startLineNumber, 1));
+ this._editors.modified.revealRangeInCenter(diff.lineRangeMapping.modified.toExclusiveRange());
}
goToDiff(target: 'previous' | 'next'): void {
@@ -460,15 +470,15 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
let diff: DiffMapping | undefined;
if (target === 'next') {
- diff = diffs.find(d => d.lineRangeMapping.modifiedRange.startLineNumber > curLineNumber) ?? diffs[0];
+ diff = diffs.find(d => d.lineRangeMapping.modified.startLineNumber > curLineNumber) ?? diffs[0];
} else {
- diff = findLast(diffs, d => d.lineRangeMapping.modifiedRange.startLineNumber < curLineNumber) ?? diffs[diffs.length - 1];
+ diff = findLast(diffs, d => d.lineRangeMapping.modified.startLineNumber < curLineNumber) ?? diffs[diffs.length - 1];
}
this._goTo(diff);
- if (diff.lineRangeMapping.modifiedRange.isEmpty) {
+ if (diff.lineRangeMapping.modified.isEmpty) {
this._audioCueService.playAudioCue(AudioCue.diffLineDeleted, { source: 'diffEditor.goToDiff' });
- } else if (diff.lineRangeMapping.originalRange.isEmpty) {
+ } else if (diff.lineRangeMapping.original.isEmpty) {
this._audioCueService.playAudioCue(AudioCue.diffLineInserted, { source: 'diffEditor.goToDiff' });
} else if (diff) {
this._audioCueService.playAudioCue(AudioCue.diffLineModified, { source: 'diffEditor.goToDiff' });
@@ -532,28 +542,48 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
if (!model) { return; }
model.movedTextToCompare.set(undefined, undefined);
}
+
+ collapseAllUnchangedRegions(): void {
+ const unchangedRegions = this._diffModel.get()?.unchangedRegions.get();
+ if (!unchangedRegions) { return; }
+ transaction(tx => {
+ for (const region of unchangedRegions) {
+ region.collapseAll(tx);
+ }
+ });
+ }
+
+ showAllUnchangedRegions(): void {
+ const unchangedRegions = this._diffModel.get()?.unchangedRegions.get();
+ if (!unchangedRegions) { return; }
+ transaction(tx => {
+ for (const region of unchangedRegions) {
+ region.showAll(tx);
+ }
+ });
+ }
}
-function translatePosition(posInOriginal: Position, mappings: LineRangeMapping[]): Range {
- const mapping = findLast(mappings, m => m.originalRange.startLineNumber <= posInOriginal.lineNumber);
+function translatePosition(posInOriginal: Position, mappings: DetailedLineRangeMapping[]): Range {
+ const mapping = findLast(mappings, m => m.original.startLineNumber <= posInOriginal.lineNumber);
if (!mapping) {
// No changes before the position
return Range.fromPositions(posInOriginal);
}
- if (mapping.originalRange.endLineNumberExclusive <= posInOriginal.lineNumber) {
- const newLineNumber = posInOriginal.lineNumber - mapping.originalRange.endLineNumberExclusive + mapping.modifiedRange.endLineNumberExclusive;
+ if (mapping.original.endLineNumberExclusive <= posInOriginal.lineNumber) {
+ const newLineNumber = posInOriginal.lineNumber - mapping.original.endLineNumberExclusive + mapping.modified.endLineNumberExclusive;
return Range.fromPositions(new Position(newLineNumber, posInOriginal.column));
}
if (!mapping.innerChanges) {
// Only for legacy algorithm
- return Range.fromPositions(new Position(mapping.modifiedRange.startLineNumber, 1));
+ return Range.fromPositions(new Position(mapping.modified.startLineNumber, 1));
}
const innerMapping = findLast(mapping.innerChanges, m => m.originalRange.getStartPosition().isBeforeOrEqual(posInOriginal));
if (!innerMapping) {
- const newLineNumber = posInOriginal.lineNumber - mapping.originalRange.startLineNumber + mapping.modifiedRange.startLineNumber;
+ const newLineNumber = posInOriginal.lineNumber - mapping.original.startLineNumber + mapping.modified.startLineNumber;
return Range.fromPositions(new Position(newLineNumber, posInOriginal.column));
}
@@ -590,24 +620,24 @@ function toLineChanges(state: DiffState): ILineChange[] {
let modifiedEndLineNumber: number;
let innerChanges = m.innerChanges;
- if (m.originalRange.isEmpty) {
+ if (m.original.isEmpty) {
// Insertion
- originalStartLineNumber = m.originalRange.startLineNumber - 1;
+ originalStartLineNumber = m.original.startLineNumber - 1;
originalEndLineNumber = 0;
innerChanges = undefined;
} else {
- originalStartLineNumber = m.originalRange.startLineNumber;
- originalEndLineNumber = m.originalRange.endLineNumberExclusive - 1;
+ originalStartLineNumber = m.original.startLineNumber;
+ originalEndLineNumber = m.original.endLineNumberExclusive - 1;
}
- if (m.modifiedRange.isEmpty) {
+ if (m.modified.isEmpty) {
// Deletion
- modifiedStartLineNumber = m.modifiedRange.startLineNumber - 1;
+ modifiedStartLineNumber = m.modified.startLineNumber - 1;
modifiedEndLineNumber = 0;
innerChanges = undefined;
} else {
- modifiedStartLineNumber = m.modifiedRange.startLineNumber;
- modifiedEndLineNumber = m.modifiedRange.endLineNumberExclusive - 1;
+ modifiedStartLineNumber = m.modified.startLineNumber;
+ modifiedEndLineNumber = m.modified.endLineNumberExclusive - 1;
}
return {
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/inlineDiffDeletedCodeMargin.ts b/src/vs/editor/browser/widget/diffEditorWidget2/inlineDiffDeletedCodeMargin.ts
index 5aca1405d41..f5b3ff67e26 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/inlineDiffDeletedCodeMargin.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/inlineDiffDeletedCodeMargin.ts
@@ -13,7 +13,7 @@ import { IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrow
import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';
import { DiffEditorWidget2 } from 'vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
-import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { EndOfLineSequence, ITextModel } from 'vs/editor/common/model';
import { localize } from 'vs/nls';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
@@ -39,7 +39,7 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
private readonly _getViewZoneId: () => string,
private readonly _marginDomNode: HTMLElement,
private readonly _modifiedEditor: CodeEditorWidget,
- private readonly _diff: LineRangeMapping,
+ private readonly _diff: DetailedLineRangeMapping,
private readonly _editor: DiffEditorWidget2,
private readonly _viewLineCounts: number[],
private readonly _originalTextModel: ITextModel,
@@ -70,38 +70,38 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
getAnchor: () => ({ x, y }),
getActions: () => {
const actions: Action[] = [];
- const isDeletion = _diff.modifiedRange.isEmpty;
+ const isDeletion = _diff.modified.isEmpty;
// default action
actions.push(new Action(
'diff.clipboard.copyDeletedContent',
isDeletion
- ? (_diff.originalRange.length > 1
+ ? (_diff.original.length > 1
? localize('diff.clipboard.copyDeletedLinesContent.label', "Copy deleted lines")
: localize('diff.clipboard.copyDeletedLinesContent.single.label', "Copy deleted line"))
- : (_diff.originalRange.length > 1
+ : (_diff.original.length > 1
? localize('diff.clipboard.copyChangedLinesContent.label', "Copy changed lines")
: localize('diff.clipboard.copyChangedLinesContent.single.label', "Copy changed line")),
undefined,
true,
async () => {
- const originalText = this._originalTextModel.getValueInRange(_diff.originalRange.toExclusiveRange());
+ const originalText = this._originalTextModel.getValueInRange(_diff.original.toExclusiveRange());
await this._clipboardService.writeText(originalText);
}
));
- if (_diff.originalRange.length > 1) {
+ if (_diff.original.length > 1) {
actions.push(new Action(
'diff.clipboard.copyDeletedLineContent',
isDeletion
? localize('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line ({0})",
- _diff.originalRange.startLineNumber + currentLineNumberOffset)
+ _diff.original.startLineNumber + currentLineNumberOffset)
: localize('diff.clipboard.copyChangedLineContent.label', "Copy changed line ({0})",
- _diff.originalRange.startLineNumber + currentLineNumberOffset),
+ _diff.original.startLineNumber + currentLineNumberOffset),
undefined,
true,
async () => {
- let lineContent = this._originalTextModel.getLineContent(_diff.originalRange.startLineNumber + currentLineNumberOffset);
+ let lineContent = this._originalTextModel.getLineContent(_diff.original.startLineNumber + currentLineNumberOffset);
if (lineContent === '') {
// empty line -> new line
const eof = this._originalTextModel.getEndOfLineSequence();
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.ts b/src/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.ts
index 56357753f62..32d34563d46 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.ts
@@ -25,7 +25,7 @@ import { animatedObservable, joinCombine } from 'vs/editor/browser/widget/diffEd
import { EditorOption } from 'vs/editor/common/config/editorOptions';
import { LineRange } from 'vs/editor/common/core/lineRange';
import { Position } from 'vs/editor/common/core/position';
-import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { ScrollType } from 'vs/editor/common/editorCommon';
import { BackgroundTokenizationState } from 'vs/editor/common/tokenizationTextModelPart';
import { InlineDecoration, InlineDecorationType } from 'vs/editor/common/viewModel';
@@ -193,7 +193,7 @@ export class ViewZoneManager extends Disposable {
const decorations: InlineDecoration[] = [];
for (const i of a.diff.innerChanges || []) {
decorations.push(new InlineDecoration(
- i.originalRange.delta(-(a.diff.originalRange.startLineNumber - 1)),
+ i.originalRange.delta(-(a.diff.original.startLineNumber - 1)),
diffDeleteDecoration.className!,
InlineDecorationType.Regular
));
@@ -287,7 +287,7 @@ export class ViewZoneManager extends Disposable {
}
let marginDomNode: HTMLElement | undefined = undefined;
- if (a.diff && a.diff.modifiedRange.isEmpty && this._options.shouldRenderRevertArrows.read(reader)) {
+ if (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderRevertArrows.read(reader)) {
marginDomNode = createViewZoneMarginArrow();
}
@@ -472,7 +472,7 @@ interface ILineRangeAlignment {
* If this range alignment is a direct result of a diff, then this is the diff's line mapping.
* Only used for inline-view.
*/
- diff?: LineRangeMapping;
+ diff?: DetailedLineRangeMapping;
}
function computeRangeAlignment(
@@ -540,11 +540,11 @@ function computeRangeAlignment(
for (const m of diffs) {
const c = m.lineRangeMapping;
- handleAlignmentsOutsideOfDiffs(c.originalRange.startLineNumber, c.modifiedRange.startLineNumber);
+ handleAlignmentsOutsideOfDiffs(c.original.startLineNumber, c.modified.startLineNumber);
let first = true;
- let lastModLineNumber = c.modifiedRange.startLineNumber;
- let lastOrigLineNumber = c.originalRange.startLineNumber;
+ let lastModLineNumber = c.modified.startLineNumber;
+ let lastOrigLineNumber = c.original.startLineNumber;
function emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number) {
if (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) {
@@ -593,10 +593,10 @@ function computeRangeAlignment(
}
}
- emitAlignment(c.originalRange.endLineNumberExclusive, c.modifiedRange.endLineNumberExclusive);
+ emitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive);
- lastOriginalLineNumber = c.originalRange.endLineNumberExclusive;
- lastModifiedLineNumber = c.modifiedRange.endLineNumberExclusive;
+ lastOriginalLineNumber = c.original.endLineNumberExclusive;
+ lastModifiedLineNumber = c.modified.endLineNumberExclusive;
}
handleAlignmentsOutsideOfDiffs(Number.MAX_VALUE, Number.MAX_VALUE);
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/movedBlocksLines.ts b/src/vs/editor/browser/widget/diffEditorWidget2/movedBlocksLines.ts
index 27a9f8f46fb..8a618685996 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/movedBlocksLines.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/movedBlocksLines.ts
@@ -9,7 +9,7 @@ import { Action } from 'vs/base/common/actions';
import { booleanComparator, compareBy, findMaxIdxBy, numberComparator, tieBreakComparators } from 'vs/base/common/arrays';
import { Codicon } from 'vs/base/common/codicons';
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
-import { IObservable, autorun, autorunWithStore, constObservable, derived, derivedWithStore, keepAlive, observableFromEvent, observableSignalFromEvent, observableValue } from 'vs/base/common/observable';
+import { IObservable, autorun, autorunHandleChanges, autorunWithStore, constObservable, derived, derivedWithStore, keepAlive, observableFromEvent, observableSignalFromEvent, observableValue } from 'vs/base/common/observable';
import { ThemeIcon } from 'vs/base/common/themables';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditorWidget2/diffEditorEditors';
@@ -82,19 +82,50 @@ export class MovedBlocksLinesPart extends Disposable {
}
}));
- this._register(this._editors.original.onDidChangeCursorPosition(e => {
- const m = this._diffModel.get();
- if (!m) { return; }
- const movedText = m.diff.get()!.movedTexts.find(m => m.lineRangeMapping.original.contains(e.position.lineNumber));
- if (movedText !== m.movedTextToCompare.get()) {
- m.movedTextToCompare.set(undefined, undefined);
+ const originalCursorPosition = observableFromEvent(this._editors.original.onDidChangeCursorPosition, () => this._editors.original.getPosition());
+ const modifiedCursorPosition = observableFromEvent(this._editors.modified.onDidChangeCursorPosition, () => this._editors.modified.getPosition());
+ const originalHasFocus = observableSignalFromEvent(
+ 'original.onDidFocusEditorWidget',
+ e => this._editors.original.onDidFocusEditorWidget(() => setTimeout(() => e(undefined), 0))
+ );
+ const modifiedHasFocus = observableSignalFromEvent(
+ 'modified.onDidFocusEditorWidget',
+ e => this._editors.modified.onDidFocusEditorWidget(() => setTimeout(() => e(undefined), 0))
+ );
+
+ let lastChangedEditor: 'original' | 'modified' = 'modified';
+
+ this._register(autorunHandleChanges({
+ createEmptyChangeSummary: () => undefined,
+ handleChange: (ctx, summary) => {
+ if (ctx.didChange(originalHasFocus)) { lastChangedEditor = 'original'; }
+ if (ctx.didChange(modifiedHasFocus)) { lastChangedEditor = 'modified'; }
+ return true;
}
- m.setActiveMovedText(movedText);
- }));
- this._register(this._editors.modified.onDidChangeCursorPosition(e => {
- const m = this._diffModel.get();
+ }, reader => {
+ originalHasFocus.read(reader);
+ modifiedHasFocus.read(reader);
+
+ const m = this._diffModel.read(reader);
if (!m) { return; }
- const movedText = m.diff.get()!.movedTexts.find(m => m.lineRangeMapping.modified.contains(e.position.lineNumber));
+ const diff = m.diff.read(reader);
+
+ let movedText: MovedText | undefined = undefined;
+
+ if (diff && lastChangedEditor === 'original') {
+ const originalPos = originalCursorPosition.read(reader);
+ if (originalPos) {
+ movedText = diff.movedTexts.find(m => m.lineRangeMapping.original.contains(originalPos.lineNumber));
+ }
+ }
+
+ if (diff && lastChangedEditor === 'modified') {
+ const modifiedPos = modifiedCursorPosition.read(reader);
+ if (modifiedPos) {
+ movedText = diff.movedTexts.find(m => m.lineRangeMapping.modified.contains(modifiedPos.lineNumber));
+ }
+ }
+
if (movedText !== m.movedTextToCompare.get()) {
m.movedTextToCompare.set(undefined, undefined);
}
@@ -324,7 +355,7 @@ class MovedBlockOverlayWidget extends ViewZoneOverlayWidget {
true,
() => {
this._editor.focus();
- this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get() ? undefined : this._move, undefined);
+ this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get() === _move ? undefined : this._move, undefined);
},
);
this._register(autorun(reader => {
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/overviewRulerPart.ts b/src/vs/editor/browser/widget/diffEditorWidget2/overviewRulerPart.ts
index 8996560b36a..bd93df81567 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/overviewRulerPart.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/overviewRulerPart.ts
@@ -127,8 +127,8 @@ export class OverviewRulerPart extends Disposable {
});
}
- const originalZones = createZones((diff || []).map(d => d.lineRangeMapping.originalRange), colors.removeColor, this._editors.original);
- const modifiedZones = createZones((diff || []).map(d => d.lineRangeMapping.modifiedRange), colors.insertColor, this._editors.modified);
+ const originalZones = createZones((diff || []).map(d => d.lineRangeMapping.original), colors.removeColor, this._editors.original);
+ const modifiedZones = createZones((diff || []).map(d => d.lineRangeMapping.modified), colors.insertColor, this._editors.modified);
originalOverviewRuler?.setZones(originalZones);
modifiedOverviewRuler?.setZones(modifiedZones);
}));
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/unchangedRanges.ts b/src/vs/editor/browser/widget/diffEditorWidget2/unchangedRanges.ts
index 58a9e28e6aa..a61dc81803b 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/unchangedRanges.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/unchangedRanges.ts
@@ -94,13 +94,13 @@ export class UnchangedRangesFeature extends Disposable {
const d = derived(reader => /** @description hiddenOriginalRangeStart */ r.getHiddenOriginalRange(reader).startLineNumber - 1);
const origVz = new PlaceholderViewZone(d, 24);
origViewZones.push(origVz);
- store.add(new CollapsedCodeOverlayWidget(this._editors.original, origVz, r, r.originalRange, !sideBySide, modifiedOutlineSource, l => this._diffModel.get()!.ensureOriginalLineIsVisible(l, undefined)));
+ store.add(new CollapsedCodeOverlayWidget(this._editors.original, origVz, r, r.originalRange, !sideBySide, modifiedOutlineSource, l => this._diffModel.get()!.ensureModifiedLineIsVisible(l, undefined), this._options));
}
{
const d = derived(reader => /** @description hiddenModifiedRangeStart */ r.getHiddenModifiedRange(reader).startLineNumber - 1);
const modViewZone = new PlaceholderViewZone(d, 24);
modViewZones.push(modViewZone);
- store.add(new CollapsedCodeOverlayWidget(this._editors.modified, modViewZone, r, r.modifiedRange, false, modifiedOutlineSource, l => this._diffModel.get()!.ensureModifiedLineIsVisible(l, undefined)));
+ store.add(new CollapsedCodeOverlayWidget(this._editors.modified, modViewZone, r, r.modifiedRange, false, modifiedOutlineSource, l => this._diffModel.get()!.ensureModifiedLineIsVisible(l, undefined), this._options));
}
}
@@ -174,7 +174,7 @@ export class UnchangedRangesFeature extends Disposable {
if (!model) { return; }
const region = model.unchangedRegions.get().find(r => r.modifiedRange.includes(lineNumber));
if (!region) { return; }
- region.setState(0, 0, undefined);
+ region.collapseAll(undefined);
event.event.stopPropagation();
event.event.preventDefault();
}
@@ -187,7 +187,7 @@ export class UnchangedRangesFeature extends Disposable {
if (!model) { return; }
const region = model.unchangedRegions.get().find(r => r.originalRange.includes(lineNumber));
if (!region) { return; }
- region.setState(0, 0, undefined);
+ region.collapseAll(undefined);
event.event.stopPropagation();
event.event.preventDefault();
}
@@ -250,7 +250,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
private readonly _nodes = h('div.diff-hidden-lines', [
h('div.top@top', { title: localize('diff.hiddenLines.top', 'Click or drag to show more above') }),
h('div.center@content', { style: { display: 'flex' } }, [
- h('div@first', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } },
+ h('div@first', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: '0' } },
[$('a', { title: localize('showAll', 'Show all'), role: 'button', onclick: () => { this.showAll(); } }, ...renderLabelWithIcons('$(unfold)'))]
),
h('div@others', { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } }),
@@ -265,7 +265,8 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
private readonly _unchangedRegionRange: LineRange,
private readonly hide: boolean,
private readonly _modifiedOutlineSource: OutlineSource,
- private readonly _revealHiddenLine: (lineNumber: number) => void,
+ private readonly _revealModifiedHiddenLine: (lineNumber: number) => void,
+ private readonly _options: DiffEditorOptions,
) {
const root = h('div.diff-hidden-lines-widget');
super(_editor, _viewZone, root.root);
@@ -307,7 +308,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
const mouseUpListener = addDisposableListener(window, 'mouseup', e => {
if (!didMove) {
- this._unchangedRegion.showMoreAbove(20, undefined);
+ this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(), undefined);
}
this._nodes.top.classList.toggle('dragging', false);
this._nodes.root.classList.toggle('dragging', false);
@@ -347,7 +348,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
if (!didMove) {
const top = editor.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
- this._unchangedRegion.showMoreBelow(20, undefined);
+ this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(), undefined);
const top2 = editor.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
editor.setScrollTop(editor.getScrollTop() + (top2 - top));
}
@@ -364,7 +365,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
const children: HTMLElement[] = [];
if (!this.hide) {
const lineCount = _unchangedRegion.getHiddenModifiedRange(reader).length;
- const linesHiddenText = localize('hiddenLines', '{0} Hidden Lines', lineCount);
+ const linesHiddenText = localize('hiddenLines', '{0} hidden lines', lineCount);
const span = $('span', { title: localize('diff.hiddenLines.expandAll', 'Double click to unfold') }, linesHiddenText);
span.addEventListener('dblclick', e => {
if (e.button !== 0) { return; }
@@ -395,7 +396,7 @@ class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget {
]).root;
children.push(divItem);
divItem.onclick = () => {
- this._revealHiddenLine(item.startLineNumber);
+ this._revealModifiedHiddenLine(item.startLineNumber);
};
}
}
diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/utils.ts b/src/vs/editor/browser/widget/diffEditorWidget2/utils.ts
index 8460b24326e..e2326b84447 100644
--- a/src/vs/editor/browser/widget/diffEditorWidget2/utils.ts
+++ b/src/vs/editor/browser/widget/diffEditorWidget2/utils.ts
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { IDimension } from 'vs/base/browser/dom';
+import { isHotReloadEnabled, registerHotReloadHandler } from 'vs/base/common/hotReload';
import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { IObservable, IReader, ISettableObservable, autorun, autorunHandleChanges, autorunOpts, observableFromEvent, observableSignalFromEvent, observableValue, transaction } from 'vs/base/common/observable';
import { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver';
@@ -294,28 +295,21 @@ export function readHotReloadableExport(value: T, reader: IReader | undefined
}
export function observeHotReloadableExports(values: any[], reader: IReader | undefined): void {
- const hotReload_deprecateExports = (globalThis as unknown as {
- // This property it defined by the monaco editor playground server
- $hotReload_deprecateExports: Set<(oldExports: Record, newExports: Record) => boolean>;
- }).$hotReload_deprecateExports;
- if (!hotReload_deprecateExports) {
- return;
+ if (isHotReloadEnabled()) {
+ const o = observableSignalFromEvent(
+ 'reload',
+ event => registerHotReloadHandler(oldExports => {
+ if (![...Object.values(oldExports)].some(v => values.includes(v))) {
+ return undefined;
+ }
+ return (_newExports) => {
+ event(undefined);
+ return true;
+ };
+ })
+ );
+ o.read(reader);
}
-
- const o = observableSignalFromEvent('reload', e => {
- function handleExports(oldExports: Record, _newExports: Record) {
- if ([...Object.values(oldExports)].some(v => values.includes(v))) {
- e(undefined);
- return true;
- }
- return false;
- }
- hotReload_deprecateExports.add(handleExports);
- return {
- dispose() { hotReload_deprecateExports.delete(handleExports); }
- };
- });
- o.read(reader);
}
export function applyViewZones(editor: ICodeEditor, viewZones: IObservable, setIsUpdating?: (isUpdatingViewZones: boolean) => void): IDisposable {
diff --git a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts
index dc5dd6c299c..d9785bfc8c1 100644
--- a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts
+++ b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts
@@ -134,8 +134,9 @@ export class EmbeddedDiffEditorWidget2 extends DiffEditorWidget2 {
@IInstantiationService instantiationService: IInstantiationService,
@ICodeEditorService codeEditorService: ICodeEditorService,
@IAudioCueService audioCueService: IAudioCueService,
+ @IEditorProgressService editorProgressService: IEditorProgressService,
) {
- super(domElement, parentEditor.getRawOptions(), codeEditorWidgetOptions, contextKeyService, instantiationService, codeEditorService, audioCueService);
+ super(domElement, parentEditor.getRawOptions(), codeEditorWidgetOptions, contextKeyService, instantiationService, codeEditorService, audioCueService, editorProgressService);
this._parentEditor = parentEditor;
this._overwriteOptions = options;
diff --git a/src/vs/editor/browser/widget/workerBasedDocumentDiffProvider.ts b/src/vs/editor/browser/widget/workerBasedDocumentDiffProvider.ts
index 648ba44763c..79d7bacac9f 100644
--- a/src/vs/editor/browser/widget/workerBasedDocumentDiffProvider.ts
+++ b/src/vs/editor/browser/widget/workerBasedDocumentDiffProvider.ts
@@ -9,7 +9,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import { StopWatch } from 'vs/base/common/stopwatch';
import { LineRange } from 'vs/editor/common/core/lineRange';
import { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider';
-import { LineRangeMapping, RangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping, RangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { ITextModel } from 'vs/editor/common/model';
import { DiffAlgorithmName, IEditorWorkerService } from 'vs/editor/common/services/editorWorker';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
@@ -53,7 +53,7 @@ export class WorkerBasedDocumentDiffProvider implements IDocumentDiffProvider, I
return {
changes: [
- new LineRangeMapping(
+ new DetailedLineRangeMapping(
new LineRange(1, 2),
new LineRange(1, modified.getLineCount() + 1),
[
@@ -84,16 +84,19 @@ export class WorkerBasedDocumentDiffProvider implements IDocumentDiffProvider, I
this.telemetryService.publicLog2<{
timeMs: number;
timedOut: boolean;
+ detectedMoves: number;
}, {
owner: 'hediet';
timeMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'To understand if the new diff algorithm is slower/faster than the old one' };
timedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'To understand how often the new diff algorithm times out' };
+ detectedMoves: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'To understand how often the new diff algorithm detects moves' };
comment: 'This event gives insight about the performance of the new diff algorithm.';
}>('diffEditor.computeDiff', {
timeMs,
timedOut: result?.quitEarly ?? true,
+ detectedMoves: options.computeMoves ? (result?.moves.length ?? 0) : -1,
});
if (cancellationToken.isCancellationRequested) {
diff --git a/src/vs/editor/common/config/diffEditor.ts b/src/vs/editor/common/config/diffEditor.ts
new file mode 100644
index 00000000000..2a62c479848
--- /dev/null
+++ b/src/vs/editor/common/config/diffEditor.ts
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import { ValidDiffEditorBaseOptions } from 'vs/editor/common/config/editorOptions';
+
+export const diffEditorDefaultOptions = {
+ enableSplitViewResizing: true,
+ splitViewDefaultRatio: 0.5,
+ renderSideBySide: true,
+ renderMarginRevertIcon: true,
+ maxComputationTime: 5000,
+ maxFileSize: 50,
+ ignoreTrimWhitespace: true,
+ renderIndicators: true,
+ originalEditable: false,
+ diffCodeLens: false,
+ renderOverviewRuler: true,
+ diffWordWrap: 'inherit',
+ diffAlgorithm: 'advanced',
+ accessibilityVerbose: false,
+ experimental: {
+ showMoves: false,
+ showEmptyDecorations: true,
+ },
+ hideUnchangedRegions: {
+ enabled: false,
+ contextLineCount: 3,
+ minimumLineCount: 3,
+ revealLineCount: 20,
+ },
+ isInEmbeddedEditor: false,
+ onlyShowAccessibleDiffViewer: false,
+ renderSideBySideInlineBreakpoint: 900,
+ useInlineViewWhenSpaceIsLimited: true,
+} satisfies ValidDiffEditorBaseOptions;
diff --git a/src/vs/editor/common/config/editorConfigurationSchema.ts b/src/vs/editor/common/config/editorConfigurationSchema.ts
index b605d1dadf3..684ec85c33b 100644
--- a/src/vs/editor/common/config/editorConfigurationSchema.ts
+++ b/src/vs/editor/common/config/editorConfigurationSchema.ts
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import { diffEditorDefaultOptions } from 'vs/editor/common/config/diffEditor';
import { editorOptionsRegistry } from 'vs/editor/common/config/editorOptions';
import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults';
import * as nls from 'vs/nls';
@@ -150,53 +151,53 @@ const editorConfiguration: IConfigurationNode = {
},
'diffEditor.maxComputationTime': {
type: 'number',
- default: 5000,
+ default: diffEditorDefaultOptions.maxComputationTime,
description: nls.localize('maxComputationTime', "Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")
},
'diffEditor.maxFileSize': {
type: 'number',
- default: 50,
+ default: diffEditorDefaultOptions.maxFileSize,
description: nls.localize('maxFileSize', "Maximum file size in MB for which to compute diffs. Use 0 for no limit.")
},
'diffEditor.renderSideBySide': {
type: 'boolean',
- default: true,
+ default: diffEditorDefaultOptions.renderSideBySide,
description: nls.localize('sideBySide', "Controls whether the diff editor shows the diff side by side or inline.")
},
'diffEditor.renderSideBySideInlineBreakpoint': {
type: 'number',
- default: true,
+ default: diffEditorDefaultOptions.renderSideBySideInlineBreakpoint,
description: nls.localize('renderSideBySideInlineBreakpoint', "If the diff editor width is smaller than this value, the inline view is used.")
},
'diffEditor.useInlineViewWhenSpaceIsLimited': {
type: 'boolean',
- default: true,
+ default: diffEditorDefaultOptions.useInlineViewWhenSpaceIsLimited,
description: nls.localize('useInlineViewWhenSpaceIsLimited', "If enabled and the editor width is too small, the inline view is used.")
},
'diffEditor.renderMarginRevertIcon': {
type: 'boolean',
- default: true,
+ default: diffEditorDefaultOptions.renderMarginRevertIcon,
description: nls.localize('renderMarginRevertIcon', "When enabled, the diff editor shows arrows in its glyph margin to revert changes.")
},
'diffEditor.ignoreTrimWhitespace': {
type: 'boolean',
- default: true,
+ default: diffEditorDefaultOptions.ignoreTrimWhitespace,
description: nls.localize('ignoreTrimWhitespace', "When enabled, the diff editor ignores changes in leading or trailing whitespace.")
},
'diffEditor.renderIndicators': {
type: 'boolean',
- default: true,
+ default: diffEditorDefaultOptions.renderIndicators,
description: nls.localize('renderIndicators', "Controls whether the diff editor shows +/- indicators for added/removed changes.")
},
'diffEditor.codeLens': {
type: 'boolean',
- default: false,
+ default: diffEditorDefaultOptions.diffCodeLens,
description: nls.localize('codeLens', "Controls whether the editor shows CodeLens.")
},
'diffEditor.wordWrap': {
type: 'string',
enum: ['off', 'on', 'inherit'],
- default: 'inherit',
+ default: diffEditorDefaultOptions.diffWordWrap,
markdownEnumDescriptions: [
nls.localize('wordWrap.off', "Lines will never wrap."),
nls.localize('wordWrap.on', "Lines will wrap at the viewport width."),
@@ -206,32 +207,50 @@ const editorConfiguration: IConfigurationNode = {
'diffEditor.diffAlgorithm': {
type: 'string',
enum: ['legacy', 'advanced'],
- default: 'advanced',
+ default: diffEditorDefaultOptions.diffAlgorithm,
markdownEnumDescriptions: [
nls.localize('diffAlgorithm.legacy', "Uses the legacy diffing algorithm."),
nls.localize('diffAlgorithm.advanced', "Uses the advanced diffing algorithm."),
],
tags: ['experimental'],
},
- 'diffEditor.experimental.collapseUnchangedRegions': {
+ 'diffEditor.hideUnchangedRegions.enabled': {
type: 'boolean',
- default: false,
- markdownDescription: nls.localize('collapseUnchangedRegions', "Controls whether the diff editor shows unchanged regions. Only works when {0} is set.", '`#diffEditor.experimental.useVersion2#`'),
+ default: diffEditorDefaultOptions.hideUnchangedRegions.enabled,
+ markdownDescription: nls.localize('hideUnchangedRegions.enabled', "Controls whether the diff editor shows unchanged regions. Only works when {0} is set.", '`#diffEditor.experimental.useVersion2#`'),
+ },
+ 'diffEditor.hideUnchangedRegions.revealLineCount': {
+ type: 'integer',
+ default: diffEditorDefaultOptions.hideUnchangedRegions.revealLineCount,
+ markdownDescription: nls.localize('hideUnchangedRegions.revealLineCount', "Controls how many lines are used for unchanged regions. Only works when {0} is set.", '`#diffEditor.experimental.useVersion2#`'),
+ minimum: 1,
+ },
+ 'diffEditor.hideUnchangedRegions.minimumLineCount': {
+ type: 'integer',
+ default: diffEditorDefaultOptions.hideUnchangedRegions.minimumLineCount,
+ markdownDescription: nls.localize('hideUnchangedRegions.minimumLineCount', "Controls how many lines are used as a minimum for unchanged regions. Only works when {0} is set.", '`#diffEditor.experimental.useVersion2#`'),
+ minimum: 1,
+ },
+ 'diffEditor.hideUnchangedRegions.contextLineCount': {
+ type: 'integer',
+ default: diffEditorDefaultOptions.hideUnchangedRegions.contextLineCount,
+ markdownDescription: nls.localize('hideUnchangedRegions.contextLineCount', "Controls how many lines are used as context when comparing unchanged regions. Only works when {0} is set.", '`#diffEditor.experimental.useVersion2#`'),
+ minimum: 1,
},
'diffEditor.experimental.showMoves': {
type: 'boolean',
- default: false,
+ default: diffEditorDefaultOptions.experimental.showMoves,
markdownDescription: nls.localize('showMoves', "Controls whether the diff editor should show detected code moves. Only works when {0} is set.", '`#diffEditor.experimental.useVersion2#`')
},
'diffEditor.experimental.useVersion2': {
type: 'boolean',
- default: false,
+ default: true,
description: nls.localize('useVersion2', "Controls whether the diff editor uses the new or the old implementation."),
tags: ['experimental'],
},
'diffEditor.experimental.showEmptyDecorations': {
type: 'boolean',
- default: true,
+ default: diffEditorDefaultOptions.experimental.showEmptyDecorations,
description: nls.localize('showEmptyDecorations', "Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted."),
}
}
diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts
index eee7baf03c6..35979acc29f 100644
--- a/src/vs/editor/common/config/editorOptions.ts
+++ b/src/vs/editor/common/config/editorOptions.ts
@@ -825,10 +825,6 @@ export interface IDiffEditorBaseOptions {
accessibilityVerbose?: boolean;
experimental?: {
- /**
- * Defaults to false.
- */
- collapseUnchangedRegions?: boolean;
/**
* Defaults to false.
*/
@@ -847,6 +843,13 @@ export interface IDiffEditorBaseOptions {
* If the diff editor should only show the difference review mode.
*/
onlyShowAccessibleDiffViewer?: boolean;
+
+ hideUnchangedRegions?: {
+ enabled?: boolean;
+ revealLineCount?: number;
+ minimumLineCount?: number;
+ contextLineCount?: number;
+ };
}
/**
@@ -2796,7 +2799,7 @@ class EditorStickyScroll extends BaseEditorOption= next.startLineNumber) {
- // merge
- current = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));
- } else {
- // push
- result.push(current);
- current = next;
- }
- }
- }
- if (current !== null) {
- result.push(current);
- }
- return result;
+ return result.ranges;
}
public static ofLength(startLineNumber: number, length: number): LineRange {
@@ -251,3 +197,163 @@ export class LineRange {
}
export type ISerializedLineRange = [startLineNumber: number, endLineNumberExclusive: number];
+
+
+export class LineRangeSet {
+ constructor(
+ /**
+ * Sorted by start line number.
+ * No two line ranges are touching or intersecting.
+ */
+ private readonly _normalizedRanges: LineRange[] = []
+ ) {
+ }
+
+ get ranges(): readonly LineRange[] {
+ return this._normalizedRanges;
+ }
+
+ addRange(range: LineRange): void {
+ if (range.length === 0) {
+ return;
+ }
+
+ // Idea: Find joinRange such that:
+ // replaceRange = _normalizedRanges.replaceRange(joinRange, range.joinAll(joinRange.map(idx => this._normalizedRanges[idx])))
+
+ // idx of first element that touches range or that is after range
+ const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);
+ // idx of element after { last element that touches range or that is before range }
+ const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;
+
+ if (joinRangeStartIdx === joinRangeEndIdxExclusive) {
+ // If there is no element that touches range, then joinRangeStartIdx === joinRangeEndIdxExclusive and that value is the index of the element after range
+ this._normalizedRanges.splice(joinRangeStartIdx, 0, range);
+ } else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {
+ // Else, there is an element that touches range and in this case it is both the first and last element. Thus we can replace it
+ const joinRange = this._normalizedRanges[joinRangeStartIdx];
+ this._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);
+ } else {
+ // First and last element are different - we need to replace the entire range
+ const joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);
+ this._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);
+ }
+ }
+
+ intersects(range: LineRange): boolean {
+ const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber < range.endLineNumberExclusive);
+ return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber;
+ }
+
+ getUnion(other: LineRangeSet): LineRangeSet {
+ if (this._normalizedRanges.length === 0) {
+ return other;
+ }
+ if (other._normalizedRanges.length === 0) {
+ return this;
+ }
+
+ const result: LineRange[] = [];
+ let i1 = 0;
+ let i2 = 0;
+ let current: LineRange | null = null;
+ while (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) {
+ let next: LineRange | null = null;
+ if (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {
+ const lineRange1 = this._normalizedRanges[i1];
+ const lineRange2 = other._normalizedRanges[i2];
+ if (lineRange1.startLineNumber < lineRange2.startLineNumber) {
+ next = lineRange1;
+ i1++;
+ } else {
+ next = lineRange2;
+ i2++;
+ }
+ } else if (i1 < this._normalizedRanges.length) {
+ next = this._normalizedRanges[i1];
+ i1++;
+ } else {
+ next = other._normalizedRanges[i2];
+ i2++;
+ }
+
+ if (current === null) {
+ current = next;
+ } else {
+ if (current.endLineNumberExclusive >= next.startLineNumber) {
+ // merge
+ current = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));
+ } else {
+ // push
+ result.push(current);
+ current = next;
+ }
+ }
+ }
+ if (current !== null) {
+ result.push(current);
+ }
+ return new LineRangeSet(result);
+ }
+
+ /**
+ * Subtracts all ranges in this set from `range` and returns the result.
+ */
+ subtractFrom(range: LineRange): LineRangeSet {
+ // idx of first element that touches range or that is after range
+ const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);
+ // idx of element after { last element that touches range or that is before range }
+ const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;
+
+ if (joinRangeStartIdx === joinRangeEndIdxExclusive) {
+ return new LineRangeSet([range]);
+ }
+
+ const result: LineRange[] = [];
+ let startLineNumber = range.startLineNumber;
+ for (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {
+ const r = this._normalizedRanges[i];
+ if (r.startLineNumber > startLineNumber) {
+ result.push(new LineRange(startLineNumber, r.startLineNumber));
+ }
+ startLineNumber = r.endLineNumberExclusive;
+ }
+ if (startLineNumber < range.endLineNumberExclusive) {
+ result.push(new LineRange(startLineNumber, range.endLineNumberExclusive));
+ }
+
+ return new LineRangeSet(result);
+ }
+
+ toString() {
+ return this._normalizedRanges.map(r => r.toString()).join(', ');
+ }
+
+ getIntersection(other: LineRangeSet): LineRangeSet {
+ const result: LineRange[] = [];
+
+ let i1 = 0;
+ let i2 = 0;
+ while (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {
+ const r1 = this._normalizedRanges[i1];
+ const r2 = other._normalizedRanges[i2];
+
+ const i = r1.intersect(r2);
+ if (i && !i.isEmpty) {
+ result.push(i);
+ }
+
+ if (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {
+ i1++;
+ } else {
+ i2++;
+ }
+ }
+
+ return new LineRangeSet(result);
+ }
+
+ getWithDelta(value: number): LineRangeSet {
+ return new LineRangeSet(this._normalizedRanges.map(r => r.delta(value)));
+ }
+}
diff --git a/src/vs/editor/common/core/offsetRange.ts b/src/vs/editor/common/core/offsetRange.ts
index 27e60bca2df..9173e5339bb 100644
--- a/src/vs/editor/common/core/offsetRange.ts
+++ b/src/vs/editor/common/core/offsetRange.ts
@@ -136,6 +136,14 @@ export class OffsetRange {
}
return value;
}
+
+ public map(f: (offset: number) => T): T[] {
+ const result: T[] = [];
+ for (let i = this.start; i < this.endExclusive; i++) {
+ result.push(f(i));
+ }
+ return result;
+ }
}
export class OffsetRangeSet {
diff --git a/src/vs/editor/common/diff/advancedLinesDiffComputer.ts b/src/vs/editor/common/diff/advancedLinesDiffComputer.ts
index a7d9605d78c..8720d8524ba 100644
--- a/src/vs/editor/common/diff/advancedLinesDiffComputer.ts
+++ b/src/vs/editor/common/diff/advancedLinesDiffComputer.ts
@@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-import { compareBy, equals, findLastIndex, numberComparator, reverseOrder } from 'vs/base/common/arrays';
+import { compareBy, equals, groupAdjacentBy, numberComparator, pushMany, reverseOrder } from 'vs/base/common/arrays';
import { assertFn, checkAdjacentItems } from 'vs/base/common/assert';
import { CharCode } from 'vs/base/common/charCode';
import { SetMap } from 'vs/base/common/collections';
-import { LineRange } from 'vs/editor/common/core/lineRange';
+import { LineRange, LineRangeSet } from 'vs/editor/common/core/lineRange';
import { OffsetRange } from 'vs/editor/common/core/offsetRange';
import { Position } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
@@ -15,7 +15,9 @@ import { DateTimeout, ISequence, ITimeout, InfiniteTimeout, SequenceDiff } from
import { DynamicProgrammingDiffing } from 'vs/editor/common/diff/algorithms/dynamicProgrammingDiffing';
import { optimizeSequenceDiffs, removeRandomLineMatches, removeRandomMatches, smoothenSequenceDiffs } from 'vs/editor/common/diff/algorithms/joinSequenceDiffs';
import { MyersDiffAlgorithm } from 'vs/editor/common/diff/algorithms/myersDiffAlgorithm';
-import { ILinesDiffComputer, ILinesDiffComputerOptions, LineRangeMapping, LinesDiff, MovedText, RangeMapping, SimpleLineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { ILinesDiffComputer, ILinesDiffComputerOptions, LinesDiff, MovedText } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping, LineRangeMapping, RangeMapping } from './rangeMapping';
+import { MonotonousArray, findLastIdxMonotonous, findLastMonotonous, findFirstMonotonous } from 'vs/base/common/arraysFind';
export class AdvancedLinesDiffComputer implements ILinesDiffComputer {
private readonly dynamicProgrammingDiffing = new DynamicProgrammingDiffing();
@@ -28,7 +30,7 @@ export class AdvancedLinesDiffComputer implements ILinesDiffComputer {
if (originalLines.length === 1 && originalLines[0].length === 0 || modifiedLines.length === 1 && modifiedLines[0].length === 0) {
return new LinesDiff([
- new LineRangeMapping(
+ new DetailedLineRangeMapping(
new LineRange(1, originalLines.length + 1),
new LineRange(1, modifiedLines.length + 1),
[
@@ -166,7 +168,7 @@ export class AdvancedLinesDiffComputer implements ILinesDiffComputer {
validatePosition(ic.originalRange.getStartPosition(), originalLines) && validatePosition(ic.originalRange.getEndPosition(), originalLines);
if (!valid) { return false; }
}
- if (!validateRange(c.modifiedRange, modifiedLines) || !validateRange(c.originalRange, originalLines)) {
+ if (!validateRange(c.modified, modifiedLines) || !validateRange(c.original, originalLines)) {
return false;
}
}
@@ -176,16 +178,94 @@ export class AdvancedLinesDiffComputer implements ILinesDiffComputer {
return new LinesDiff(changes, moves, hitTimeout);
}
- private computeMoves(changes: LineRangeMapping[], originalLines: string[], modifiedLines: string[], hashedOriginalLines: number[], hashedModifiedLines: number[], timeout: ITimeout, considerWhitespaceChanges: boolean): MovedText[] {
- const moves: SimpleLineRangeMapping[] = [];
- const deletions = changes
- .filter(c => c.modifiedRange.isEmpty && c.originalRange.length >= 3)
- .map(d => new LineRangeFragment(d.originalRange, originalLines, d));
- const insertions = new Set(changes
- .filter(c => c.originalRange.isEmpty && c.modifiedRange.length >= 3)
- .map(d => new LineRangeFragment(d.modifiedRange, modifiedLines, d)));
+ private computeMoves(
+ changes: DetailedLineRangeMapping[],
+ originalLines: string[],
+ modifiedLines: string[],
+ hashedOriginalLines: number[],
+ hashedModifiedLines: number[],
+ timeout: ITimeout,
+ considerWhitespaceChanges: boolean,
+ ): MovedText[] {
+ const { moves, excludedChanges } = this.computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout);
- const excludedChanges = new Set();
+ if (!timeout.isValid()) { return []; }
+
+ const unchangedMoves = this.computeUnchangedMoves(
+ changes.filter(c => !excludedChanges.has(c)),
+ hashedOriginalLines,
+ hashedModifiedLines,
+ timeout
+ );
+ pushMany(moves, unchangedMoves);
+
+ // join moves
+ moves.sort(compareBy(m => m.original.startLineNumber, numberComparator));
+ if (moves.length === 0) {
+ return [];
+ }
+ let joinedMoves = [moves[0]];
+ for (let i = 1; i < moves.length; i++) {
+ const last = joinedMoves[joinedMoves.length - 1];
+ const current = moves[i];
+
+ const originalDist = current.original.startLineNumber - last.original.endLineNumberExclusive;
+ const modifiedDist = current.modified.startLineNumber - last.modified.endLineNumberExclusive;
+ const currentMoveAfterLast = originalDist >= 0 && modifiedDist >= 0;
+
+ if (currentMoveAfterLast && originalDist + modifiedDist <= 2) {
+ joinedMoves[joinedMoves.length - 1] = last.join(current);
+ continue;
+ }
+
+ const originalText = current.original.toOffsetRange().slice(originalLines).map(l => l.trim()).join('\n');
+ if (originalText.length <= 10) {
+ // Ignore small moves
+ continue;
+ }
+ joinedMoves.push(current);
+ }
+
+ // Ignore non moves
+ const changesMonotonous = new MonotonousArray(changes);
+ joinedMoves = joinedMoves.filter(m => {
+ const diffBeforeOriginalMove = changesMonotonous.findLastMonotonous(c => c.original.endLineNumberExclusive <= m.original.startLineNumber)
+ || new LineRangeMapping(new LineRange(1, 1), new LineRange(1, 1));
+
+ const modifiedDistToPrevDiff = m.modified.startLineNumber - diffBeforeOriginalMove.modified.endLineNumberExclusive;
+ const originalDistToPrevDiff = m.original.startLineNumber - diffBeforeOriginalMove.original.endLineNumberExclusive;
+
+ const differentDistances = modifiedDistToPrevDiff !== originalDistToPrevDiff;
+ return differentDistances;
+ });
+
+ const movesWithDiffs = joinedMoves.map(m => {
+ const moveChanges = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(
+ m.original.toOffsetRange(),
+ m.modified.toOffsetRange(),
+ ), timeout, considerWhitespaceChanges);
+ const mappings = lineRangeMappingFromRangeMappings(moveChanges.mappings, originalLines, modifiedLines, true);
+ return new MovedText(m, mappings);
+ });
+ return movesWithDiffs;
+ }
+
+ private computeMovesFromSimpleDeletionsToSimpleInsertions(
+ changes: DetailedLineRangeMapping[],
+ originalLines: string[],
+ modifiedLines: string[],
+ timeout: ITimeout,
+ ) {
+ const moves: LineRangeMapping[] = [];
+
+ const deletions = changes
+ .filter(c => c.modified.isEmpty && c.original.length >= 3)
+ .map(d => new LineRangeFragment(d.original, originalLines, d));
+ const insertions = new Set(changes
+ .filter(c => c.original.isEmpty && c.modified.length >= 3)
+ .map(d => new LineRangeFragment(d.modified, modifiedLines, d)));
+
+ const excludedChanges = new Set();
for (const deletion of deletions) {
let highestSimilarity = -1;
@@ -200,24 +280,31 @@ export class AdvancedLinesDiffComputer implements ILinesDiffComputer {
if (highestSimilarity > 0.90 && best) {
insertions.delete(best);
- moves.push(new SimpleLineRangeMapping(deletion.range, best.range));
+ moves.push(new LineRangeMapping(deletion.range, best.range));
excludedChanges.add(deletion.source);
excludedChanges.add(best.source);
}
if (!timeout.isValid()) {
- return [];
+ return { moves, excludedChanges };
}
}
+ return { moves, excludedChanges };
+ }
+
+ private computeUnchangedMoves(
+ changes: DetailedLineRangeMapping[],
+ hashedOriginalLines: number[],
+ hashedModifiedLines: number[],
+ timeout: ITimeout,
+ ) {
+ const moves: LineRangeMapping[] = [];
+
const original3LineHashes = new SetMap();
for (const change of changes) {
- if (excludedChanges.has(change)) {
- continue;
- }
-
- for (let i = change.originalRange.startLineNumber; i < change.originalRange.endLineNumberExclusive - 2; i++) {
+ for (let i = change.original.startLineNumber; i < change.original.endLineNumberExclusive - 2; i++) {
const key = `${hashedOriginalLines[i - 1]}:${hashedOriginalLines[i + 1 - 1]}:${hashedOriginalLines[i + 2 - 1]}`;
original3LineHashes.add(key, { range: new LineRange(i, i + 3) });
}
@@ -230,15 +317,11 @@ export class AdvancedLinesDiffComputer implements ILinesDiffComputer {
const possibleMappings: PossibleMapping[] = [];
- changes.sort(compareBy(c => c.modifiedRange.startLineNumber, numberComparator));
+ changes.sort(compareBy(c => c.modified.startLineNumber, numberComparator));
for (const change of changes) {
- if (excludedChanges.has(change)) {
- continue;
- }
-
let lastMappings: PossibleMapping[] = [];
- for (let i = change.modifiedRange.startLineNumber; i < change.modifiedRange.endLineNumberExclusive - 2; i++) {
+ for (let i = change.modified.startLineNumber; i < change.modified.endLineNumberExclusive - 2; i++) {
const key = `${hashedModifiedLines[i - 1]}:${hashedModifiedLines[i + 1 - 1]}:${hashedModifiedLines[i + 2 - 1]}`;
const currentModifiedRange = new LineRange(i, i + 3);
@@ -279,60 +362,25 @@ export class AdvancedLinesDiffComputer implements ILinesDiffComputer {
const diffOrigToMod = mapping.modifiedLineRange.startLineNumber - mapping.originalLineRange.startLineNumber;
const modifiedSections = modifiedSet.subtractFrom(mapping.modifiedLineRange);
- const originalTranslatedSections = originalSet.subtractFrom(mapping.originalLineRange).map(r => r.delta(diffOrigToMod));
+ const originalTranslatedSections = originalSet.subtractFrom(mapping.originalLineRange).getWithDelta(diffOrigToMod);
- const modifiedIntersectedSections = intersectRanges(modifiedSections, originalTranslatedSections);
+ const modifiedIntersectedSections = modifiedSections.getIntersection(originalTranslatedSections);
- for (const s of modifiedIntersectedSections) {
+ for (const s of modifiedIntersectedSections.ranges) {
if (s.length < 3) {
continue;
}
const modifiedLineRange = s;
const originalLineRange = s.delta(-diffOrigToMod);
- moves.push(new SimpleLineRangeMapping(originalLineRange, modifiedLineRange));
+ moves.push(new LineRangeMapping(originalLineRange, modifiedLineRange));
modifiedSet.addRange(modifiedLineRange);
originalSet.addRange(originalLineRange);
}
}
- // join moves
- moves.sort(compareBy(m => m.original.startLineNumber, numberComparator));
- if (moves.length === 0) {
- return [];
- }
- const joinedMoves = [moves[0]];
- for (let i = 1; i < moves.length; i++) {
- const last = joinedMoves[joinedMoves.length - 1];
- const current = moves[i];
-
- const originalDist = current.original.startLineNumber - last.original.endLineNumberExclusive;
- const modifiedDist = current.modified.startLineNumber - last.modified.endLineNumberExclusive;
- const currentMoveAfterLast = originalDist >= 0 && modifiedDist >= 0;
-
- if (currentMoveAfterLast && originalDist + modifiedDist <= 2) {
- joinedMoves[joinedMoves.length - 1] = last.join(current);
- continue;
- }
-
- const originalText = current.original.toOffsetRange().slice(originalLines).map(l => l.trim()).join('\n');
- if (originalText.length <= 10) {
- // Ignore small moves
- continue;
- }
- joinedMoves.push(current);
- }
-
- const fullMoves = joinedMoves.map(m => {
- const moveChanges = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(
- m.original.toOffsetRange(),
- m.modified.toOffsetRange(),
- ), timeout, considerWhitespaceChanges);
- const mappings = lineRangeMappingFromRangeMappings(moveChanges.mappings, originalLines, modifiedLines, true);
- return new MovedText(m, mappings);
- });
- return fullMoves;
+ return moves;
}
private refineDiff(originalLines: string[], modifiedLines: string[], diff: SequenceDiff, timeout: ITimeout, considerWhitespaceChanges: boolean): { mappings: RangeMapping[]; hitTimeout: boolean } {
@@ -366,100 +414,6 @@ export class AdvancedLinesDiffComputer implements ILinesDiffComputer {
}
}
-function intersectRanges(ranges1: LineRange[], ranges2: LineRange[]): LineRange[] {
- const result: LineRange[] = [];
-
- let i1 = 0;
- let i2 = 0;
- while (i1 < ranges1.length && i2 < ranges2.length) {
- const r1 = ranges1[i1];
- const r2 = ranges2[i2];
-
- const i = r1.intersect(r2);
- if (i && !i.isEmpty) {
- result.push(i);
- }
-
- if (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {
- i1++;
- } else {
- i2++;
- }
- }
-
- return result;
-}
-
-// TODO make this fast
-class LineRangeSet {
- private readonly _normalizedRanges: LineRange[] = [];
-
- addRange(range: LineRange): void {
- // Idea: Find joinRange such that:
- // replaceRange = _normalizedRanges.replaceRange(joinRange, range.joinAll(joinRange.map(idx => this._normalizedRanges[idx])))
-
- // idx of first element that touches range or that is after range
- const joinRangeStartIdx = mapMinusOne(this._normalizedRanges.findIndex(r => r.endLineNumberExclusive >= range.startLineNumber), this._normalizedRanges.length);
- // idx of element after { last element that touches range or that is before range }
- const joinRangeEndIdxExclusive = findLastIndex(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;
-
- if (joinRangeStartIdx === joinRangeEndIdxExclusive) {
- // If there is no element that touches range, then joinRangeStartIdx === joinRangeEndIdxExclusive and that value is the index of the element after range
- this._normalizedRanges.splice(joinRangeStartIdx, 0, range);
- } else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {
- // Else, there is an element that touches range and in this case it is both the first and last element. Thus we can replace it
- const joinRange = this._normalizedRanges[joinRangeStartIdx];
- this._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);
- } else {
- // First and last element are different - we need to replace the entire range
- const joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);
- this._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);
- }
- }
-
- intersects(range: LineRange): boolean {
- for (const r of this._normalizedRanges) {
- if (r.intersectsStrict(range)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Subtracts all ranges in this set from `range` and returns the result.
- */
- subtractFrom(range: LineRange): LineRange[] {
- // idx of first element that touches range or that is after range
- const joinRangeStartIdx = mapMinusOne(this._normalizedRanges.findIndex(r => r.endLineNumberExclusive >= range.startLineNumber), this._normalizedRanges.length);
- // idx of element after { last element that touches range or that is before range }
- const joinRangeEndIdxExclusive = findLastIndex(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;
-
- if (joinRangeStartIdx === joinRangeEndIdxExclusive) {
- return [range];
- }
-
- const result: LineRange[] = [];
- let startLineNumber = range.startLineNumber;
- for (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {
- const r = this._normalizedRanges[i];
- if (r.startLineNumber > startLineNumber) {
- result.push(new LineRange(startLineNumber, r.startLineNumber));
- }
- startLineNumber = r.endLineNumberExclusive;
- }
- if (startLineNumber < range.endLineNumberExclusive) {
- result.push(new LineRange(startLineNumber, range.endLineNumberExclusive));
- }
-
- return result;
- }
-}
-
-function mapMinusOne(idx: number, mapTo: number): number {
- return idx === -1 ? mapTo : idx;
-}
-
function coverFullWords(sequence1: LinesSliceCharSequence, sequence2: LinesSliceCharSequence, sequenceDiffs: SequenceDiff[]): SequenceDiff[] {
const additional: SequenceDiff[] = [];
@@ -555,42 +509,42 @@ function mergeSequenceDiffs(sequenceDiffs1: SequenceDiff[], sequenceDiffs2: Sequ
return result;
}
-export function lineRangeMappingFromRangeMappings(alignments: RangeMapping[], originalLines: string[], modifiedLines: string[], dontAssertStartLine: boolean = false): LineRangeMapping[] {
- const changes: LineRangeMapping[] = [];
- for (const g of group(
+export function lineRangeMappingFromRangeMappings(alignments: RangeMapping[], originalLines: string[], modifiedLines: string[], dontAssertStartLine: boolean = false): DetailedLineRangeMapping[] {
+ const changes: DetailedLineRangeMapping[] = [];
+ for (const g of groupAdjacentBy(
alignments.map(a => getLineRangeMapping(a, originalLines, modifiedLines)),
(a1, a2) =>
- a1.originalRange.overlapOrTouch(a2.originalRange)
- || a1.modifiedRange.overlapOrTouch(a2.modifiedRange)
+ a1.original.overlapOrTouch(a2.original)
+ || a1.modified.overlapOrTouch(a2.modified)
)) {
const first = g[0];
const last = g[g.length - 1];
- changes.push(new LineRangeMapping(
- first.originalRange.join(last.originalRange),
- first.modifiedRange.join(last.modifiedRange),
+ changes.push(new DetailedLineRangeMapping(
+ first.original.join(last.original),
+ first.modified.join(last.modified),
g.map(a => a.innerChanges![0]),
));
}
assertFn(() => {
if (!dontAssertStartLine) {
- if (changes.length > 0 && changes[0].originalRange.startLineNumber !== changes[0].modifiedRange.startLineNumber) {
+ if (changes.length > 0 && changes[0].original.startLineNumber !== changes[0].modified.startLineNumber) {
return false;
}
}
return checkAdjacentItems(changes,
- (m1, m2) => m2.originalRange.startLineNumber - m1.originalRange.endLineNumberExclusive === m2.modifiedRange.startLineNumber - m1.modifiedRange.endLineNumberExclusive &&
+ (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive &&
// There has to be an unchanged line in between (otherwise both diffs should have been joined)
- m1.originalRange.endLineNumberExclusive < m2.originalRange.startLineNumber &&
- m1.modifiedRange.endLineNumberExclusive < m2.modifiedRange.startLineNumber,
+ m1.original.endLineNumberExclusive < m2.original.startLineNumber &&
+ m1.modified.endLineNumberExclusive < m2.modified.startLineNumber,
);
});
return changes;
}
-export function getLineRangeMapping(rangeMapping: RangeMapping, originalLines: string[], modifiedLines: string[]): LineRangeMapping {
+export function getLineRangeMapping(rangeMapping: RangeMapping, originalLines: string[], modifiedLines: string[]): DetailedLineRangeMapping {
let lineStartDelta = 0;
let lineEndDelta = 0;
@@ -624,26 +578,7 @@ export function getLineRangeMapping(rangeMapping: RangeMapping, originalLines: s
rangeMapping.modifiedRange.endLineNumber + 1 + lineEndDelta
);
- return new LineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]);
-}
-
-function* group(items: Iterable, shouldBeGrouped: (item1: T, item2: T) => boolean): Iterable {
- let currentGroup: T[] | undefined;
- let last: T | undefined;
- for (const item of items) {
- if (last !== undefined && shouldBeGrouped(last, item)) {
- currentGroup!.push(item);
- } else {
- if (currentGroup) {
- yield currentGroup;
- }
- currentGroup = [item];
- }
- last = item;
- }
- if (currentGroup) {
- yield currentGroup;
- }
+ return new DetailedLineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]);
}
export class LineSequence implements ISequence {
@@ -685,7 +620,7 @@ function getIndentation(str: string): number {
export class LinesSliceCharSequence implements ISequence {
private readonly elements: number[] = [];
- private readonly firstCharOffsetByLineMinusOne: number[] = [];
+ private readonly firstCharOffsetByLine: number[] = [];
public readonly lineRange: OffsetRange;
// To account for trimming
private readonly additionalOffsetByLine: number[] = [];
@@ -703,6 +638,7 @@ export class LinesSliceCharSequence implements ISequence {
this.lineRange = lineRange;
+ this.firstCharOffsetByLine[0] = 0;
for (let i = this.lineRange.start; i < this.lineRange.endExclusive; i++) {
let line = lines[i];
let offset = 0;
@@ -725,7 +661,7 @@ export class LinesSliceCharSequence implements ISequence {
// Don't add an \n that does not exist in the document.
if (i < lines.length - 1) {
this.elements.push('\n'.charCodeAt(0));
- this.firstCharOffsetByLineMinusOne[i - this.lineRange.start] = this.elements.length;
+ this.firstCharOffsetByLine[i - this.lineRange.start + 1] = this.elements.length;
}
}
// To account for the last line
@@ -784,19 +720,8 @@ export class LinesSliceCharSequence implements ISequence {
return new Position(this.lineRange.start + 1, 1);
}
- let i = 0;
- let j = this.firstCharOffsetByLineMinusOne.length;
- while (i < j) {
- const k = Math.floor((i + j) / 2);
- if (this.firstCharOffsetByLineMinusOne[k] > offset) {
- j = k;
- } else {
- i = k + 1;
- }
- }
-
- const offsetOfFirstCharInLine = i === 0 ? 0 : this.firstCharOffsetByLineMinusOne[i - 1];
- return new Position(this.lineRange.start + i + 1, offset - offsetOfFirstCharInLine + 1 + this.additionalOffsetByLine[i]);
+ const i = findLastIdxMonotonous(this.firstCharOffsetByLine, (value) => value <= offset);
+ return new Position(this.lineRange.start + i + 1, offset - this.firstCharOffsetByLine[i] + this.additionalOffsetByLine[i] + 1);
}
public translateRange(range: OffsetRange): Range {
@@ -839,49 +764,12 @@ export class LinesSliceCharSequence implements ISequence {
}
public extendToFullLines(range: OffsetRange): OffsetRange {
- const firstIdx = findLastIdxMonotonous(this.firstCharOffsetByLineMinusOne, x => x <= range.start);
- const lastIdx = findFirstIdxMonotonous(this.firstCharOffsetByLineMinusOne, x => range.endExclusive <= x);
-
- const start = firstIdx === -1 ? 0 : this.firstCharOffsetByLineMinusOne[firstIdx];
- const end = lastIdx === this.firstCharOffsetByLineMinusOne.length ? this.elements.length : this.firstCharOffsetByLineMinusOne[lastIdx];
+ const start = findLastMonotonous(this.firstCharOffsetByLine, x => x <= range.start) ?? 0;
+ const end = findFirstMonotonous(this.firstCharOffsetByLine, x => range.endExclusive <= x) ?? this.elements.length;
return new OffsetRange(start, end);
}
}
-/**
- * @returns -1 if predicate is false for all items
- */
-function findLastIdxMonotonous(arr: T[], predicate: (item: T) => boolean): number {
- let i = 0;
- let j = arr.length;
- while (i < j) {
- const k = Math.floor((i + j) / 2);
- if (predicate(arr[k])) {
- i = k + 1;
- } else {
- j = k;
- }
- }
- return i - 1;
-}
-
-/**
- * @returns arr.length if predicate is false for all items
- */
-function findFirstIdxMonotonous(arr: T[], predicate: (item: T) => boolean): number {
- let i = 0;
- let j = arr.length;
- while (i < j) {
- const k = Math.floor((i + j) / 2);
- if (predicate(arr[k])) {
- j = k;
- } else {
- i = k + 1;
- }
- }
- return i;
-}
-
function isWordChar(charCode: number): boolean {
return charCode >= CharCode.a && charCode <= CharCode.z
|| charCode >= CharCode.A && charCode <= CharCode.Z
@@ -954,7 +842,7 @@ class LineRangeFragment {
constructor(
public readonly range: LineRange,
public readonly lines: string[],
- public readonly source: LineRangeMapping,
+ public readonly source: DetailedLineRangeMapping,
) {
let counter = 0;
for (let i = range.startLineNumber - 1; i < range.endLineNumberExclusive - 1; i++) {
diff --git a/src/vs/editor/common/diff/documentDiffProvider.ts b/src/vs/editor/common/diff/documentDiffProvider.ts
index 02907dddca3..44accf9e604 100644
--- a/src/vs/editor/common/diff/documentDiffProvider.ts
+++ b/src/vs/editor/common/diff/documentDiffProvider.ts
@@ -5,7 +5,8 @@
import { CancellationToken } from 'vs/base/common/cancellation';
import { Event } from 'vs/base/common/event';
-import { LineRangeMapping, MovedText } from 'vs/editor/common/diff/linesDiffComputer';
+import { MovedText } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from './rangeMapping';
import { ITextModel } from 'vs/editor/common/model';
/**
@@ -61,7 +62,7 @@ export interface IDocumentDiff {
/**
* Maps all modified line ranges in the original to the corresponding line ranges in the modified text model.
*/
- readonly changes: readonly LineRangeMapping[];
+ readonly changes: readonly DetailedLineRangeMapping[];
/**
* Sorted by original line ranges.
diff --git a/src/vs/editor/common/diff/legacyLinesDiffComputer.ts b/src/vs/editor/common/diff/legacyLinesDiffComputer.ts
index 5ea6524a41e..8d7e05e0308 100644
--- a/src/vs/editor/common/diff/legacyLinesDiffComputer.ts
+++ b/src/vs/editor/common/diff/legacyLinesDiffComputer.ts
@@ -5,7 +5,8 @@
import { CharCode } from 'vs/base/common/charCode';
import { IDiffChange, ISequence, LcsDiff, IDiffResult } from 'vs/base/common/diff/diff';
-import { ILinesDiffComputer, ILinesDiffComputerOptions, RangeMapping, LineRangeMapping, LinesDiff } from 'vs/editor/common/diff/linesDiffComputer';
+import { ILinesDiffComputer, ILinesDiffComputerOptions, LinesDiff } from 'vs/editor/common/diff/linesDiffComputer';
+import { RangeMapping, DetailedLineRangeMapping } from './rangeMapping';
import * as strings from 'vs/base/common/strings';
import { Range } from 'vs/editor/common/core/range';
import { assertFn, checkAdjacentItems } from 'vs/base/common/assert';
@@ -23,8 +24,8 @@ export class LegacyLinesDiffComputer implements ILinesDiffComputer {
shouldPostProcessCharChanges: true,
});
const result = diffComputer.computeDiff();
- const changes: LineRangeMapping[] = [];
- let lastChange: LineRangeMapping | null = null;
+ const changes: DetailedLineRangeMapping[] = [];
+ let lastChange: DetailedLineRangeMapping | null = null;
for (const c of result.changes) {
@@ -44,17 +45,17 @@ export class LegacyLinesDiffComputer implements ILinesDiffComputer {
modifiedRange = new LineRange(c.modifiedStartLineNumber, c.modifiedEndLineNumber + 1);
}
- let change = new LineRangeMapping(originalRange, modifiedRange, c.charChanges?.map(c => new RangeMapping(
+ let change = new DetailedLineRangeMapping(originalRange, modifiedRange, c.charChanges?.map(c => new RangeMapping(
new Range(c.originalStartLineNumber, c.originalStartColumn, c.originalEndLineNumber, c.originalEndColumn),
new Range(c.modifiedStartLineNumber, c.modifiedStartColumn, c.modifiedEndLineNumber, c.modifiedEndColumn),
)));
if (lastChange) {
- if (lastChange.modifiedRange.endLineNumberExclusive === change.modifiedRange.startLineNumber
- || lastChange.originalRange.endLineNumberExclusive === change.originalRange.startLineNumber) {
+ if (lastChange.modified.endLineNumberExclusive === change.modified.startLineNumber
+ || lastChange.original.endLineNumberExclusive === change.original.startLineNumber) {
// join touching diffs. Probably moving diffs up/down in the algorithm causes touching diffs.
- change = new LineRangeMapping(
- lastChange.originalRange.join(change.originalRange),
- lastChange.modifiedRange.join(change.modifiedRange),
+ change = new DetailedLineRangeMapping(
+ lastChange.original.join(change.original),
+ lastChange.modified.join(change.modified),
lastChange.innerChanges && change.innerChanges ?
lastChange.innerChanges.concat(change.innerChanges) : undefined
);
@@ -68,10 +69,10 @@ export class LegacyLinesDiffComputer implements ILinesDiffComputer {
assertFn(() => {
return checkAdjacentItems(changes,
- (m1, m2) => m2.originalRange.startLineNumber - m1.originalRange.endLineNumberExclusive === m2.modifiedRange.startLineNumber - m1.modifiedRange.endLineNumberExclusive &&
+ (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive &&
// There has to be an unchanged line in between (otherwise both diffs should have been joined)
- m1.originalRange.endLineNumberExclusive < m2.originalRange.startLineNumber &&
- m1.modifiedRange.endLineNumberExclusive < m2.modifiedRange.startLineNumber,
+ m1.original.endLineNumberExclusive < m2.original.startLineNumber &&
+ m1.modified.endLineNumberExclusive < m2.modified.startLineNumber,
);
});
@@ -92,7 +93,7 @@ export interface IDiffComputationResult {
/**
* The changes as (modern) line range mapping array.
*/
- changes2: readonly LineRangeMapping[];
+ changes2: readonly DetailedLineRangeMapping[];
}
/**
diff --git a/src/vs/editor/common/diff/linesDiffComputer.ts b/src/vs/editor/common/diff/linesDiffComputer.ts
index d10888cb93f..a11674f0127 100644
--- a/src/vs/editor/common/diff/linesDiffComputer.ts
+++ b/src/vs/editor/common/diff/linesDiffComputer.ts
@@ -3,8 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-import { LineRange } from 'vs/editor/common/core/lineRange';
-import { Range } from 'vs/editor/common/core/range';
+import { DetailedLineRangeMapping, LineRangeMapping } from './rangeMapping';
export interface ILinesDiffComputer {
computeDiff(originalLines: string[], modifiedLines: string[], options: ILinesDiffComputerOptions): LinesDiff;
@@ -18,7 +17,7 @@ export interface ILinesDiffComputerOptions {
export class LinesDiff {
constructor(
- readonly changes: readonly LineRangeMapping[],
+ readonly changes: readonly DetailedLineRangeMapping[],
/**
* Sorted by original line ranges.
@@ -35,148 +34,19 @@ export class LinesDiff {
}
}
-/**
- * Maps a line range in the original text model to a line range in the modified text model.
- */
-export class LineRangeMapping {
- public static inverse(mapping: readonly LineRangeMapping[], originalLineCount: number, modifiedLineCount: number): LineRangeMapping[] {
- const result: LineRangeMapping[] = [];
- let lastOriginalEndLineNumber = 1;
- let lastModifiedEndLineNumber = 1;
-
- for (const m of mapping) {
- const r = new LineRangeMapping(
- new LineRange(lastOriginalEndLineNumber, m.originalRange.startLineNumber),
- new LineRange(lastModifiedEndLineNumber, m.modifiedRange.startLineNumber),
- undefined
- );
- if (!r.modifiedRange.isEmpty) {
- result.push(r);
- }
- lastOriginalEndLineNumber = m.originalRange.endLineNumberExclusive;
- lastModifiedEndLineNumber = m.modifiedRange.endLineNumberExclusive;
- }
- const r = new LineRangeMapping(
- new LineRange(lastOriginalEndLineNumber, originalLineCount + 1),
- new LineRange(lastModifiedEndLineNumber, modifiedLineCount + 1),
- undefined
- );
- if (!r.modifiedRange.isEmpty) {
- result.push(r);
- }
- return result;
- }
-
- /**
- * The line range in the original text model.
- */
- public readonly originalRange: LineRange;
-
- /**
- * The line range in the modified text model.
- */
- public readonly modifiedRange: LineRange;
-
- /**
- * If inner changes have not been computed, this is set to undefined.
- * Otherwise, it represents the character-level diff in this line range.
- * The original range of each range mapping should be contained in the original line range (same for modified), exceptions are new-lines.
- * Must not be an empty array.
- */
- public readonly innerChanges: RangeMapping[] | undefined;
-
- constructor(
- originalRange: LineRange,
- modifiedRange: LineRange,
- innerChanges: RangeMapping[] | undefined,
- ) {
- this.originalRange = originalRange;
- this.modifiedRange = modifiedRange;
- this.innerChanges = innerChanges;
- }
-
- public toString(): string {
- return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;
- }
-
- public get changedLineCount() {
- return Math.max(this.originalRange.length, this.modifiedRange.length);
- }
-
- public flip(): LineRangeMapping {
- return new LineRangeMapping(this.modifiedRange, this.originalRange, this.innerChanges?.map(c => c.flip()));
- }
-}
-
-/**
- * Maps a range in the original text model to a range in the modified text model.
- */
-export class RangeMapping {
- /**
- * The original range.
- */
- readonly originalRange: Range;
-
- /**
- * The modified range.
- */
- readonly modifiedRange: Range;
-
- constructor(
- originalRange: Range,
-
- modifiedRange: Range,
- ) {
- this.originalRange = originalRange;
- this.modifiedRange = modifiedRange;
- }
-
- public toString(): string {
- return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;
- }
-
- public flip(): RangeMapping {
- return new RangeMapping(this.modifiedRange, this.originalRange);
- }
-}
-
-// TODO@hediet: Make LineRangeMapping extend from this!
-export class SimpleLineRangeMapping {
- constructor(
- public readonly original: LineRange,
- public readonly modified: LineRange,
- ) {
- }
-
- public toString(): string {
- return `{${this.original.toString()}->${this.modified.toString()}}`;
- }
-
- public flip(): SimpleLineRangeMapping {
- return new SimpleLineRangeMapping(this.modified, this.original);
- }
-
- public join(other: SimpleLineRangeMapping): SimpleLineRangeMapping {
- return new SimpleLineRangeMapping(
- this.original.join(other.original),
- this.modified.join(other.modified),
- );
- }
-}
-
export class MovedText {
- public readonly lineRangeMapping: SimpleLineRangeMapping;
+ public readonly lineRangeMapping: LineRangeMapping;
/**
* The diff from the original text to the moved text.
* Must be contained in the original/modified line range.
* Can be empty if the text didn't change (only moved).
*/
- public readonly changes: readonly LineRangeMapping[];
+ public readonly changes: readonly DetailedLineRangeMapping[];
constructor(
- lineRangeMapping: SimpleLineRangeMapping,
- changes: readonly LineRangeMapping[],
+ lineRangeMapping: LineRangeMapping,
+ changes: readonly DetailedLineRangeMapping[],
) {
this.lineRangeMapping = lineRangeMapping;
this.changes = changes;
diff --git a/src/vs/editor/common/diff/rangeMapping.ts b/src/vs/editor/common/diff/rangeMapping.ts
new file mode 100644
index 00000000000..12ac2a362e9
--- /dev/null
+++ b/src/vs/editor/common/diff/rangeMapping.ts
@@ -0,0 +1,133 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import { LineRange } from 'vs/editor/common/core/lineRange';
+import { Range } from 'vs/editor/common/core/range';
+
+export class LineRangeMapping {
+ public static inverse(mapping: readonly DetailedLineRangeMapping[], originalLineCount: number, modifiedLineCount: number): DetailedLineRangeMapping[] {
+ const result: DetailedLineRangeMapping[] = [];
+ let lastOriginalEndLineNumber = 1;
+ let lastModifiedEndLineNumber = 1;
+
+ for (const m of mapping) {
+ const r = new DetailedLineRangeMapping(
+ new LineRange(lastOriginalEndLineNumber, m.original.startLineNumber),
+ new LineRange(lastModifiedEndLineNumber, m.modified.startLineNumber),
+ undefined
+ );
+ if (!r.modified.isEmpty) {
+ result.push(r);
+ }
+ lastOriginalEndLineNumber = m.original.endLineNumberExclusive;
+ lastModifiedEndLineNumber = m.modified.endLineNumberExclusive;
+ }
+ const r = new DetailedLineRangeMapping(
+ new LineRange(lastOriginalEndLineNumber, originalLineCount + 1),
+ new LineRange(lastModifiedEndLineNumber, modifiedLineCount + 1),
+ undefined
+ );
+ if (!r.modified.isEmpty) {
+ result.push(r);
+ }
+ return result;
+ }
+
+ /**
+ * The line range in the original text model.
+ */
+ public readonly original: LineRange;
+
+ /**
+ * The line range in the modified text model.
+ */
+ public readonly modified: LineRange;
+
+ constructor(
+ originalRange: LineRange,
+ modifiedRange: LineRange
+ ) {
+ this.original = originalRange;
+ this.modified = modifiedRange;
+ }
+
+
+ public toString(): string {
+ return `{${this.original.toString()}->${this.modified.toString()}}`;
+ }
+
+ public flip(): LineRangeMapping {
+ return new LineRangeMapping(this.modified, this.original);
+ }
+
+ public join(other: LineRangeMapping): LineRangeMapping {
+ return new LineRangeMapping(
+ this.original.join(other.original),
+ this.modified.join(other.modified)
+ );
+ }
+
+ public get changedLineCount() {
+ return Math.max(this.original.length, this.modified.length);
+ }
+}
+
+/**
+ * Maps a line range in the original text model to a line range in the modified text model.
+ */
+export class DetailedLineRangeMapping extends LineRangeMapping {
+ /**
+ * If inner changes have not been computed, this is set to undefined.
+ * Otherwise, it represents the character-level diff in this line range.
+ * The original range of each range mapping should be contained in the original line range (same for modified), exceptions are new-lines.
+ * Must not be an empty array.
+ */
+ public readonly innerChanges: RangeMapping[] | undefined;
+
+ constructor(
+ originalRange: LineRange,
+ modifiedRange: LineRange,
+ innerChanges: RangeMapping[] | undefined
+ ) {
+ super(originalRange, modifiedRange);
+ this.innerChanges = innerChanges;
+ }
+
+ public override flip(): DetailedLineRangeMapping {
+ return new DetailedLineRangeMapping(this.modified, this.original, this.innerChanges?.map(c => c.flip()));
+ }
+}
+
+/**
+ * Maps a range in the original text model to a range in the modified text model.
+ */
+export class RangeMapping {
+ /**
+ * The original range.
+ */
+ readonly originalRange: Range;
+
+ /**
+ * The modified range.
+ */
+ readonly modifiedRange: Range;
+
+ constructor(
+ originalRange: Range,
+
+ modifiedRange: Range
+ ) {
+ this.originalRange = originalRange;
+ this.modifiedRange = modifiedRange;
+ }
+
+ public toString(): string {
+ return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;
+ }
+
+ public flip(): RangeMapping {
+ return new RangeMapping(this.modifiedRange, this.originalRange);
+ }
+}
diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts
index ca8364f62d3..335e6b5c883 100644
--- a/src/vs/editor/common/services/editorSimpleWorker.ts
+++ b/src/vs/editor/common/services/editorSimpleWorker.ts
@@ -21,7 +21,8 @@ import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost';
import { StopWatch } from 'vs/base/common/stopwatch';
import { UnicodeTextModelHighlighter, UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeTextModelHighlighter';
import { DiffComputer, IChange } from 'vs/editor/common/diff/legacyLinesDiffComputer';
-import { ILinesDiffComputer, ILinesDiffComputerOptions, LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { ILinesDiffComputer, ILinesDiffComputerOptions } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from '../diff/rangeMapping';
import { linesDiffComputers } from 'vs/editor/common/diff/linesDiffComputers';
import { createProxyObject, getAllMethodNames } from 'vs/base/common/objects';
import { IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider';
@@ -422,8 +423,8 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable {
const identical = (result.changes.length > 0 ? false : this._modelsAreIdentical(originalTextModel, modifiedTextModel));
- function getLineChanges(changes: readonly LineRangeMapping[]): ILineChange[] {
- return changes.map(m => ([m.originalRange.startLineNumber, m.originalRange.endLineNumberExclusive, m.modifiedRange.startLineNumber, m.modifiedRange.endLineNumberExclusive, m.innerChanges?.map(m => [
+ function getLineChanges(changes: readonly DetailedLineRangeMapping[]): ILineChange[] {
+ return changes.map(m => ([m.original.startLineNumber, m.original.endLineNumberExclusive, m.modified.startLineNumber, m.modified.endLineNumberExclusive, m.innerChanges?.map(m => [
m.originalRange.startLineNumber,
m.originalRange.startColumn,
m.originalRange.endLineNumber,
diff --git a/src/vs/editor/common/standaloneStrings.ts b/src/vs/editor/common/standaloneStrings.ts
index 87a6d066017..1f9525d2024 100644
--- a/src/vs/editor/common/standaloneStrings.ts
+++ b/src/vs/editor/common/standaloneStrings.ts
@@ -10,17 +10,17 @@ export namespace AccessibilityHelpNLS {
export const openingDocs = nls.localize("openingDocs", "Now opening the Accessibility documentation page.");
export const readonlyDiffEditor = nls.localize("readonlyDiffEditor", "You are in a read-only pane of a diff editor.");
export const editableDiffEditor = nls.localize("editableDiffEditor", "You are in a pane of a diff editor.");
- export const readonlyEditor = nls.localize("readonlyEditor", "You are in a read-only code editor");
- export const editableEditor = nls.localize("editableEditor", "You are in a code editor");
+ export const readonlyEditor = nls.localize("readonlyEditor", "You are in a read-only code editor.");
+ export const editableEditor = nls.localize("editableEditor", "You are in a code editor.");
export const changeConfigToOnMac = nls.localize("changeConfigToOnMac", "To configure the application to be optimized for usage with a Screen Reader press Command+E now.");
export const changeConfigToOnWinLinux = nls.localize("changeConfigToOnWinLinux", "To configure the application to be optimized for usage with a Screen Reader press Control+E now.");
export const auto_on = nls.localize("auto_on", "The application is configured to be optimized for usage with a Screen Reader.");
- export const auto_off = nls.localize("auto_off", "The application is configured to never be optimized for usage with a Screen Reader");
+ export const auto_off = nls.localize("auto_off", "The application is configured to never be optimized for usage with a Screen Reader.");
export const screenReaderModeEnabled = nls.localize("screenReaderModeEnabled", "Screen Reader Optimized Mode enabled.");
export const screenReaderModeDisabled = nls.localize("screenReaderModeDisabled", "Screen Reader Optimized Mode disabled.");
export const tabFocusModeOnMsg = nls.localize("tabFocusModeOnMsg", "Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}.");
export const tabFocusModeOnMsgNoKb = nls.localize("tabFocusModeOnMsgNoKb", "Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding.");
- export const stickScrollKb = nls.localize("stickScrollKb", "Run the command: Focus Sticky Scroll ({0}) to focus the currently nested scopes");
+ export const stickScrollKb = nls.localize("stickScrollKb", "Run the command: Focus Sticky Scroll ({0}) to focus the currently nested scopes.");
export const stickScrollNoKb = nls.localize("stickScrollNoKb", "Run the command: Focus Sticky Scroll to focus the currently nested scopes. It is currently not triggerable by a keybinding.");
export const tabFocusModeOffMsg = nls.localize("tabFocusModeOffMsg", "Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}.");
export const tabFocusModeOffMsgNoKb = nls.localize("tabFocusModeOffMsgNoKb", "Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding.");
diff --git a/src/vs/editor/common/viewModel.ts b/src/vs/editor/common/viewModel.ts
index e61ba01dc15..4e4b4d3032f 100644
--- a/src/vs/editor/common/viewModel.ts
+++ b/src/vs/editor/common/viewModel.ts
@@ -445,4 +445,16 @@ export class OverviewRulerDecorationsGroup {
}
return a.zIndex - b.zIndex;
}
+
+ public static equalsArr(a: OverviewRulerDecorationsGroup[], b: OverviewRulerDecorationsGroup[]): boolean {
+ if (a.length !== b.length) {
+ return false;
+ }
+ for (let i = 0, len = a.length; i < len; i++) {
+ if (OverviewRulerDecorationsGroup.cmp(a[i], b[i]) !== 0) {
+ return false;
+ }
+ }
+ return true;
+ }
}
diff --git a/src/vs/editor/contrib/codelens/browser/codelensController.ts b/src/vs/editor/contrib/codelens/browser/codelensController.ts
index 4fd3619fb51..da810c9a099 100644
--- a/src/vs/editor/contrib/codelens/browser/codelensController.ts
+++ b/src/vs/editor/contrib/codelens/browser/codelensController.ts
@@ -232,6 +232,9 @@ export class CodeLensContribution implements IEditorContribution {
this._localToDispose.add(this._editor.onDidFocusEditorWidget(() => {
scheduler.schedule();
}));
+ this._localToDispose.add(this._editor.onDidBlurEditorText(() => {
+ scheduler.cancel();
+ }));
this._localToDispose.add(this._editor.onDidScrollChange(e => {
if (e.scrollTopChanged && this._lenses.length > 0) {
this._resolveCodeLensesInViewportSoon();
@@ -444,8 +447,12 @@ export class CodeLensContribution implements IEditorContribution {
});
}
- getModel(): CodeLensModel | undefined {
- return this._currentCodeLensModel;
+ async getModel(): Promise {
+ await this._getCodeLensModelPromise;
+ await this._resolveCodeLensesPromise;
+ return !this._currentCodeLensModel?.isDisposed
+ ? this._currentCodeLensModel
+ : undefined;
}
}
@@ -478,7 +485,7 @@ registerEditorAction(class ShowLensesInCurrentLine extends EditorAction {
return;
}
- const model = codelensController.getModel();
+ const model = await codelensController.getModel();
if (!model) {
// nothing
return;
@@ -499,19 +506,31 @@ registerEditorAction(class ShowLensesInCurrentLine extends EditorAction {
return;
}
- const item = await quickInputService.pick(items, { canPickMany: false });
+ const item = await quickInputService.pick(items, {
+ canPickMany: false,
+ placeHolder: localize('placeHolder', "Select a command")
+ });
if (!item) {
// Nothing picked
return;
}
+ let command = item.command;
+
if (model.isDisposed) {
- // retry whenever the model has been disposed
- return await commandService.executeCommand(this.id);
+ // try to find the same command again in-case the model has been re-created in the meantime
+ // this is a best attempt approach which shouldn't be needed because eager model re-creates
+ // shouldn't happen due to focus in/out anymore
+ const newModel = await codelensController.getModel();
+ const newLens = newModel?.lenses.find(lens => lens.symbol.range.startLineNumber === lineNumber && lens.symbol.command?.title === command.title);
+ if (!newLens || !newLens.symbol.command) {
+ return;
+ }
+ command = newLens.symbol.command;
}
try {
- await commandService.executeCommand(item.command.id, ...(item.command.arguments || []));
+ await commandService.executeCommand(command.id, ...(command.arguments || []));
} catch (err) {
notificationService.error(err);
}
diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css b/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css
index 212fbb7a050..b446742a2db 100644
--- a/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css
+++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css
@@ -35,6 +35,7 @@
.monaco-editor .sticky-line-number .codicon {
float: right;
+ transition: var(--vscode-editorStickyScroll-foldingOpacityTransition);
}
.monaco-editor .sticky-line-content {
diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts
index 480e4f84efd..089185fc2f4 100644
--- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts
+++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts
@@ -46,6 +46,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
private _lastLineRelativePosition: number = 0;
private _minContentWidthInPx: number = 0;
private _foldingModel: FoldingModel | null = null;
+ private _isOnGlyphMargin: boolean = false;
constructor(
private readonly _editor: ICodeEditor
@@ -154,6 +155,20 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
this._rootDomNode.style.display = 'none';
}
+ private _useFoldingOpacityTransition(requireTransitions: boolean) {
+ this._lineNumbersDomNode.style.setProperty('--vscode-editorStickyScroll-foldingOpacityTransition', `opacity ${requireTransitions ? 0.5 : 0}s`);
+ }
+
+ private _setFoldingIconsVisibility(allVisible: boolean) {
+ for (const line of this._stickyLines) {
+ const foldingIcon = line.foldingIcon;
+ if (!foldingIcon) {
+ continue;
+ }
+ foldingIcon.setVisible(allVisible ? true : foldingIcon.isCollapsed);
+ }
+ }
+
private async _renderRootNode(forceRebuild: boolean = false, previousStickyLines: RenderedStickyLine[]): Promise {
const layoutInfo = this._editor.getLayoutInfo();
@@ -168,6 +183,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
}
if (this._foldingModel) {
this._setFoldingHoverListeners();
+ this._useFoldingOpacityTransition(!this._isOnGlyphMargin);
}
const widgetHeight: number = this._lineNumbers.length * this._lineHeight + this._lastLineRelativePosition;
@@ -196,30 +212,14 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
return;
}
this._foldingIconStore.add(dom.addDisposableListener(this._lineNumbersDomNode, dom.EventType.MOUSE_ENTER, (e) => {
- const mouseEventTriggerredByClick =
- 'fromElement' in e
- && e.fromElement instanceof HTMLElement
- && e.fromElement.classList.contains('codicon');
-
- for (const line of this._stickyLines) {
- const foldingIcon = line.foldingIcon;
- if (!foldingIcon) {
- continue;
- }
- if (mouseEventTriggerredByClick) {
- foldingIcon.setTransitionRequired(false);
- foldingIcon.setVisible(true);
- setTimeout(() => { foldingIcon.setTransitionRequired(true); }, 300);
- } else {
- foldingIcon.setVisible(true);
- }
- }
+ this._isOnGlyphMargin = true;
+ this._setFoldingIconsVisibility(true);
}));
this._foldingIconStore.add(dom.addDisposableListener(this._lineNumbersDomNode, dom.EventType.MOUSE_LEAVE, () => {
- for (const line of this._stickyLines) {
- const foldingIcon = line.foldingIcon;
- foldingIcon?.setVisible(foldingIcon.isCollapsed);
- }
+ this._isOnGlyphMargin = false;
+ this._useFoldingOpacityTransition(true);
+ this._setFoldingIconsVisibility(false);
+
}));
}
@@ -336,7 +336,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
const isCollapsed = foldingRegions.isCollapsed(indexOfFoldingRegion);
const foldingIcon = new StickyFoldingIcon(isCollapsed, startLineNumber, foldingRegions.getEndLineNumber(indexOfFoldingRegion), this._lineHeight);
container.append(foldingIcon.domNode);
- foldingIcon.setVisible(isCollapsed || showFoldingControls === 'always');
+ foldingIcon.setVisible(this._isOnGlyphMargin ? true : (isCollapsed || showFoldingControls === 'always'));
foldingIcon.setTransitionRequired(true);
foldingIcon.domNode.setAttribute(STICKY_LINE_FOLDING_ICON_ATTR, 'true');
return foldingIcon;
@@ -471,8 +471,4 @@ class StickyFoldingIcon {
this.domNode.style.cursor = visible ? 'pointer' : 'default';
this.domNode.style.opacity = visible ? '1' : '0';
}
-
- public setTransitionRequired(transitionRequired: boolean) {
- this.domNode.style.transition = `opacity ${transitionRequired ? 0.5 : 0}s`;
- }
}
diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts
index d9a8d83cf09..c2eb25b69e9 100644
--- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts
+++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts
@@ -594,6 +594,7 @@ export class StandaloneDiffEditor2 extends DiffEditorWidget2 implements IStandal
instantiationService,
codeEditorService,
audioCueService,
+ editorProgressService,
);
this._configurationService = configurationService;
diff --git a/src/vs/editor/standalone/browser/standaloneEditor.ts b/src/vs/editor/standalone/browser/standaloneEditor.ts
index 005e48ad530..9d529b71049 100644
--- a/src/vs/editor/standalone/browser/standaloneEditor.ts
+++ b/src/vs/editor/standalone/browser/standaloneEditor.ts
@@ -34,7 +34,8 @@ import { EditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensi
import { IMenuItem, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';
-import { LineRangeMapping, MovedText, RangeMapping, SimpleLineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { MovedText } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping, RangeMapping, LineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { LineRange } from 'vs/editor/common/core/lineRange';
import { EditorZoom } from 'vs/editor/common/config/editorZoom';
import { IOpenerService } from 'vs/platform/opener/common/opener';
@@ -584,11 +585,11 @@ export function createMonacoEditorAPI(): typeof monaco.editor {
FindMatch: FindMatch,
ApplyUpdateResult: ApplyUpdateResult,
LineRange: LineRange,
- LineRangeMapping: LineRangeMapping,
+ DetailedLineRangeMapping: DetailedLineRangeMapping,
RangeMapping: RangeMapping,
EditorZoom: EditorZoom,
MovedText: MovedText,
- SimpleLineRangeMapping: SimpleLineRangeMapping,
+ LineRangeMapping: LineRangeMapping,
// vars
EditorType: EditorType,
diff --git a/src/vs/editor/standalone/browser/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts
index e7297361013..01f2c6987ac 100644
--- a/src/vs/editor/standalone/browser/standaloneServices.ts
+++ b/src/vs/editor/standalone/browser/standaloneServices.ts
@@ -1114,6 +1114,9 @@ export module StandaloneServices {
serviceCollection.set(IInstantiationService, instantiationService);
export function get(serviceId: ServiceIdentifier): T {
+ if (!initialized) {
+ initialize({});
+ }
const r = serviceCollection.get(serviceId);
if (!r) {
throw new Error('Missing service ' + serviceId);
diff --git a/src/vs/editor/test/browser/widget/diffEditorWidget2.test.ts b/src/vs/editor/test/browser/widget/diffEditorWidget2.test.ts
index 85c9043e060..6adb654d142 100644
--- a/src/vs/editor/test/browser/widget/diffEditorWidget2.test.ts
+++ b/src/vs/editor/test/browser/widget/diffEditorWidget2.test.ts
@@ -6,7 +6,7 @@
import assert = require('assert');
import { UnchangedRegion } from 'vs/editor/browser/widget/diffEditorWidget2/diffEditorViewModel';
import { LineRange } from 'vs/editor/common/core/lineRange';
-import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
suite('DiffEditorWidget2', () => {
suite('UnchangedRegion', () => {
@@ -16,9 +16,11 @@ suite('DiffEditorWidget2', () => {
test('Everything changed', () => {
assert.deepStrictEqual(serialize(UnchangedRegion.fromDiffs(
- [new LineRangeMapping(new LineRange(1, 10), new LineRange(1, 10), [])],
+ [new DetailedLineRangeMapping(new LineRange(1, 10), new LineRange(1, 10), [])],
10,
10,
+ 3,
+ 3,
)), []);
});
@@ -27,6 +29,8 @@ suite('DiffEditorWidget2', () => {
[],
10,
10,
+ 3,
+ 3,
)), [
"[1,11) - [1,11)"
]);
@@ -34,9 +38,11 @@ suite('DiffEditorWidget2', () => {
test('Change in the middle', () => {
assert.deepStrictEqual(serialize(UnchangedRegion.fromDiffs(
- [new LineRangeMapping(new LineRange(50, 60), new LineRange(50, 60), [])],
+ [new DetailedLineRangeMapping(new LineRange(50, 60), new LineRange(50, 60), [])],
100,
100,
+ 3,
+ 3,
)), ([
'[1,47) - [1,47)',
'[63,101) - [63,101)'
@@ -45,9 +51,11 @@ suite('DiffEditorWidget2', () => {
test('Change at the end', () => {
assert.deepStrictEqual(serialize(UnchangedRegion.fromDiffs(
- [new LineRangeMapping(new LineRange(99, 100), new LineRange(100, 100), [])],
+ [new DetailedLineRangeMapping(new LineRange(99, 100), new LineRange(100, 100), [])],
100,
100,
+ 3,
+ 3,
)), (["[1,96) - [1,96)"]));
});
});
diff --git a/src/vs/editor/test/common/core/lineRange.test.ts b/src/vs/editor/test/common/core/lineRange.test.ts
new file mode 100644
index 00000000000..535a20607b1
--- /dev/null
+++ b/src/vs/editor/test/common/core/lineRange.test.ts
@@ -0,0 +1,58 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import assert = require('assert');
+import { LineRange, LineRangeSet } from 'vs/editor/common/core/lineRange';
+
+suite('LineRange', () => {
+ test('contains', () => {
+ const r = new LineRange(2, 3);
+ assert.deepStrictEqual(r.contains(1), false);
+ assert.deepStrictEqual(r.contains(2), true);
+ assert.deepStrictEqual(r.contains(3), false);
+ assert.deepStrictEqual(r.contains(4), false);
+ });
+});
+
+suite('LineRangeSet', () => {
+ test('addRange', () => {
+ const set = new LineRangeSet();
+ set.addRange(new LineRange(2, 3));
+ set.addRange(new LineRange(3, 4));
+ set.addRange(new LineRange(10, 20));
+ assert.deepStrictEqual(set.toString(), '[2,4), [10,20)');
+
+ set.addRange(new LineRange(3, 21));
+ assert.deepStrictEqual(set.toString(), '[2,21)');
+ });
+
+ test('getUnion', () => {
+ const set1 = new LineRangeSet([
+ new LineRange(2, 3),
+ new LineRange(5, 7),
+ new LineRange(10, 20)
+ ]);
+ const set2 = new LineRangeSet([
+ new LineRange(3, 4),
+ new LineRange(6, 8),
+ new LineRange(9, 11)
+ ]);
+
+ const union = set1.getUnion(set2);
+ assert.deepStrictEqual(union.toString(), '[2,4), [5,8), [9,20)');
+ });
+
+ test('intersects', () => {
+ const set1 = new LineRangeSet([
+ new LineRange(2, 3),
+ new LineRange(5, 7),
+ new LineRange(10, 20)
+ ]);
+
+ assert.deepStrictEqual(set1.intersects(new LineRange(1, 2)), false);
+ assert.deepStrictEqual(set1.intersects(new LineRange(1, 3)), true);
+ assert.deepStrictEqual(set1.intersects(new LineRange(3, 5)), false);
+ });
+});
diff --git a/src/vs/editor/test/node/diffing/advancedLinesDiffComputer.test.ts b/src/vs/editor/test/node/diffing/advancedLinesDiffComputer.test.ts
new file mode 100644
index 00000000000..f5e4bbacdbc
--- /dev/null
+++ b/src/vs/editor/test/node/diffing/advancedLinesDiffComputer.test.ts
@@ -0,0 +1,100 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import * as assert from 'assert';
+import { Range } from 'vs/editor/common/core/range';
+import { RangeMapping } from 'vs/editor/common/diff/rangeMapping';
+import { LinesSliceCharSequence, getLineRangeMapping } from 'vs/editor/common/diff/advancedLinesDiffComputer';
+import { OffsetRange } from 'vs/editor/common/core/offsetRange';
+
+suite('lineRangeMapping', () => {
+ test('1', () => {
+ assert.deepStrictEqual(
+ getLineRangeMapping(
+ new RangeMapping(
+ new Range(2, 1, 3, 1),
+ new Range(2, 1, 2, 1)
+ ),
+ [
+ 'const abc = "helloworld".split("");',
+ '',
+ ''
+ ],
+ [
+ 'const asciiLower = "helloworld".split("");',
+ ''
+ ]
+ ).toString(),
+ "{[2,3)->[2,2)}"
+ );
+ });
+
+ test('2', () => {
+ assert.deepStrictEqual(
+ getLineRangeMapping(
+ new RangeMapping(
+ new Range(2, 1, 2, 1),
+ new Range(2, 1, 4, 1),
+ ),
+ [
+ '',
+ '',
+ ],
+ [
+ '',
+ '',
+ '',
+ '',
+ ]
+ ).toString(),
+ "{[2,2)->[2,4)}"
+ );
+ });
+});
+
+suite('LinesSliceCharSequence', () => {
+ // Create tests for translateOffset
+
+ const sequence = new LinesSliceCharSequence(
+ [
+ 'line1: foo',
+ 'line2: fizzbuzz',
+ 'line3: barr',
+ 'line4: hello world',
+ 'line5: bazz',
+ ],
+ new OffsetRange(1, 4), true
+ );
+
+ test('translateOffset', () => {
+ assert.deepStrictEqual(
+ { result: OffsetRange.ofLength(sequence.length).map(offset => sequence.translateOffset(offset).toString()) },
+ ({
+ result: [
+ "(2,1)", "(2,2)", "(2,3)", "(2,4)", "(2,5)", "(2,6)", "(2,7)", "(2,8)", "(2,9)", "(2,10)", "(2,11)",
+ "(2,12)", "(2,13)", "(2,14)", "(2,15)", "(2,16)",
+
+ "(3,1)", "(3,2)", "(3,3)", "(3,4)", "(3,5)", "(3,6)", "(3,7)", "(3,8)", "(3,9)", "(3,10)", "(3,11)", "(3,12)",
+
+ "(4,1)", "(4,2)", "(4,3)", "(4,4)", "(4,5)", "(4,6)", "(4,7)", "(4,8)", "(4,9)",
+ "(4,10)", "(4,11)", "(4,12)", "(4,13)", "(4,14)", "(4,15)", "(4,16)", "(4,17)",
+ "(4,18)", "(4,19)"
+ ]
+ })
+ );
+ });
+
+ test('extendToFullLines', () => {
+ assert.deepStrictEqual(
+ { result: sequence.getText(sequence.extendToFullLines(new OffsetRange(20, 25))) },
+ ({ result: "line3: barr\n" })
+ );
+
+ assert.deepStrictEqual(
+ { result: sequence.getText(sequence.extendToFullLines(new OffsetRange(20, 45))) },
+ ({ result: "line3: barr\nline4: hello world\n" })
+ );
+ });
+});
diff --git a/src/vs/editor/test/node/diffing/diffingFixture.test.ts b/src/vs/editor/test/node/diffing/diffingFixture.test.ts
index a04f2edf9d8..89490813b78 100644
--- a/src/vs/editor/test/node/diffing/diffingFixture.test.ts
+++ b/src/vs/editor/test/node/diffing/diffingFixture.test.ts
@@ -8,7 +8,7 @@ import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'fs
import { join, resolve } from 'path';
import { setUnexpectedErrorHandler } from 'vs/base/common/errors';
import { FileAccess } from 'vs/base/common/network';
-import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { LegacyLinesDiffComputer } from 'vs/editor/common/diff/legacyLinesDiffComputer';
import { AdvancedLinesDiffComputer } from 'vs/editor/common/diff/advancedLinesDiffComputer';
@@ -43,10 +43,10 @@ suite('diff fixtures', () => {
const ignoreTrimWhitespace = folder.indexOf('trimws') >= 0;
const diff = diffingAlgo.computeDiff(firstContentLines, secondContentLines, { ignoreTrimWhitespace, maxComputationTimeMs: Number.MAX_SAFE_INTEGER, computeMoves: false });
- function getDiffs(changes: readonly LineRangeMapping[]): IDetailedDiff[] {
+ function getDiffs(changes: readonly DetailedLineRangeMapping[]): IDetailedDiff[] {
return changes.map(c => ({
- originalRange: c.originalRange.toString(),
- modifiedRange: c.modifiedRange.toString(),
+ originalRange: c.original.toString(),
+ modifiedRange: c.modified.toString(),
innerChanges: c.innerChanges?.map(c => ({
originalRange: c.originalRange.toString(),
modifiedRange: c.modifiedRange.toString(),
diff --git a/src/vs/editor/test/node/diffing/lineRangeMapping.test.ts b/src/vs/editor/test/node/diffing/lineRangeMapping.test.ts
deleted file mode 100644
index f0d0802912d..00000000000
--- a/src/vs/editor/test/node/diffing/lineRangeMapping.test.ts
+++ /dev/null
@@ -1,54 +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 * as assert from 'assert';
-import { Range } from 'vs/editor/common/core/range';
-import { RangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
-import { getLineRangeMapping } from 'vs/editor/common/diff/advancedLinesDiffComputer';
-
-suite('lineRangeMapping', () => {
- test('1', () => {
- assert.deepStrictEqual(
- getLineRangeMapping(
- new RangeMapping(
- new Range(2, 1, 3, 1),
- new Range(2, 1, 2, 1)
- ),
- [
- 'const abc = "helloworld".split("");',
- '',
- ''
- ],
- [
- 'const asciiLower = "helloworld".split("");',
- ''
- ]
- ).toString(),
- "{[2,3)->[2,2)}"
- );
- });
-
- test('2', () => {
- assert.deepStrictEqual(
- getLineRangeMapping(
- new RangeMapping(
- new Range(2, 1, 2, 1),
- new Range(2, 1, 4, 1),
- ),
- [
- '',
- '',
- ],
- [
- '',
- '',
- '',
- '',
- ]
- ).toString(),
- "{[2,2)->[2,4)}"
- );
- });
-});
diff --git a/src/vs/loader.js b/src/vs/loader.js
index c2d38dfca0e..a618210a168 100644
--- a/src/vs/loader.js
+++ b/src/vs/loader.js
@@ -1248,6 +1248,7 @@ var AMDLoader;
this._buildInfoPath = [];
this._buildInfoDefineStack = [];
this._buildInfoDependencies = [];
+ this._requireFunc.moduleManager = this;
}
reset() {
return new ModuleManager(this._env, this._scriptLoader, this._defineFunc, this._requireFunc, this._loaderAvailableTimestamp);
diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts
index 442b460ca18..51ce58011f8 100644
--- a/src/vs/monaco.d.ts
+++ b/src/vs/monaco.d.ts
@@ -2415,7 +2415,7 @@ declare namespace monaco.editor {
/**
* Maps all modified line ranges in the original to the corresponding line ranges in the modified text model.
*/
- readonly changes: readonly LineRangeMapping[];
+ readonly changes: readonly DetailedLineRangeMapping[];
/**
* Sorted by original line ranges.
* The original line ranges and the modified line ranges must be disjoint (but can be touching).
@@ -2433,11 +2433,6 @@ declare namespace monaco.editor {
* @param lineRanges An array of sorted line ranges.
*/
static joinMany(lineRanges: readonly (readonly LineRange[])[]): readonly LineRange[];
- /**
- * @param lineRanges1 Must be sorted.
- * @param lineRanges2 Must be sorted.
- */
- static join(lineRanges1: readonly LineRange[], lineRanges2: readonly LineRange[]): readonly LineRange[];
static ofLength(startLineNumber: number, length: number): LineRange;
/**
* The start line number.
@@ -2485,19 +2480,22 @@ declare namespace monaco.editor {
includes(lineNumber: number): boolean;
}
+ export class MovedText {
+ readonly lineRangeMapping: LineRangeMapping;
+ /**
+ * The diff from the original text to the moved text.
+ * Must be contained in the original/modified line range.
+ * Can be empty if the text didn't change (only moved).
+ */
+ readonly changes: readonly DetailedLineRangeMapping[];
+ constructor(lineRangeMapping: LineRangeMapping, changes: readonly DetailedLineRangeMapping[]);
+ flip(): MovedText;
+ }
+
/**
* Maps a line range in the original text model to a line range in the modified text model.
*/
- export class LineRangeMapping {
- static inverse(mapping: readonly LineRangeMapping[], originalLineCount: number, modifiedLineCount: number): LineRangeMapping[];
- /**
- * The line range in the original text model.
- */
- readonly originalRange: LineRange;
- /**
- * The line range in the modified text model.
- */
- readonly modifiedRange: LineRange;
+ export class DetailedLineRangeMapping extends LineRangeMapping {
/**
* If inner changes have not been computed, this is set to undefined.
* Otherwise, it represents the character-level diff in this line range.
@@ -2506,9 +2504,7 @@ declare namespace monaco.editor {
*/
readonly innerChanges: RangeMapping[] | undefined;
constructor(originalRange: LineRange, modifiedRange: LineRange, innerChanges: RangeMapping[] | undefined);
- toString(): string;
- get changedLineCount(): any;
- flip(): LineRangeMapping;
+ flip(): DetailedLineRangeMapping;
}
/**
@@ -2528,25 +2524,21 @@ declare namespace monaco.editor {
flip(): RangeMapping;
}
- export class MovedText {
- readonly lineRangeMapping: SimpleLineRangeMapping;
+ export class LineRangeMapping {
+ static inverse(mapping: readonly DetailedLineRangeMapping[], originalLineCount: number, modifiedLineCount: number): DetailedLineRangeMapping[];
/**
- * The diff from the original text to the moved text.
- * Must be contained in the original/modified line range.
- * Can be empty if the text didn't change (only moved).
+ * The line range in the original text model.
*/
- readonly changes: readonly LineRangeMapping[];
- constructor(lineRangeMapping: SimpleLineRangeMapping, changes: readonly LineRangeMapping[]);
- flip(): MovedText;
- }
-
- export class SimpleLineRangeMapping {
readonly original: LineRange;
+ /**
+ * The line range in the modified text model.
+ */
readonly modified: LineRange;
- constructor(original: LineRange, modified: LineRange);
+ constructor(originalRange: LineRange, modifiedRange: LineRange);
toString(): string;
- flip(): SimpleLineRangeMapping;
- join(other: SimpleLineRangeMapping): SimpleLineRangeMapping;
+ flip(): LineRangeMapping;
+ join(other: LineRangeMapping): LineRangeMapping;
+ get changedLineCount(): any;
}
export interface IDimension {
width: number;
@@ -3976,10 +3968,6 @@ declare namespace monaco.editor {
*/
accessibilityVerbose?: boolean;
experimental?: {
- /**
- * Defaults to false.
- */
- collapseUnchangedRegions?: boolean;
/**
* Defaults to false.
*/
@@ -3995,6 +3983,12 @@ declare namespace monaco.editor {
* If the diff editor should only show the difference review mode.
*/
onlyShowAccessibleDiffViewer?: boolean;
+ hideUnchangedRegions?: {
+ enabled?: boolean;
+ revealLineCount?: number;
+ minimumLineCount?: number;
+ contextLineCount?: number;
+ };
}
/**
diff --git a/src/vs/platform/actions/browser/menuEntryActionViewItem.ts b/src/vs/platform/actions/browser/menuEntryActionViewItem.ts
index 356ff5e1013..c6e7a926213 100644
--- a/src/vs/platform/actions/browser/menuEntryActionViewItem.ts
+++ b/src/vs/platform/actions/browser/menuEntryActionViewItem.ts
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-import { $, addDisposableListener, append, asCSSUrl, EventType, ModifierKeyEmitter, prepend } from 'vs/base/browser/dom';
+import { $, addDisposableListener, append, asCSSUrl, EventType, ModifierKeyEmitter, prepend, reset } from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { ActionViewItem, BaseActionViewItem, SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';
import { DropdownMenuActionViewItem, IDropdownMenuActionViewItemOptions } from 'vs/base/browser/ui/dropdown/dropdownActionViewItem';
@@ -257,17 +257,25 @@ export class MenuEntryActionViewItem extends ActionViewItem {
});
} else {
- // icon path/url
- label.style.backgroundImage = (
- isDark(this._themeService.getColorTheme().type)
- ? asCSSUrl(icon.dark)
- : asCSSUrl(icon.light)
- );
+ // icon path/url - add special element with SVG-mask and icon color background
+ const svgUrl = isDark(this._themeService.getColorTheme().type)
+ ? asCSSUrl(icon.dark)
+ : asCSSUrl(icon.light);
+
+ const svgIcon = $('span');
+ svgIcon.style.webkitMask = svgIcon.style.mask = `${svgUrl} no-repeat 50% 50%`;
+ svgIcon.style.background = 'var(--vscode-icon-foreground)';
+ svgIcon.style.display = 'inline-block';
+ svgIcon.style.width = '100%';
+ svgIcon.style.height = '100%';
+
+ label.appendChild(svgIcon);
label.classList.add('icon');
+
this._itemClassDispose.value = combinedDisposable(
toDisposable(() => {
- label.style.backgroundImage = '';
label.classList.remove('icon');
+ reset(label);
}),
this._themeService.onDidColorThemeChange(() => {
// refresh when the theme changes in case we go between dark <-> light
diff --git a/src/vs/platform/environment/electron-main/environmentMainService.ts b/src/vs/platform/environment/electron-main/environmentMainService.ts
index 748ff075783..aab03b3130f 100644
--- a/src/vs/platform/environment/electron-main/environmentMainService.ts
+++ b/src/vs/platform/environment/electron-main/environmentMainService.ts
@@ -6,6 +6,7 @@
import { memoize } from 'vs/base/common/decorators';
import { join } from 'vs/base/common/path';
import { isLinux } from 'vs/base/common/platform';
+import { URI } from 'vs/base/common/uri';
import { createStaticIPCHandle } from 'vs/base/parts/ipc/node/ipc.net';
import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment';
import { NativeEnvironmentService } from 'vs/platform/environment/node/environmentService';
@@ -68,6 +69,9 @@ export class EnvironmentMainService extends NativeEnvironmentService implements
@memoize
get useCodeCache(): boolean { return !!this.codeCachePath; }
+ @memoize
+ override get userRoamingDataHome(): URI { return this.appSettingsHome; }
+
unsetSnapExportedVariables() {
if (!isLinux) {
return;
diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts
index 677149f937b..9b8ba9a1b42 100644
--- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts
+++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts
@@ -152,12 +152,13 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi
throw new Error(nls.localize('incompatible', "Unable to install extension '{0}' as it is not compatible with VS Code '{1}'.", extensionId, this.productService.version));
}
- const result = await this.installExtensions([{ manifest, extension: location, options }]);
- if (result[0]?.local) {
- return result[0]?.local;
+ const results = await this.installExtensions([{ manifest, extension: location, options }]);
+ const result = results.find(({ identifier }) => areSameExtensions(identifier, { id: extensionId }));
+ if (result?.local) {
+ return result.local;
}
- if (result[0]?.error) {
- throw result[0].error;
+ if (result?.error) {
+ throw result.error;
}
throw toExtensionManagementError(new Error(`Unknown error while installing extension ${extensionId}`));
} finally {
diff --git a/src/vs/platform/history/browser/contextScopedHistoryWidget.ts b/src/vs/platform/history/browser/contextScopedHistoryWidget.ts
index 0278e0c0112..53b9397651d 100644
--- a/src/vs/platform/history/browser/contextScopedHistoryWidget.ts
+++ b/src/vs/platform/history/browser/contextScopedHistoryWidget.ts
@@ -113,6 +113,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
when: ContextKeyExpr.and(
ContextKeyExpr.has(HistoryNavigationWidgetFocusContext),
ContextKeyExpr.equals(HistoryNavigationBackwardsEnablementContext, true),
+ ContextKeyExpr.not('isComposing'),
historyNavigationVisible.isEqualTo(false),
),
primary: KeyCode.UpArrow,
@@ -128,6 +129,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
when: ContextKeyExpr.and(
ContextKeyExpr.has(HistoryNavigationWidgetFocusContext),
ContextKeyExpr.equals(HistoryNavigationForwardsEnablementContext, true),
+ ContextKeyExpr.not('isComposing'),
historyNavigationVisible.isEqualTo(false),
),
primary: KeyCode.DownArrow,
diff --git a/src/vs/platform/protocol/electron-main/protocolMainService.ts b/src/vs/platform/protocol/electron-main/protocolMainService.ts
index 79d431b275c..2b0a52627a8 100644
--- a/src/vs/platform/protocol/electron-main/protocolMainService.ts
+++ b/src/vs/platform/protocol/electron-main/protocolMainService.ts
@@ -39,8 +39,8 @@ export class ProtocolMainService extends Disposable implements IProtocolMainServ
// - storage : all files in global and workspace storage (https://github.com/microsoft/vscode/issues/116735)
this.addValidFileRoot(environmentService.appRoot);
this.addValidFileRoot(environmentService.extensionsPath);
- this.addValidFileRoot(userDataProfilesService.defaultProfile.globalStorageHome.fsPath);
- this.addValidFileRoot(environmentService.workspaceStorageHome.fsPath);
+ this.addValidFileRoot(userDataProfilesService.defaultProfile.globalStorageHome.with({ scheme: Schemas.file }).fsPath);
+ this.addValidFileRoot(environmentService.workspaceStorageHome.with({ scheme: Schemas.file }).fsPath);
// Handle protocols
this.handleProtocols();
diff --git a/src/vs/platform/quickinput/browser/quickInput.ts b/src/vs/platform/quickinput/browser/quickInput.ts
index c56674f2f78..4258cd0640a 100644
--- a/src/vs/platform/quickinput/browser/quickInput.ts
+++ b/src/vs/platform/quickinput/browser/quickInput.ts
@@ -31,7 +31,6 @@ import { IInputBox, IKeyMods, IQuickInput, IQuickInputButton, IQuickInputHideEve
import { QuickInputBox } from './quickInputBox';
import { QuickInputList, QuickInputListFocus } from './quickInputList';
import { getIconClass, renderQuickInputDescription } from './quickInputUtils';
-import { ColorScheme } from 'vs/platform/theme/common/theme';
export interface IQuickInputOptions {
idPrefix: string;
@@ -48,7 +47,7 @@ export interface IQuickInputOptions {
renderers: IListRenderer[],
options: IListOptions,
): List;
- hoverDelegate: IHoverDelegate;
+ hoverDelegate?: IHoverDelegate;
styles: IQuickInputStyles;
}
@@ -62,7 +61,6 @@ export interface IQuickInputStyles {
readonly keybindingLabel: IKeybindingLabelStyles;
readonly list: IListStyles;
readonly pickerGroup: { pickerGroupBorder: string | undefined; pickerGroupForeground: string | undefined };
- readonly colorScheme: ColorScheme;
}
export interface IQuickInputWidgetStyles {
diff --git a/src/vs/platform/quickinput/browser/quickInputController.ts b/src/vs/platform/quickinput/browser/quickInputController.ts
index f42e1ff78d1..932eec180e1 100644
--- a/src/vs/platform/quickinput/browser/quickInputController.ts
+++ b/src/vs/platform/quickinput/browser/quickInputController.ts
@@ -21,6 +21,7 @@ import { QuickInputBox } from 'vs/platform/quickinput/browser/quickInputBox';
import { QuickInputList, QuickInputListFocus } from 'vs/platform/quickinput/browser/quickInputList';
import { QuickInputUI, Writeable, IQuickInputStyles, IQuickInputOptions, QuickPick, backButton, InputBox, Visibilities, QuickWidget } from 'vs/platform/quickinput/browser/quickInput';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
+import { IThemeService } from 'vs/platform/theme/common/themeService';
const $ = dom.$;
@@ -50,7 +51,8 @@ export class QuickInputController extends Disposable {
private previousFocusElement?: HTMLElement;
- constructor(private options: IQuickInputOptions) {
+ constructor(private options: IQuickInputOptions,
+ private readonly themeService: IThemeService) {
super();
this.idPrefix = options.idPrefix;
this.parentElement = options.container;
@@ -81,12 +83,13 @@ export class QuickInputController extends Disposable {
const titleBar = dom.append(container, $('.quick-input-titlebar'));
- const leftActionBar = this._register(new ActionBar(titleBar));
+ const actionBarOption = this.options.hoverDelegate ? { hoverDelegate: this.options.hoverDelegate } : undefined;
+ const leftActionBar = this._register(new ActionBar(titleBar, actionBarOption));
leftActionBar.domNode.classList.add('quick-input-left-action-bar');
const title = dom.append(titleBar, $('.quick-input-title'));
- const rightActionBar = this._register(new ActionBar(titleBar));
+ const rightActionBar = this._register(new ActionBar(titleBar, actionBarOption));
rightActionBar.domNode.classList.add('quick-input-right-action-bar');
const headerContainer = dom.append(container, $('.quick-input-header'));
@@ -145,7 +148,7 @@ export class QuickInputController extends Disposable {
const description1 = dom.append(container, $('.quick-input-description'));
const listId = this.idPrefix + 'list';
- const list = this._register(new QuickInputList(container, listId, this.options));
+ const list = this._register(new QuickInputList(container, listId, this.options, this.themeService));
inputBox.setAttribute('aria-controls', listId);
this._register(list.onDidChangeFocus(() => {
inputBox.setAttribute('aria-activedescendant', list.getActiveDescendant() ?? '');
diff --git a/src/vs/platform/quickinput/browser/quickInputList.ts b/src/vs/platform/quickinput/browser/quickInputList.ts
index 650219bb460..bb8dc4c1429 100644
--- a/src/vs/platform/quickinput/browser/quickInputList.ts
+++ b/src/vs/platform/quickinput/browser/quickInputList.ts
@@ -34,7 +34,8 @@ import { getIconClass } from 'vs/platform/quickinput/browser/quickInputUtils';
import { IQuickPickItem, IQuickPickItemButtonEvent, IQuickPickSeparator, IQuickPickSeparatorButtonEvent, QuickPickItem } from 'vs/platform/quickinput/common/quickInput';
import { Lazy } from 'vs/base/common/lazy';
import { URI } from 'vs/base/common/uri';
-import { ColorScheme, isDark } from 'vs/platform/theme/common/theme';
+import { isDark } from 'vs/platform/theme/common/theme';
+import { IThemeService } from 'vs/platform/theme/common/themeService';
const $ = dom.$;
@@ -234,7 +235,7 @@ class ListElementRenderer implements IListRenderer {
// always prefer item over separator because if item is defined, it must be the main item type
@@ -539,46 +541,49 @@ export class QuickInputList {
}
}));
- const delayer = new ThrottledDelayer(options.hoverDelegate.delay);
- // onMouseOver triggers every time a new element has been moused over
- // even if it's on the same list item.
- this.disposables.push(this.list.onMouseOver(async e => {
- // If we hover over an anchor element, we don't want to show the hover because
- // the anchor may have a tooltip that we want to show instead.
- if (e.browserEvent.target instanceof HTMLAnchorElement) {
- delayer.cancel();
- return;
- }
- if (
- // anchors are an exception as called out above so we skip them here
- !(e.browserEvent.relatedTarget instanceof HTMLAnchorElement) &&
- // check if the mouse is still over the same element
- dom.isAncestor(e.browserEvent.relatedTarget as Node, e.element?.element as Node)
- ) {
- return;
- }
- try {
- await delayer.trigger(async () => {
- if (e.element) {
- this.showHover(e.element);
- }
- });
- } catch (e) {
- // Ignore cancellation errors due to mouse out
- if (!isCancellationError(e)) {
- throw e;
+ if (options.hoverDelegate) {
+ const delayer = new ThrottledDelayer(options.hoverDelegate.delay);
+ // onMouseOver triggers every time a new element has been moused over
+ // even if it's on the same list item.
+ this.disposables.push(this.list.onMouseOver(async e => {
+ // If we hover over an anchor element, we don't want to show the hover because
+ // the anchor may have a tooltip that we want to show instead.
+ if (e.browserEvent.target instanceof HTMLAnchorElement) {
+ delayer.cancel();
+ return;
}
- }
- }));
- this.disposables.push(this.list.onMouseOut(e => {
- // onMouseOut triggers every time a new element has been moused over
- // even if it's on the same list item. We only want one event, so we
- // check if the mouse is still over the same element.
- if (dom.isAncestor(e.browserEvent.relatedTarget as Node, e.element?.element as Node)) {
- return;
- }
- delayer.cancel();
- }));
+ if (
+ // anchors are an exception as called out above so we skip them here
+ !(e.browserEvent.relatedTarget instanceof HTMLAnchorElement) &&
+ // check if the mouse is still over the same element
+ dom.isAncestor(e.browserEvent.relatedTarget as Node, e.element?.element as Node)
+ ) {
+ return;
+ }
+ try {
+ await delayer.trigger(async () => {
+ if (e.element) {
+ this.showHover(e.element);
+ }
+ });
+ } catch (e) {
+ // Ignore cancellation errors due to mouse out
+ if (!isCancellationError(e)) {
+ throw e;
+ }
+ }
+ }));
+ this.disposables.push(this.list.onMouseOut(e => {
+ // onMouseOut triggers every time a new element has been moused over
+ // even if it's on the same list item. We only want one event, so we
+ // check if the mouse is still over the same element.
+ if (dom.isAncestor(e.browserEvent.relatedTarget as Node, e.element?.element as Node)) {
+ return;
+ }
+ delayer.cancel();
+ }));
+ this.disposables.push(delayer);
+ }
this.disposables.push(this._listElementChecked.event(_ => this.fireCheckedEvents()));
this.disposables.push(
this._onChangedAllVisibleChecked,
@@ -588,8 +593,7 @@ export class QuickInputList {
this._onButtonTriggered,
this._onSeparatorButtonTriggered,
this._onLeave,
- this._onKeyDown,
- delayer
+ this._onKeyDown
);
}
@@ -837,10 +841,14 @@ export class QuickInputList {
* @param element The element to show the hover for
*/
private showHover(element: IListElement): void {
+ if (this.options.hoverDelegate === undefined) {
+ return;
+ }
if (this._lastHover && !this._lastHover.isDisposed) {
this.options.hoverDelegate.onDidHideHover?.();
this._lastHover?.dispose();
}
+
if (!element.element || !element.saneTooltip) {
return;
}
diff --git a/src/vs/platform/quickinput/browser/quickInputService.ts b/src/vs/platform/quickinput/browser/quickInputService.ts
index f797cd31f05..924e6b83ef6 100644
--- a/src/vs/platform/quickinput/browser/quickInputService.ts
+++ b/src/vs/platform/quickinput/browser/quickInputService.ts
@@ -86,19 +86,14 @@ export class QuickInputService extends Themable implements IQuickInputService {
renderers: IListRenderer[],
options: IWorkbenchListOptions
) => this.instantiationService.createInstance(WorkbenchList, user, container, delegate, renderers, options) as List,
- hoverDelegate: {
- showHover(options, focus) {
- return undefined;
- },
- delay: 200
- },
styles: this.computeStyles()
};
const controller = this._register(new QuickInputController({
...defaultOptions,
...options
- }));
+ },
+ this.themeService));
controller.layout(host.dimension, host.offset.quickPickTop);
@@ -225,8 +220,7 @@ export class QuickInputService extends Themable implements IQuickInputService {
pickerGroup: {
pickerGroupBorder: asCssVariable(pickerGroupBorder),
pickerGroupForeground: asCssVariable(pickerGroupForeground),
- },
- colorScheme: this.themeService.getColorTheme().type
+ }
};
}
}
diff --git a/src/vs/platform/quickinput/test/browser/quickinput.test.ts b/src/vs/platform/quickinput/test/browser/quickinput.test.ts
index b50d6523c68..2ca1fb2b16e 100644
--- a/src/vs/platform/quickinput/test/browser/quickinput.test.ts
+++ b/src/vs/platform/quickinput/test/browser/quickinput.test.ts
@@ -15,7 +15,7 @@ import { unthemedKeybindingLabelOptions } from 'vs/base/browser/ui/keybindingLab
import { unthemedProgressBarOptions } from 'vs/base/browser/ui/progressbar/progressbar';
import { QuickInputController } from 'vs/platform/quickinput/browser/quickInputController';
import { IQuickPick, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
-import { ColorScheme } from 'vs/platform/theme/common/theme';
+import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
// Sets up an `onShow` listener to allow us to wait until the quick pick is shown (useful when triggering an `accept()` right after launching a quick pick)
// kick this off before you launch the picker and then await the promise returned after you launch the picker.
@@ -82,10 +82,10 @@ suite('QuickInput', () => { // https://github.com/microsoft/vscode/issues/147543
pickerGroup: {
pickerGroupBorder: undefined,
pickerGroupForeground: undefined,
- },
- colorScheme: ColorScheme.DARK
+ }
}
- });
+ },
+ new TestThemeService());
// initial layout
controller.layout({ height: 20, width: 40 }, 0);
diff --git a/src/vs/platform/storage/common/storageService.ts b/src/vs/platform/storage/common/storageService.ts
index d5231239e0c..4cfe09ec6d4 100644
--- a/src/vs/platform/storage/common/storageService.ts
+++ b/src/vs/platform/storage/common/storageService.ts
@@ -5,6 +5,7 @@
import { Promises } from 'vs/base/common/async';
import { DisposableStore } from 'vs/base/common/lifecycle';
+import { Schemas } from 'vs/base/common/network';
import { joinPath } from 'vs/base/common/resources';
import { IStorage, Storage } from 'vs/base/parts/storage/common/storage';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
@@ -117,11 +118,11 @@ export class RemoteStorageService extends AbstractStorageService {
protected getLogDetails(scope: StorageScope): string | undefined {
switch (scope) {
case StorageScope.APPLICATION:
- return this.applicationStorageProfile.globalStorageHome.fsPath;
+ return this.applicationStorageProfile.globalStorageHome.with({ scheme: Schemas.file }).fsPath;
case StorageScope.PROFILE:
- return this.profileStorageProfile?.globalStorageHome.fsPath;
+ return this.profileStorageProfile?.globalStorageHome.with({ scheme: Schemas.file }).fsPath;
default:
- return this.workspaceStorageId ? `${joinPath(this.environmentService.workspaceStorageHome, this.workspaceStorageId, 'state.vscdb').fsPath}` : undefined;
+ return this.workspaceStorageId ? `${joinPath(this.environmentService.workspaceStorageHome, this.workspaceStorageId, 'state.vscdb').with({ scheme: Schemas.file }).fsPath}` : undefined;
}
}
diff --git a/src/vs/platform/storage/electron-main/storageMain.ts b/src/vs/platform/storage/electron-main/storageMain.ts
index 6acc9643b91..b993f4cb3cd 100644
--- a/src/vs/platform/storage/electron-main/storageMain.ts
+++ b/src/vs/platform/storage/electron-main/storageMain.ts
@@ -20,6 +20,7 @@ import { IS_NEW_KEY } from 'vs/platform/storage/common/storage';
import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
import { currentSessionDateStorageKey, firstSessionDateStorageKey, lastSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry';
import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier, IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
+import { Schemas } from 'vs/base/common/network';
export interface IStorageMainOptions {
@@ -275,7 +276,7 @@ class BaseProfileAwareStorageMain extends BaseStorageMain {
get path(): string | undefined {
if (!this.options.useInMemoryStorage) {
- return join(this.profile.globalStorageHome.fsPath, BaseProfileAwareStorageMain.STORAGE_NAME);
+ return join(this.profile.globalStorageHome.with({ scheme: Schemas.file }).fsPath, BaseProfileAwareStorageMain.STORAGE_NAME);
}
return undefined;
@@ -352,7 +353,7 @@ export class WorkspaceStorageMain extends BaseStorageMain {
get path(): string | undefined {
if (!this.options.useInMemoryStorage) {
- return join(this.environmentService.workspaceStorageHome.fsPath, this.workspace.id, WorkspaceStorageMain.WORKSPACE_STORAGE_NAME);
+ return join(this.environmentService.workspaceStorageHome.with({ scheme: Schemas.file }).fsPath, this.workspace.id, WorkspaceStorageMain.WORKSPACE_STORAGE_NAME);
}
return undefined;
@@ -384,7 +385,7 @@ export class WorkspaceStorageMain extends BaseStorageMain {
}
// Otherwise, ensure the storage folder exists on disk
- const workspaceStorageFolderPath = join(this.environmentService.workspaceStorageHome.fsPath, this.workspace.id);
+ const workspaceStorageFolderPath = join(this.environmentService.workspaceStorageHome.with({ scheme: Schemas.file }).fsPath, this.workspace.id);
const workspaceStorageDatabasePath = join(workspaceStorageFolderPath, WorkspaceStorageMain.WORKSPACE_STORAGE_NAME);
const storageExists = await Promises.exists(workspaceStorageFolderPath);
diff --git a/src/vs/platform/storage/electron-main/storageMainService.ts b/src/vs/platform/storage/electron-main/storageMainService.ts
index dc8b3c51e59..bdfad4eacb6 100644
--- a/src/vs/platform/storage/electron-main/storageMainService.ts
+++ b/src/vs/platform/storage/electron-main/storageMainService.ts
@@ -19,6 +19,7 @@ import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userData
import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile';
import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
+import { Schemas } from 'vs/base/common/network';
//#region Storage Main Service (intent: make application, profile and workspace storage accessible to windows from main process)
@@ -359,7 +360,7 @@ export class ApplicationStorageMainService extends AbstractStorageService implem
protected getLogDetails(scope: StorageScope): string | undefined {
if (scope === StorageScope.APPLICATION) {
- return this.userDataProfilesService.defaultProfile.globalStorageHome.fsPath;
+ return this.userDataProfilesService.defaultProfile.globalStorageHome.with({ scheme: Schemas.file }).fsPath;
}
return undefined; // any other scope is unsupported from main process
diff --git a/src/vs/platform/terminal/common/terminal.ts b/src/vs/platform/terminal/common/terminal.ts
index 235d8efdbe8..e7e9dbe82e2 100644
--- a/src/vs/platform/terminal/common/terminal.ts
+++ b/src/vs/platform/terminal/common/terminal.ts
@@ -114,6 +114,7 @@ export const enum TerminalSettingId {
EnableImages = 'terminal.integrated.enableImages',
SmoothScrolling = 'terminal.integrated.smoothScrolling',
IgnoreBracketedPasteMode = 'terminal.integrated.ignoreBracketedPasteMode',
+ FocusAfterRun = 'terminal.integrated.focusAfterRun',
// Debug settings that are hidden from user
diff --git a/src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts b/src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts
index a1599f50737..8c74c72b9c9 100644
--- a/src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts
+++ b/src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts
@@ -18,6 +18,7 @@ import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecy
import { Emitter } from 'vs/base/common/event';
import { deepClone } from 'vs/base/common/objects';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
+import { Schemas } from 'vs/base/common/network';
export class ElectronPtyHostStarter extends Disposable implements IPtyHostStarter {
@@ -58,7 +59,7 @@ export class ElectronPtyHostStarter extends Disposable implements IPtyHostStarte
type: 'ptyHost',
entryPoint: 'vs/platform/terminal/node/ptyHostMain',
execArgv,
- args: ['--logsPath', this._environmentMainService.logsHome.fsPath],
+ args: ['--logsPath', this._environmentMainService.logsHome.with({ scheme: Schemas.file }).fsPath],
env: this._createPtyHostConfiguration()
});
diff --git a/src/vs/platform/terminal/node/nodePtyHostStarter.ts b/src/vs/platform/terminal/node/nodePtyHostStarter.ts
index a1d4e8b7d88..d5a1a43724a 100644
--- a/src/vs/platform/terminal/node/nodePtyHostStarter.ts
+++ b/src/vs/platform/terminal/node/nodePtyHostStarter.ts
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
-import { FileAccess } from 'vs/base/common/network';
+import { FileAccess, Schemas } from 'vs/base/common/network';
import { Client, IIPCOptions } from 'vs/base/parts/ipc/node/ipc.cp';
import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment';
import { parsePtyHostDebugPort } from 'vs/platform/environment/node/environmentService';
@@ -22,7 +22,7 @@ export class NodePtyHostStarter extends Disposable implements IPtyHostStarter {
start(): IPtyHostConnection {
const opts: IIPCOptions = {
serverName: 'Pty Host',
- args: ['--type=ptyHost', '--logsPath', this._environmentService.logsHome.fsPath],
+ args: ['--type=ptyHost', '--logsPath', this._environmentService.logsHome.with({ scheme: Schemas.file }).fsPath],
env: {
VSCODE_AMD_ENTRYPOINT: 'vs/platform/terminal/node/ptyHostMain',
VSCODE_PIPE_LOGGING: 'true',
diff --git a/src/vs/platform/windows/electron-main/windowsMainService.ts b/src/vs/platform/windows/electron-main/windowsMainService.ts
index 022a20e4ee0..67d7113b000 100644
--- a/src/vs/platform/windows/electron-main/windowsMainService.ts
+++ b/src/vs/platform/windows/electron-main/windowsMainService.ts
@@ -1401,8 +1401,8 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
profile: defaultProfile
},
- homeDir: this.environmentMainService.userHome.fsPath,
- tmpDir: this.environmentMainService.tmpDir.fsPath,
+ homeDir: this.environmentMainService.userHome.with({ scheme: Schemas.file }).fsPath,
+ tmpDir: this.environmentMainService.tmpDir.with({ scheme: Schemas.file }).fsPath,
userDataDir: this.environmentMainService.userDataPath,
remoteAuthority: options.remoteAuthority,
@@ -1419,7 +1419,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
window: [],
global: this.loggerService.getRegisteredLoggers()
},
- logsPath: this.environmentMainService.logsHome.fsPath,
+ logsPath: this.environmentMainService.logsHome.with({ scheme: Schemas.file }).fsPath,
product,
isInitialStartup: options.initialStartup,
diff --git a/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts b/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts
index 34913c5ffc5..1d482c3eba4 100644
--- a/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts
+++ b/src/vs/platform/workspaces/electron-main/workspacesManagementMainService.ts
@@ -84,7 +84,7 @@ export class WorkspacesManagementMainService extends Disposable implements IWork
// Resolve untitled workspaces
try {
- const untitledWorkspacePaths = (await Promises.readdir(this.untitledWorkspacesHome.fsPath)).map(folder => joinPath(this.untitledWorkspacesHome, folder, UNTITLED_WORKSPACE_NAME));
+ const untitledWorkspacePaths = (await Promises.readdir(this.untitledWorkspacesHome.with({ scheme: Schemas.file }).fsPath)).map(folder => joinPath(this.untitledWorkspacesHome, folder, UNTITLED_WORKSPACE_NAME));//
for (const untitledWorkspacePath of untitledWorkspacePaths) {
const workspace = getWorkspaceIdentifier(untitledWorkspacePath);
const resolvedWorkspace = await this.resolveLocalWorkspace(untitledWorkspacePath);
@@ -227,7 +227,7 @@ export class WorkspacesManagementMainService extends Disposable implements IWork
await Promises.rm(dirname(configPath));
// Mark Workspace Storage to be deleted
- const workspaceStoragePath = join(this.environmentMainService.workspaceStorageHome.fsPath, workspace.id);
+ const workspaceStoragePath = join(this.environmentMainService.workspaceStorageHome.with({ scheme: Schemas.file }).fsPath, workspace.id);
if (await Promises.exists(workspaceStoragePath)) {
await Promises.writeFile(join(workspaceStoragePath, 'obsolete'), '');
}
diff --git a/src/vs/server/node/remoteExtensionHostAgentServer.ts b/src/vs/server/node/remoteExtensionHostAgentServer.ts
index 5a2d9943ac9..d1a0f51e783 100644
--- a/src/vs/server/node/remoteExtensionHostAgentServer.ts
+++ b/src/vs/server/node/remoteExtensionHostAgentServer.ts
@@ -551,7 +551,8 @@ class RemoteExtensionHostAgentServer extends Disposable implements IServerAPI {
const socket = net.createConnection(
{
host: host,
- port: port
+ port: port,
+ autoSelectFamily: true
}, () => {
socket.removeListener('error', e);
socket.pause();
diff --git a/src/vs/server/node/serverServices.ts b/src/vs/server/node/serverServices.ts
index d291af5dd1c..7e568185997 100644
--- a/src/vs/server/node/serverServices.ts
+++ b/src/vs/server/node/serverServices.ts
@@ -100,7 +100,7 @@ export async function setupServerServices(connectionToken: ServerConnectionToken
const logger = loggerService.createLogger('remoteagent', { name: localize('remoteExtensionLog', "Server") });
const logService = new LogService(logger, [new ServerLogger(getLogLevel(environmentService))]);
services.set(ILogService, logService);
- setTimeout(() => cleanupOlderLogs(environmentService.logsHome.fsPath).then(null, err => logService.error(err)), 10000);
+ setTimeout(() => cleanupOlderLogs(environmentService.logsHome.with({ scheme: Schemas.file }).fsPath).then(null, err => logService.error(err)), 10000);
logService.onDidChangeLogLevel(logLevel => log(logService, logLevel, `Log level changed to ${LogLevelToString(logService.getLevel())}`));
logService.trace(`Remote configuration data at ${REMOTE_DATA_FOLDER}`);
diff --git a/src/vs/workbench/api/browser/mainThreadComments.ts b/src/vs/workbench/api/browser/mainThreadComments.ts
index 29f7b613e5a..ab886d7dc8c 100644
--- a/src/vs/workbench/api/browser/mainThreadComments.ts
+++ b/src/vs/workbench/api/browser/mainThreadComments.ts
@@ -16,7 +16,7 @@ import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/ext
import { ICommentController, ICommentInfo, ICommentService, INotebookCommentInfo } from 'vs/workbench/contrib/comments/browser/commentService';
import { CommentsPanel } from 'vs/workbench/contrib/comments/browser/commentsView';
import { CommentProviderFeatures, ExtHostCommentsShape, ExtHostContext, MainContext, MainThreadCommentsShape, CommentThreadChanges } from '../common/extHost.protocol';
-import { COMMENTS_VIEW_ID, COMMENTS_VIEW_STORAGE_ID, COMMENTS_VIEW_TITLE } from 'vs/workbench/contrib/comments/browser/commentsTreeViewer';
+import { COMMENTS_VIEW_ID, COMMENTS_VIEW_STORAGE_ID, COMMENTS_VIEW_TITLE, COMMENTS_VIEW_ORIGINAL_TITLE } from 'vs/workbench/contrib/comments/browser/commentsTreeViewer';
import { ViewContainer, IViewContainersRegistry, Extensions as ViewExtensions, ViewContainerLocation, IViewsRegistry, IViewsService, IViewDescriptorService } from 'vs/workbench/common/views';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
@@ -596,7 +596,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
if (!commentsViewAlreadyRegistered) {
const VIEW_CONTAINER: ViewContainer = Registry.as(ViewExtensions.ViewContainersRegistry).registerViewContainer({
id: COMMENTS_VIEW_ID,
- title: COMMENTS_VIEW_TITLE,
+ title: { value: COMMENTS_VIEW_TITLE, original: COMMENTS_VIEW_ORIGINAL_TITLE },
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [COMMENTS_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]),
storageId: COMMENTS_VIEW_STORAGE_ID,
hideIfEmpty: true,
diff --git a/src/vs/workbench/api/browser/mainThreadEditorTabs.ts b/src/vs/workbench/api/browser/mainThreadEditorTabs.ts
index f1d2d01597f..3da6c5ed51d 100644
--- a/src/vs/workbench/api/browser/mainThreadEditorTabs.ts
+++ b/src/vs/workbench/api/browser/mainThreadEditorTabs.ts
@@ -575,7 +575,7 @@ export class MainThreadEditorTabs implements MainThreadEditorTabsShape {
if (viewColumn === SIDE_GROUP) {
direction = preferredSideBySideGroupDirection(this._configurationService);
}
- targetGroup = this._editorGroupsService.addGroup(this._editorGroupsService.groups[this._editorGroupsService.groups.length - 1], direction, undefined);
+ targetGroup = this._editorGroupsService.addGroup(this._editorGroupsService.groups[this._editorGroupsService.groups.length - 1], direction);
} else {
targetGroup = this._editorGroupsService.getGroup(groupId);
}
diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts
index 5fc7d5dc63d..23d64b26b76 100644
--- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts
+++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts
@@ -18,7 +18,7 @@ import { Extensions as ViewletExtensions, PaneCompositeRegistry } from 'vs/workb
import { CustomTreeView, RawCustomTreeViewContextKey, TreeViewPane } from 'vs/workbench/browser/parts/views/treeView';
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
-import { Extensions as ViewContainerExtensions, ICustomTreeViewDescriptor, ICustomViewDescriptor, IViewContainersRegistry, IViewDescriptor, IViewsRegistry, ResolvableTreeItem, ViewContainer, ViewContainerLocation } from 'vs/workbench/common/views';
+import { Extensions as ViewContainerExtensions, ICustomViewDescriptor, IViewContainersRegistry, IViewDescriptor, IViewsRegistry, ResolvableTreeItem, ViewContainer, ViewContainerLocation } from 'vs/workbench/common/views';
import { VIEWLET_ID as DEBUG } from 'vs/workbench/contrib/debug/common/debug';
import { VIEWLET_ID as EXPLORER } from 'vs/workbench/contrib/files/common/files';
import { VIEWLET_ID as REMOTE } from 'vs/workbench/contrib/remote/browser/remoteExplorer';
@@ -435,7 +435,8 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
viewContainer = this.viewContainersRegistry.registerViewContainer({
id,
- title, extensionId,
+ title: { value: title, original: title },
+ extensionId,
ctorDescriptor: new SyncDescriptor(
ViewPaneContainer,
[id, { mergeViewWithContainerWhenSingleView: true }]
@@ -530,14 +531,14 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
}
}
- const viewDescriptor = {
+ const viewDescriptor: ICustomViewDescriptor = {
type: type,
ctorDescriptor: type === ViewType.Tree ? new SyncDescriptor(TreeViewPane) : new SyncDescriptor(WebviewViewPane),
id: item.id,
name: item.name,
when: ContextKeyExpr.deserialize(item.when),
containerIcon: icon || viewContainer?.icon,
- containerTitle: item.contextualTitle || viewContainer?.title,
+ containerTitle: item.contextualTitle || (viewContainer && (typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value)),
canToggleVisibility: true,
canMoveView: viewContainer?.id !== REMOTE,
treeView: type === ViewType.Tree ? this.instantiationService.createInstance(CustomTreeView, item.id, item.name, extension.description.identifier.value) : undefined,
@@ -587,7 +588,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
if (removedViews.length) {
this.viewsRegistry.deregisterViews(removedViews, viewContainer);
for (const view of removedViews) {
- const anyView = view as ICustomTreeViewDescriptor;
+ const anyView = view as ICustomViewDescriptor;
if (anyView.treeView) {
anyView.treeView.dispose();
}
diff --git a/src/vs/workbench/api/common/extHostTelemetry.ts b/src/vs/workbench/api/common/extHostTelemetry.ts
index 0fb5ed2ce40..ea9d652f143 100644
--- a/src/vs/workbench/api/common/extHostTelemetry.ts
+++ b/src/vs/workbench/api/common/extHostTelemetry.ts
@@ -275,8 +275,24 @@ export class ExtHostTelemetryLogger {
if (typeof eventNameOrException === 'string') {
this.logEvent(eventNameOrException, data);
} else {
- // TODO @lramos15, implement cleaning for and logging for this case
- this._sender.sendErrorData(eventNameOrException, data);
+ const errorData = {
+ name: eventNameOrException.name,
+ message: eventNameOrException.message,
+ stack: eventNameOrException.stack,
+ cause: eventNameOrException.cause
+ };
+ const cleanedErrorData = cleanData(errorData, []);
+ // Reconstruct the error object with the cleaned data
+ const cleanedError = new Error(cleanedErrorData.message, {
+ cause: cleanedErrorData.cause
+ });
+ cleanedError.stack = cleanedErrorData.stack;
+ cleanedError.name = cleanedErrorData.name;
+ data = this.mixInCommonPropsAndCleanData(data || {});
+ if (!this._inLoggingOnlyMode) {
+ this._sender.sendErrorData(cleanedError, data);
+ }
+ this._logger.trace('exception', data);
}
}
diff --git a/src/vs/workbench/api/common/extHostTreeViews.ts b/src/vs/workbench/api/common/extHostTreeViews.ts
index 3f33b7d7b62..844b0b63eae 100644
--- a/src/vs/workbench/api/common/extHostTreeViews.ts
+++ b/src/vs/workbench/api/common/extHostTreeViews.ts
@@ -246,6 +246,9 @@ export class ExtHostTreeViews implements ExtHostTreeViewsShape {
$setVisible(treeViewId: string, isVisible: boolean): void {
const treeView = this.treeViews.get(treeViewId);
if (!treeView) {
+ if (!isVisible) {
+ return;
+ }
throw new NoTreeViewError(treeViewId);
}
treeView.setVisible(isVisible);
diff --git a/src/vs/workbench/api/node/extensionHostProcess.ts b/src/vs/workbench/api/node/extensionHostProcess.ts
index 860800e3f84..bb3cbfbca7b 100644
--- a/src/vs/workbench/api/node/extensionHostProcess.ts
+++ b/src/vs/workbench/api/node/extensionHostProcess.ts
@@ -6,7 +6,6 @@
import * as nativeWatchdog from 'native-watchdog';
import * as net from 'net';
import * as minimist from 'minimist';
-import * as dns from 'dns';
import * as performance from 'vs/base/common/performance';
import type { MessagePortMain } from 'vs/base/parts/sandbox/node/electronTypes';
import { isCancellationError, isSigPipeError, onUnexpectedError } from 'vs/base/common/errors';
@@ -47,15 +46,6 @@ interface ParsedExtHostArgs {
}
})();
-// TODO(deepak1556): Remove this once
-// https://github.com/electron/electron/pull/39376
-// is available. The following API call is needed to get our
-// remote integration tests to pass.
-(function configureDnsResultOrder() {
- // Refs https://github.com/microsoft/vscode/issues/189805
- dns.setDefaultResultOrder('ipv4first');
-})();
-
const args = minimist(process.argv.slice(2), {
boolean: [
'transformURIs',
diff --git a/src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts b/src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts
index 421d9eecd4a..f796cae8ed2 100644
--- a/src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts
+++ b/src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts
@@ -52,7 +52,7 @@ suite('MainThreadHostTreeView', function () {
const instantiationService: TestInstantiationService = workbenchInstantiationService(undefined, disposables);
const viewDescriptorService = instantiationService.createInstance(ViewDescriptorService);
instantiationService.stub(IViewDescriptorService, viewDescriptorService);
- container = Registry.as(Extensions.ViewContainersRegistry).registerViewContainer({ id: 'testContainer', title: 'test', ctorDescriptor: new SyncDescriptor({}) }, ViewContainerLocation.Sidebar);
+ container = Registry.as(Extensions.ViewContainersRegistry).registerViewContainer({ id: 'testContainer', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor({}) }, ViewContainerLocation.Sidebar);
const viewDescriptor: ITreeViewDescriptor = {
id: testTreeViewId,
ctorDescriptor: null!,
diff --git a/src/vs/workbench/browser/actions/developerActions.ts b/src/vs/workbench/browser/actions/developerActions.ts
index 91297a82197..48c3f08a46e 100644
--- a/src/vs/workbench/browser/actions/developerActions.ts
+++ b/src/vs/workbench/browser/actions/developerActions.ts
@@ -94,6 +94,7 @@ class InspectContextKeysAction extends Action2 {
interface IScreencastKeyboardOptions {
readonly showKeys?: boolean;
+ readonly showKeybindings?: boolean;
readonly showCommands?: boolean;
readonly showCommandGroups?: boolean;
readonly showSingleEditorCursorMoves?: boolean;
@@ -315,7 +316,7 @@ class ToggleScreencastModeAction extends Action2 {
append(keyboardMarker, $('span.title', {}, `${commandAndGroupLabel} `));
}
- if (options.showKeys ?? true) {
+ if ((options.showKeys ?? true) || (command && (options.showKeybindings ?? true))) {
// Fix label for arrow keys
keyLabel = keyLabel?.replace('UpArrow', '↑')
?.replace('DownArrow', '↓')
@@ -435,6 +436,11 @@ configurationRegistry.registerConfiguration({
default: true,
description: localize('screencastMode.keyboardOptions.showKeys', "Show raw keys.")
},
+ 'showKeybindings': {
+ type: 'boolean',
+ default: true,
+ description: localize('screencastMode.keyboardOptions.showKeybindings', "Show keyboard shortcuts.")
+ },
'showCommands': {
type: 'boolean',
default: true,
@@ -453,6 +459,7 @@ configurationRegistry.registerConfiguration({
},
default: {
'showKeys': true,
+ 'showKeybindings': true,
'showCommands': true,
'showCommandGroups': false,
'showSingleEditorCursorMoves': true
diff --git a/src/vs/workbench/browser/media/part.css b/src/vs/workbench/browser/media/part.css
index bec9b2a6d75..a0628d68945 100644
--- a/src/vs/workbench/browser/media/part.css
+++ b/src/vs/workbench/browser/media/part.css
@@ -82,10 +82,6 @@
display: none;
}
-.monaco-workbench .part > .title > .title-actions .action-label.codicon {
- color: inherit;
-}
-
.monaco-workbench .part > .content {
font-size: 13px;
}
diff --git a/src/vs/workbench/browser/parts/editor/editor.ts b/src/vs/workbench/browser/parts/editor/editor.ts
index 68f64a44162..23f3371411a 100644
--- a/src/vs/workbench/browser/parts/editor/editor.ts
+++ b/src/vs/workbench/browser/parts/editor/editor.ts
@@ -5,7 +5,7 @@
import { GroupIdentifier, IWorkbenchEditorConfiguration, IEditorIdentifier, IEditorCloseEvent, IEditorPartOptions, IEditorPartOptionsChangeEvent, SideBySideEditor, EditorCloseContext } from 'vs/workbench/common/editor';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
-import { IEditorGroup, GroupDirection, IAddGroupOptions, IMergeGroupOptions, GroupsOrder, GroupsArrangement } from 'vs/workbench/services/editor/common/editorGroupsService';
+import { IEditorGroup, GroupDirection, IMergeGroupOptions, GroupsOrder, GroupsArrangement } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IDisposable } from 'vs/base/common/lifecycle';
import { Dimension } from 'vs/base/browser/dom';
import { Event } from 'vs/base/common/event';
@@ -96,7 +96,7 @@ export interface IEditorGroupsAccessor {
activateGroup(identifier: IEditorGroupView | GroupIdentifier): IEditorGroupView;
restoreGroup(identifier: IEditorGroupView | GroupIdentifier): IEditorGroupView;
- addGroup(location: IEditorGroupView | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): IEditorGroupView;
+ addGroup(location: IEditorGroupView | GroupIdentifier, direction: GroupDirection): IEditorGroupView;
mergeGroup(group: IEditorGroupView | GroupIdentifier, target: IEditorGroupView | GroupIdentifier, options?: IMergeGroupOptions): IEditorGroupView;
moveGroup(group: IEditorGroupView | GroupIdentifier, location: IEditorGroupView | GroupIdentifier, direction: GroupDirection): IEditorGroupView;
diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts
index e3e5c11bfa6..bcb01677992 100644
--- a/src/vs/workbench/browser/parts/editor/editorActions.ts
+++ b/src/vs/workbench/browser/parts/editor/editorActions.ts
@@ -2263,8 +2263,27 @@ abstract class AbstractCreateEditorGroupAction extends Action2 {
override async run(accessor: ServicesAccessor): Promise {
const editorGroupService = accessor.get(IEditorGroupsService);
+ const layoutService = accessor.get(IWorkbenchLayoutService);
- editorGroupService.addGroup(editorGroupService.activeGroup, this.direction, { activate: true });
+ // We are about to create a new empty editor group. We make an opiniated
+ // decision here whether to focus that new editor group or not based
+ // on what is currently focused. If focus is outside the editor area not
+ // in the , we do not focus, with the rationale that a user might
+ // have focus on a tree/list with the intention to pick an element to
+ // open in the new group from that tree/list.
+ //
+ // If focus is inside the editor area, we want to prevent the situation
+ // of an editor having keyboard focus in an inactive editor group
+ // (see https://github.com/microsoft/vscode/issues/189256)
+
+ const focusNewGroup = layoutService.hasFocus(Parts.EDITOR_PART) || document.activeElement === document.body;
+
+ const group = editorGroupService.addGroup(editorGroupService.activeGroup, this.direction);
+ editorGroupService.activateGroup(group);
+
+ if (focusNewGroup) {
+ group.focus();
+ }
}
}
diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts
index 8b733caa867..0f868b4ad97 100644
--- a/src/vs/workbench/browser/parts/editor/editorPart.ts
+++ b/src/vs/workbench/browser/parts/editor/editorPart.ts
@@ -8,7 +8,7 @@ import { Part } from 'vs/workbench/browser/part';
import { Dimension, isAncestor, $, EventHelper, addDisposableGenericMouseDownListener } from 'vs/base/browser/dom';
import { Event, Emitter, Relay } from 'vs/base/common/event';
import { contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry';
-import { GroupDirection, IAddGroupOptions, GroupsArrangement, GroupOrientation, IMergeGroupOptions, MergeGroupMode, GroupsOrder, GroupLocation, IFindGroupScope, EditorGroupLayout, GroupLayoutArgument, IEditorGroupsService, IEditorSideGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
+import { GroupDirection, GroupsArrangement, GroupOrientation, IMergeGroupOptions, MergeGroupMode, GroupsOrder, GroupLocation, IFindGroupScope, EditorGroupLayout, GroupLayoutArgument, IEditorGroupsService, IEditorSideGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IView, orthogonal, LayoutPriority, IViewSize, Direction, SerializableGrid, Sizing, ISerializedGrid, ISerializedNode, Orientation, GridBranchNode, isGridBranchNode, GridNode, createSerializedGrid, Grid } from 'vs/base/browser/ui/grid/grid';
import { GroupIdentifier, EditorInputWithOptions, IEditorPartOptions, IEditorPartOptionsChangeEvent, GroupModelChangeKind } from 'vs/workbench/common/editor';
@@ -328,7 +328,6 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
const groupView = this.assertGroupView(group);
this.doSetGroupActive(groupView);
- this._onDidActivateGroup.fire(groupView);
return groupView;
}
@@ -512,17 +511,13 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
return false;
}
- addGroup(location: IEditorGroupView | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): IEditorGroupView {
+ addGroup(location: IEditorGroupView | GroupIdentifier, direction: GroupDirection): IEditorGroupView {
const locationView = this.assertGroupView(location);
const restoreFocus = this.shouldRestoreFocus(locationView.element);
const group = this.doAddGroup(locationView, direction);
- if (options?.activate) {
- this.doSetGroupActive(group);
- }
-
// Restore focus if we had it previously after completing the grid
// operation. That operation might cause reparenting of grid views
// which moves focus to the element otherwise.
@@ -530,6 +525,10 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
locationView.focus();
}
+ // if (options?.activate) {
+ // this.doSetGroupActive(group);
+ // }
+
return group;
}
@@ -622,27 +621,30 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
}
private doSetGroupActive(group: IEditorGroupView): void {
- if (this._activeGroup === group) {
- return; // return if this is already the active group
+ if (this._activeGroup !== group) {
+ const previousActiveGroup = this._activeGroup;
+ this._activeGroup = group;
+
+ // Update list of most recently active groups
+ this.doUpdateMostRecentActive(group, true);
+
+ // Mark previous one as inactive
+ previousActiveGroup?.setActive(false);
+
+ // Mark group as new active
+ group.setActive(true);
+
+ // Maximize the group if it is currently minimized
+ this.doRestoreGroup(group);
+
+ // Event
+ this._onDidChangeActiveGroup.fire(group);
}
- const previousActiveGroup = this._activeGroup;
- this._activeGroup = group;
-
- // Update list of most recently active groups
- this.doUpdateMostRecentActive(group, true);
-
- // Mark previous one as inactive
- previousActiveGroup?.setActive(false);
-
- // Mark group as new active
- group.setActive(true);
-
- // Maximize the group if it is currently minimized
- this.doRestoreGroup(group);
-
- // Event
- this._onDidChangeActiveGroup.fire(group);
+ // Always fire the event that a group has been activated
+ // even if its the same group that is already active to
+ // signal the intent even when nothing has changed.
+ this._onDidActivateGroup.fire(group);
}
private doRestoreGroup(group: IEditorGroupView): void {
diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
index 3272b3e4839..5d5d132b05d 100644
--- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
@@ -2077,6 +2077,10 @@ registerThemingParticipant((theme, collector) => {
outline-offset: -5px;
}
+ .monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.active:focus {
+ outline-style: dashed;
+ }
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active {
outline: 1px dotted;
outline-offset: -5px;
diff --git a/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts b/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts
index 1f3ec683798..6d02c45b4ca 100644
--- a/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts
+++ b/src/vs/workbench/browser/parts/notifications/notificationsCommands.ts
@@ -6,7 +6,7 @@
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
-import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
+import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { INotificationViewItem, isNotificationViewItem, NotificationsModel } from 'vs/workbench/common/notifications';
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { localize } from 'vs/nls';
@@ -68,9 +68,19 @@ export function getNotificationFromContext(listService: IListService, context?:
const list = listService.lastFocusedList;
if (list instanceof WorkbenchList) {
- const focusedElement = list.getFocusedElements()[0];
- if (isNotificationViewItem(focusedElement)) {
- return focusedElement;
+ let element = list.getFocusedElements()[0];
+ if (!isNotificationViewItem(element)) {
+ if (list.isDOMFocused()) {
+ // the notification list might have received focus
+ // via keyboard and might not have a focussed element.
+ // in that case just return the first element
+ // https://github.com/microsoft/vscode/issues/191705
+ element = list.element(0);
+ }
+ }
+
+ if (isNotificationViewItem(element)) {
+ return element;
}
}
@@ -80,9 +90,15 @@ export function getNotificationFromContext(listService: IListService, context?:
export function registerNotificationCommands(center: INotificationsCenterController, toasts: INotificationsToastController, model: NotificationsModel): void {
// Show Notifications Cneter
- CommandsRegistry.registerCommand(SHOW_NOTIFICATIONS_CENTER, () => {
- toasts.hide();
- center.show();
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
+ id: SHOW_NOTIFICATIONS_CENTER,
+ weight: KeybindingWeight.WorkbenchContrib,
+ when: NotificationsCenterVisibleContext.negate(),
+ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyN),
+ handler: () => {
+ toasts.hide();
+ center.show();
+ }
});
// Hide Notifications Center
diff --git a/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts b/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts
index 0be6eaf64c0..cb9d9b7ce0e 100644
--- a/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts
+++ b/src/vs/workbench/browser/parts/notifications/notificationsViewer.ts
@@ -93,7 +93,7 @@ export class NotificationsListDelegate implements IListVirtualDelegate 1 */)}px`;
// Render message into offset helper
const renderedMessage = NotificationMessageRenderer.render(notification.message);
diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts
index 5b1d769a4a4..a0aa8d51b7b 100644
--- a/src/vs/workbench/browser/workbench.contribution.ts
+++ b/src/vs/workbench/browser/workbench.contribution.ts
@@ -533,7 +533,7 @@ const registry = Registry.as(ConfigurationExtensions.Con
// Window
- let windowTitleDescription = localize('windowTitle', "Controls the window title based on the active editor. Variables are substituted based on the context:");
+ let windowTitleDescription = localize('windowTitle', "Controls the window title based on the current context such as the opened workspace or active editor. Variables are substituted based on the context:");
windowTitleDescription += '\n- ' + [
localize('activeEditorShort', "`${activeEditorShort}`: the file name (e.g. myFile.txt)."),
localize('activeEditorMedium', "`${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt)."),
@@ -583,8 +583,7 @@ const registry = Registry.as(ConfigurationExtensions.Con
},
'window.commandCenter': {
type: 'boolean',
- default: false,
- tags: ['experimental'],
+ default: true,
markdownDescription: isWeb ?
localize('window.commandCenterWeb', "Show command launcher together with the window title.") :
localize({ key: 'window.commandCenter', comment: ['{0} is a placeholder for a setting identifier.'] }, "Show command launcher together with the window title. This setting only has an effect when {0} is set to {1}.", '`#window.titleBarStyle#`', '`custom`')
diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts
index 28863e8e434..8fae627d8f6 100644
--- a/src/vs/workbench/browser/workbench.ts
+++ b/src/vs/workbench/browser/workbench.ts
@@ -342,7 +342,7 @@ export class Workbench extends Layout {
// Create Parts
for (const { id, role, classes, options } of [
- { id: Parts.TITLEBAR_PART, role: 'contentinfo', classes: ['titlebar'] },
+ { id: Parts.TITLEBAR_PART, role: 'none', classes: ['titlebar'] },
{ id: Parts.BANNER_PART, role: 'banner', classes: ['banner'] },
{ id: Parts.ACTIVITYBAR_PART, role: 'none', classes: ['activitybar', this.getSideBarPosition() === Position.LEFT ? 'left' : 'right'] }, // Use role 'none' for some parts to make screen readers less chatty #114892
{ id: Parts.SIDEBAR_PART, role: 'none', classes: ['sidebar', this.getSideBarPosition() === Position.LEFT ? 'left' : 'right'] },
diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts
index 95f89542805..8633aac784a 100644
--- a/src/vs/workbench/common/views.ts
+++ b/src/vs/workbench/common/views.ts
@@ -75,7 +75,7 @@ export interface IViewContainerDescriptor {
/**
* The title of the view container
*/
- readonly title: ILocalizedString | string;
+ readonly title: ILocalizedString;
/**
* Icon representation of the View container
@@ -300,18 +300,12 @@ export interface IViewDescriptor {
readonly openCommandActionDescriptor?: OpenCommandActionDescriptor;
}
-export interface ICustomTreeViewDescriptor extends ITreeViewDescriptor {
+export interface ICustomViewDescriptor extends IViewDescriptor {
readonly extensionId: ExtensionIdentifier;
readonly originalContainerId: string;
+ readonly treeView?: ITreeView;
}
-export interface ICustomWebviewViewDescriptor extends IViewDescriptor {
- readonly extensionId: ExtensionIdentifier;
- readonly originalContainerId: string;
-}
-
-export type ICustomViewDescriptor = ICustomTreeViewDescriptor | ICustomWebviewViewDescriptor;
-
export interface IViewDescriptorRef {
viewDescriptor: IViewDescriptor;
index: number;
diff --git a/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts b/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts
index 98e96695a64..384572c7402 100644
--- a/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts
+++ b/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts
@@ -21,8 +21,8 @@ export const accessibleViewCurrentProviderId = new RawContextKey('access
* were better to live under workbench for discoverability.
*/
export const enum AccessibilityWorkbenchSettingId {
- ViewDimUnfocusedEnabled = 'workbench.view.dimUnfocused.enabled',
- ViewDimUnfocusedOpacity = 'workbench.view.dimUnfocused.opacity'
+ DimUnfocusedEnabled = 'accessibility.dimUnfocused.enabled',
+ DimUnfocusedOpacity = 'accessibility.dimUnfocused.opacity'
}
export const enum ViewDimUnfocusedOpacityProperties {
@@ -42,7 +42,7 @@ export const enum AccessibilityVerbositySettingId {
Editor = 'accessibility.verbosity.editor',
Hover = 'accessibility.verbosity.hover',
Notification = 'accessibility.verbosity.notification',
- EditorUntitledHint = 'accessibility.verbosity.editor.untitledHint'
+ EditorUntitledHint = 'accessibility.verbosity.untitledHint'
}
export const enum AccessibleViewProviderId {
@@ -107,7 +107,7 @@ const configuration: IConfigurationNode = {
...baseProperty
},
[AccessibilityVerbositySettingId.EditorUntitledHint]: {
- description: localize('verbosity.editor.untitledhint', 'Provide information about relevant actions in an untitled text editor.'),
+ description: localize('verbosity.untitledhint', 'Provide information about relevant actions in an untitled text editor.'),
...baseProperty
}
}
@@ -120,21 +120,21 @@ export function registerAccessibilityConfiguration() {
registry.registerConfiguration({
...workbenchConfigurationNodeBase,
properties: {
- [AccessibilityWorkbenchSettingId.ViewDimUnfocusedEnabled]: {
- description: localize('dimUnfocusedEnabled', 'Whether to dim unfocused editors and terminals, making the focused view more obvious.'),
+ [AccessibilityWorkbenchSettingId.DimUnfocusedEnabled]: {
+ description: localize('dimUnfocusedEnabled', 'Whether to dim unfocused editors and terminals, which makes it more clear where typed input will go to. This works with the majority of editors with the notable exceptions of those that utilize iframes like notebooks and extension webview editors.'),
type: 'boolean',
default: false,
tags: ['accessibility'],
- scope: ConfigurationScope.MACHINE,
+ scope: ConfigurationScope.APPLICATION,
},
- [AccessibilityWorkbenchSettingId.ViewDimUnfocusedOpacity]: {
- description: localize('dimUnfocusedOpacity', 'The opacity fraction (0.2 to 1.0) to use for unfocused editors and terminals. This will only take effect when {0} is enabled.', `\`#${AccessibilityWorkbenchSettingId.ViewDimUnfocusedEnabled}#\``),
+ [AccessibilityWorkbenchSettingId.DimUnfocusedOpacity]: {
+ markdownDescription: localize('dimUnfocusedOpacity', 'The opacity fraction (0.2 to 1.0) to use for unfocused editors and terminals. This will only take effect when {0} is enabled.', `\`#${AccessibilityWorkbenchSettingId.DimUnfocusedEnabled}#\``),
type: 'number',
minimum: ViewDimUnfocusedOpacityProperties.Minimum,
maximum: ViewDimUnfocusedOpacityProperties.Maximum,
default: ViewDimUnfocusedOpacityProperties.Default,
tags: ['accessibility'],
- scope: ConfigurationScope.MACHINE,
+ scope: ConfigurationScope.APPLICATION,
}
}
});
diff --git a/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.ts b/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.ts
index 720720b02df..90544aabea6 100644
--- a/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.ts
+++ b/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.ts
@@ -258,6 +258,10 @@ function getActionsFromNotification(notification: INotificationViewItem): IActio
};
}
}
+ const manageExtension = actions?.find(a => a.label.includes('Manage Extension'));
+ if (manageExtension) {
+ manageExtension.class = ThemeIcon.asClassName(Codicon.gear);
+ }
if (actions) {
actions.push({ id: 'clearNotification', label: localize('clearNotification', "Clear Notification"), tooltip: localize('clearNotification', "Clear Notification"), run: () => notification.close(), enabled: true, class: ThemeIcon.asClassName(Codicon.clearAll) });
}
diff --git a/src/vs/workbench/contrib/accessibility/browser/accessibleView.ts b/src/vs/workbench/contrib/accessibility/browser/accessibleView.ts
index 0cc34ecd49c..1f82f5c1e9b 100644
--- a/src/vs/workbench/contrib/accessibility/browser/accessibleView.ts
+++ b/src/vs/workbench/contrib/accessibility/browser/accessibleView.ts
@@ -105,9 +105,11 @@ class AccessibleView extends Disposable {
private _accessibleViewCurrentProviderId: IContextKey;
get editorWidget() { return this._editorWidget; }
- private _editorContainer: HTMLElement;
- private _currentProvider: IAccessibleContentProvider | undefined;
+ private _container: HTMLElement;
+ private _title: HTMLElement;
private readonly _toolbar: WorkbenchToolBar;
+
+ private _currentProvider: IAccessibleContentProvider | undefined;
private _currentContent: string | undefined;
constructor(
@@ -131,12 +133,21 @@ class AccessibleView extends Disposable {
this._accessibleViewGoToSymbolSupported = accessibleViewGoToSymbolSupported.bindTo(this._contextKeyService);
this._accessibleViewCurrentProviderId = accessibleViewCurrentProviderId.bindTo(this._contextKeyService);
- this._editorContainer = document.createElement('div');
- this._editorContainer.classList.add('accessible-view');
+ this._container = document.createElement('div');
+ this._container.classList.add('accessible-view');
const codeEditorWidgetOptions: ICodeEditorWidgetOptions = {
contributions: EditorExtensionsRegistry.getEditorContributions().filter(c => c.id !== CodeActionController.ID)
};
- this._toolbar = this._register(_instantiationService.createInstance(WorkbenchToolBar, this._editorContainer, { orientation: ActionsOrientation.HORIZONTAL }));
+ const titleBar = document.createElement('div');
+ titleBar.classList.add('accessible-view-title-bar');
+ this._title = document.createElement('div');
+ this._title.classList.add('accessible-view-title');
+ titleBar.appendChild(this._title);
+ const actionBar = document.createElement('div');
+ actionBar.classList.add('accessible-view-action-bar');
+ titleBar.appendChild(actionBar);
+ this._container.appendChild(titleBar);
+ this._toolbar = this._register(_instantiationService.createInstance(WorkbenchToolBar, actionBar, { orientation: ActionsOrientation.HORIZONTAL }));
this._toolbar.context = { viewId: 'accessibleView' };
const toolbarElt = this._toolbar.getElement();
toolbarElt.tabIndex = 0;
@@ -155,7 +166,7 @@ class AccessibleView extends Disposable {
readOnly: true,
fontFamily: 'var(--monaco-monospace-font)'
};
- this._editorWidget = this._register(this._instantiationService.createInstance(CodeEditorWidget, this._editorContainer, editorOptions, codeEditorWidgetOptions));
+ this._editorWidget = this._register(this._instantiationService.createInstance(CodeEditorWidget, this._container, editorOptions, codeEditorWidgetOptions));
this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(() => {
if (this._currentProvider && this._accessiblityHelpIsShown.get()) {
this.show(this._currentProvider);
@@ -334,7 +345,6 @@ class AccessibleView extends Disposable {
message += '\n';
}
}
-
this._currentContent = message + provider.provideContent() + readMoreLink + disableHelpHint + localize('exit-tip', '\nExit this dialog via the Escape key.');
this._updateContextKeys(provider, true);
@@ -348,7 +358,7 @@ class AccessibleView extends Disposable {
return;
}
model.setLanguage(provider.options.language ?? 'markdown');
- container.appendChild(this._editorContainer);
+ container.appendChild(this._container);
let actionsHint = '';
const verbose = this._configurationService.getValue(provider.verbositySettingKey);
const hasActions = this._accessibleViewSupportsNavigation.get() || this._accessibleViewVerbosityEnabled.get() || this._accessibleViewGoToSymbolSupported.get() || this._currentProvider?.actions;
@@ -356,6 +366,7 @@ class AccessibleView extends Disposable {
actionsHint = localize('ariaAccessibleViewActions', "Use Shift+Tab to explore actions such as disabling this hint.");
}
let ariaLabel = provider.options.type === AccessibleViewType.Help ? localize('accessibility-help', "Accessibility Help") : localize('accessible-view', "Accessible View");
+ this._title.textContent = ariaLabel;
if (actionsHint && provider.options.type === AccessibleViewType.View) {
ariaLabel = localize('accessible-view-hint', "Accessible View, {0}", actionsHint);
} else if (actionsHint) {
@@ -495,9 +506,9 @@ class AccessibleView extends Disposable {
let hint = '';
const disableKeybinding = this._keybindingService.lookupKeybinding(AccessibilityCommandId.DisableVerbosityHint, this._contextKeyService)?.getAriaLabel();
if (disableKeybinding) {
- hint = localize('acessibleViewDisableHint', "Disable the aria label hint to open this ({0})", disableKeybinding);
+ hint = localize('acessibleViewDisableHint', "Disable accessibility verbosity for this feature ({0}). This will disable the hint to open the accessible view for example.\n", disableKeybinding);
} else {
- hint = localize('accessibleViewDisableHintNoKb', "Add a keybinding for the command Disable Accessible View Hint to disable this hint");
+ hint = localize('accessibleViewDisableHintNoKb', "Add a keybinding for the command Disable Accessible View Hint, which disables accessibility verbosity for this feature.\n");
}
return hint;
}
@@ -572,6 +583,7 @@ class AccessibleViewSymbolQuickPick {
}
show(provider: IAccessibleContentProvider): void {
const quickPick = this._quickInputService.createQuickPick();
+ quickPick.placeholder = localize('accessibleViewSymbolQuickPickPlaceholder', "Type to search symbols");
quickPick.title = localize('accessibleViewSymbolQuickPickTitle', "Go to Symbol Accessible View");
const picks = [];
const symbols = this._accessibleView.getSymbols();
diff --git a/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.ts b/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.ts
index 6c3034b4b05..0721b08a570 100644
--- a/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.ts
+++ b/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.ts
@@ -42,7 +42,7 @@ class AccessibleViewNextAction extends Action2 {
...accessibleViewMenu,
when: ContextKeyExpr.and(accessibleViewIsShown, accessibleViewSupportsNavigation),
}],
- icon: Codicon.chevronRight,
+ icon: Codicon.arrowDown,
title: localize('editor.action.accessibleViewNext', "Show Next in Accessible View")
});
}
@@ -62,7 +62,7 @@ class AccessibleViewPreviousAction extends Action2 {
primary: KeyMod.Alt | KeyCode.BracketLeft,
weight: KeybindingWeight.WorkbenchContrib
},
- icon: Codicon.chevronLeft,
+ icon: Codicon.arrowUp,
menu: [
commandPalette,
{
@@ -160,7 +160,7 @@ class AccessibleViewDisableHintAction extends Action2 {
primary: KeyMod.Alt | KeyCode.F6,
weight: KeybindingWeight.WorkbenchContrib
},
- icon: Codicon.treeFilterClear,
+ icon: Codicon.bellSlash,
menu: [
commandPalette,
{
diff --git a/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts b/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts
index 1dc2b4b3605..0d9c1bec943 100644
--- a/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts
+++ b/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.ts
@@ -21,21 +21,23 @@ export class UnfocusedViewDimmingContribution extends Disposable implements IWor
this._register(toDisposable(() => this._removeStyleElement()));
this._register(Event.runAndSubscribe(configurationService.onDidChangeConfiguration, e => {
- if (e && !e.affectsConfiguration(AccessibilityWorkbenchSettingId.ViewDimUnfocusedEnabled) && !e.affectsConfiguration(AccessibilityWorkbenchSettingId.ViewDimUnfocusedOpacity)) {
+ if (e && !e.affectsConfiguration(AccessibilityWorkbenchSettingId.DimUnfocusedEnabled) && !e.affectsConfiguration(AccessibilityWorkbenchSettingId.DimUnfocusedOpacity)) {
return;
}
let cssTextContent = '';
- const enabled = ensureBoolean(configurationService.getValue(AccessibilityWorkbenchSettingId.ViewDimUnfocusedEnabled), false);
+ const enabled = ensureBoolean(configurationService.getValue(AccessibilityWorkbenchSettingId.DimUnfocusedEnabled), false);
if (enabled) {
const opacity = clamp(
- ensureNumber(configurationService.getValue(AccessibilityWorkbenchSettingId.ViewDimUnfocusedOpacity), ViewDimUnfocusedOpacityProperties.Default),
+ ensureNumber(configurationService.getValue(AccessibilityWorkbenchSettingId.DimUnfocusedOpacity), ViewDimUnfocusedOpacityProperties.Default),
ViewDimUnfocusedOpacityProperties.Minimum,
ViewDimUnfocusedOpacityProperties.Maximum
);
if (opacity !== 1) {
+ // These filter rules are more specific than may be expected as the `filter`
+ // rule can cause problems if it's used inside the element like on editor hovers
const rules = new Set();
const filterRule = `filter: opacity(${opacity});`;
// Terminal tabs
@@ -44,8 +46,18 @@ export class UnfocusedViewDimmingContribution extends Disposable implements IWor
rules.add(`.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper:not(:focus-within) { ${filterRule} }`);
// Text editors
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .monaco-editor { ${filterRule} }`);
+ // Breadcrumbs
+ rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .tabs-breadcrumbs { ${filterRule} }`);
// Terminal editors
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .terminal-wrapper { ${filterRule} }`);
+ // Settings editor
+ rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .settings-editor { ${filterRule} }`);
+ // Keybindings editor
+ rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .keybindings-editor { ${filterRule} }`);
+ // Editor placeholder (error case)
+ rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .monaco-editor-pane-placeholder { ${filterRule} }`);
+ // Welcome editor
+ rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .gettingStartedContainer { ${filterRule} }`);
cssTextContent = [...rules].join('\n');
}
diff --git a/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts b/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts
index 1258f618970..888c67f46a9 100644
--- a/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts
+++ b/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts
@@ -8,7 +8,7 @@ import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { LinkedList } from 'vs/base/common/linkedList';
import { ResourceMap, ResourceSet } from 'vs/base/common/map';
import { URI } from 'vs/base/common/uri';
-import { ICodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';
+import { ICodeEditor, isCodeEditor, isDiffEditor } from 'vs/editor/browser/editorBrowser';
import { IBulkEditOptions, IBulkEditPreviewHandler, IBulkEditResult, IBulkEditService, ResourceEdit, ResourceFileEdit, ResourceTextEdit } from 'vs/editor/browser/services/bulkEditService';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
import { WorkspaceEdit } from 'vs/editor/common/languages';
@@ -197,6 +197,8 @@ export class BulkEditService implements IBulkEditService {
const candidate = this._editorService.activeTextEditorControl;
if (isCodeEditor(candidate)) {
codeEditor = candidate;
+ } else if (isDiffEditor(candidate)) {
+ codeEditor = candidate.getModifiedEditor();
}
}
diff --git a/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts b/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts
index c21f9e7f6c6..9f895d8b8a7 100644
--- a/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts
+++ b/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts
@@ -18,6 +18,7 @@ import { ResourceFileEdit } from 'vs/editor/browser/services/bulkEditService';
import { CancellationToken } from 'vs/base/common/cancellation';
import { tail } from 'vs/base/common/arrays';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
+import { Schemas } from 'vs/base/common/network';
interface IFileOperation {
uris: URI[];
@@ -173,6 +174,9 @@ class CreateOperation implements IFileOperation {
const undoes: DeleteEdit[] = [];
for (const edit of this._edits) {
+ if (edit.newUri.scheme === Schemas.untitled) {
+ continue; // ignore, will be handled by a later edit
+ }
if (edit.options.overwrite === undefined && edit.options.ignoreIfExists && await this._fileService.exists(edit.newUri)) {
continue; // not overwriting, but ignoring, and the target file exists
}
diff --git a/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts b/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts
index 2c3c2a6d72e..ff63502983b 100644
--- a/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts
+++ b/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts
@@ -326,7 +326,7 @@ const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codic
const container = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: BulkEditPane.ID,
- title: localize('panel', "Refactor Preview"),
+ title: { value: localize('panel', "Refactor Preview"), original: 'Refactor Preview' },
hideIfEmpty: true,
ctorDescriptor: new SyncDescriptor(
ViewPaneContainer,
diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts
index 3761e137dc5..8439a5d14fd 100644
--- a/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts
+++ b/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts
@@ -11,8 +11,10 @@ import { ServicesAccessor } from 'vs/editor/browser/editorExtensions';
import { IBulkEditService, ResourceTextEdit } from 'vs/editor/browser/services/bulkEditService';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import { Range } from 'vs/editor/common/core/range';
+import { RelatedContextItem, WorkspaceEdit } from 'vs/editor/common/languages';
import { ILanguageService } from 'vs/editor/common/languages/language';
import { ITextModel } from 'vs/editor/common/model';
+import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';
import { CopyAction } from 'vs/editor/contrib/clipboard/browser/clipboard';
import { localize } from 'vs/nls';
import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions';
@@ -31,8 +33,6 @@ import { CellKind, NOTEBOOK_EDITOR_ID } from 'vs/workbench/contrib/notebook/comm
import { ITerminalEditorService, ITerminalGroupService, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
-import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';
-import { WorkspaceEdit, RelatedContextItem } from 'vs/editor/common/languages';
export interface IChatCodeBlockActionContext {
code: string;
@@ -92,6 +92,11 @@ export function registerChatCodeBlockActions() {
return;
}
+ if (context.element.errorDetails?.responseIsFiltered) {
+ // When run from command palette
+ return;
+ }
+
const clipboardService = accessor.get(IClipboardService);
clipboardService.writeText(context.code);
@@ -183,6 +188,11 @@ export function registerChatCodeBlockActions() {
const editorService = accessor.get(IEditorService);
const textFileService = accessor.get(ITextFileService);
+ if (context.element.errorDetails?.responseIsFiltered) {
+ // When run from command palette
+ return;
+ }
+
if (editorService.activeEditorPane?.getId() === NOTEBOOK_EDITOR_ID) {
return this.handleNotebookEditor(accessor, editorService.activeEditorPane.getControl() as INotebookEditor, context);
}
@@ -312,6 +322,11 @@ export function registerChatCodeBlockActions() {
}
override async runWithContext(accessor: ServicesAccessor, context: IChatCodeBlockActionContext) {
+ if (context.element.errorDetails?.responseIsFiltered) {
+ // When run from command palette
+ return;
+ }
+
const editorService = accessor.get(IEditorService);
const chatService = accessor.get(IChatService);
editorService.openEditor({ contents: context.code, languageId: context.languageId, resource: undefined });
@@ -358,6 +373,11 @@ export function registerChatCodeBlockActions() {
}
override async runWithContext(accessor: ServicesAccessor, context: IChatCodeBlockActionContext) {
+ if (context.element.errorDetails?.responseIsFiltered) {
+ // When run from command palette
+ return;
+ }
+
const chatService = accessor.get(IChatService);
const terminalService = accessor.get(ITerminalService);
const editorService = accessor.get(IEditorService);
diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts
index 1b26cbba32b..6d7a399b006 100644
--- a/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts
+++ b/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts
@@ -15,7 +15,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
import { ResourceNotebookCellEdit } from 'vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
import { CHAT_CATEGORY } from 'vs/workbench/contrib/chat/browser/actions/chatActions';
import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat';
-import { CONTEXT_IN_CHAT_INPUT, CONTEXT_IN_CHAT_SESSION, CONTEXT_REQUEST, CONTEXT_RESPONSE, CONTEXT_RESPONSE_VOTE } from 'vs/workbench/contrib/chat/common/chatContextKeys';
+import { CONTEXT_IN_CHAT_INPUT, CONTEXT_IN_CHAT_SESSION, CONTEXT_REQUEST, CONTEXT_RESPONSE, CONTEXT_RESPONSE_FILTERED, CONTEXT_RESPONSE_VOTE } from 'vs/workbench/contrib/chat/common/chatContextKeys';
import { IChatService, IChatUserActionEvent, InteractiveSessionVoteDirection } from 'vs/workbench/contrib/chat/common/chatService';
import { isRequestVM, isResponseVM } from 'vs/workbench/contrib/chat/common/chatViewModel';
import { INotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
@@ -104,44 +104,6 @@ export function registerChatTitleActions() {
}
});
- registerAction2(class MentionAction extends Action2 {
- constructor() {
- super({
- id: 'workbench.action.chat.mention',
- title: {
- value: localize('interactive.mention.label', "Mention"),
- original: 'Mention'
- },
- f1: false,
- category: CHAT_CATEGORY,
- icon: Codicon.add,
- menu: {
- id: MenuId.ChatMessageTitle,
- group: 'navigation',
- order: 3,
- when: CONTEXT_RESPONSE
- }
- });
- }
-
- run(accessor: ServicesAccessor, ...args: any[]) {
- const item = args[0];
- if (!isResponseVM(item)) {
- return;
- }
-
- const chatWidgetService = accessor.get(IChatWidgetService);
- const widget = chatWidgetService.lastFocusedWidget!;
- const num = widget.viewModel!.getItems()
- .filter(isResponseVM)
- .indexOf(item) + 1;
- widget.inputEditor.setValue(`${widget.inputEditor.getValue()} @response:${num} `);
- const lastLine = widget.inputEditor.getModel()!.getLineCount();
- const lastCol = widget.inputEditor.getModel()!.getLineLength(lastLine);
- widget.inputEditor.setSelection({ startColumn: lastCol, endColumn: lastCol, startLineNumber: lastLine, endLineNumber: lastLine });
- }
- });
-
registerAction2(class InsertToNotebookAction extends Action2 {
constructor() {
super({
@@ -157,7 +119,7 @@ export function registerChatTitleActions() {
id: MenuId.ChatMessageTitle,
group: 'navigation',
isHiddenByDefault: true,
- when: ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, CONTEXT_RESPONSE)
+ when: ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, CONTEXT_RESPONSE, CONTEXT_RESPONSE_FILTERED.negate())
}
});
}
diff --git a/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.ts b/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.ts
index 000bc774029..aa774249863 100644
--- a/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.ts
+++ b/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.ts
@@ -106,12 +106,15 @@ export class ChatContributionService implements IChatContributionService {
}
private registerChatProvider(extension: Readonly, providerDescriptor: IRawChatProviderContribution): IDisposable {
+ const icon = providerDescriptor.icon ? resources.joinPath(extension.extensionLocation, providerDescriptor.icon) : Codicon.commentDiscussion;
+ const title = localize('chat.viewContainer.label', "Chat");
+
// Register View Container
const viewContainerId = CHAT_SIDEBAR_PANEL_ID + '.' + providerDescriptor.id;
const viewContainer: ViewContainer = Registry.as(ViewExtensions.ViewContainersRegistry).registerViewContainer({
id: viewContainerId,
- title: localize('chat.viewContainer.label', "Chat"),
- icon: providerDescriptor.icon ? resources.joinPath(extension.extensionLocation, providerDescriptor.icon) : Codicon.commentDiscussion,
+ title: { value: title, original: 'Chat' },
+ icon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [viewContainerId, { mergeViewWithContainerWhenSingleView: true }]),
storageId: viewContainerId,
hideIfEmpty: true,
@@ -122,6 +125,8 @@ export class ChatContributionService implements IChatContributionService {
const viewId = this.getViewIdForProvider(providerDescriptor.id);
const viewDescriptor: IViewDescriptor[] = [{
id: viewId,
+ containerIcon: icon,
+ containerTitle: title,
name: providerDescriptor.label,
canToggleVisibility: false,
canMoveView: true,
diff --git a/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts b/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts
index 1208e6134c3..ebb17cc541f 100644
--- a/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts
+++ b/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts
@@ -61,7 +61,7 @@ import { IChatCodeBlockActionContext } from 'vs/workbench/contrib/chat/browser/a
import { ChatTreeItem, IChatCodeBlockInfo, IChatFileTreeInfo } from 'vs/workbench/contrib/chat/browser/chat';
import { ChatFollowups } from 'vs/workbench/contrib/chat/browser/chatFollowups';
import { ChatEditorOptions } from 'vs/workbench/contrib/chat/browser/chatOptions';
-import { CONTEXT_REQUEST, CONTEXT_RESPONSE, CONTEXT_RESPONSE_HAS_PROVIDER_ID, CONTEXT_RESPONSE_VOTE } from 'vs/workbench/contrib/chat/common/chatContextKeys';
+import { CONTEXT_REQUEST, CONTEXT_RESPONSE, CONTEXT_RESPONSE_FILTERED, CONTEXT_RESPONSE_HAS_PROVIDER_ID, CONTEXT_RESPONSE_VOTE } from 'vs/workbench/contrib/chat/common/chatContextKeys';
import { IChatReplyFollowup, IChatResponseProgressFileTreeData, IChatService, ISlashCommand, InteractiveSessionVoteDirection } from 'vs/workbench/contrib/chat/common/chatService';
import { IChatResponseMarkdownRenderData, IChatResponseRenderData, IChatResponseViewModel, IChatWelcomeMessageViewModel, isRequestVM, isResponseVM, isWelcomeVM } from 'vs/workbench/contrib/chat/common/chatViewModel';
import { IWordCountResult, getNWords } from 'vs/workbench/contrib/chat/common/chatWordCounter';
@@ -268,10 +268,13 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer {
this._onDidChangeItemHeight.fire({ element, height: templateData.rowContainer.offsetHeight });
}));
+ treeDisposables.add(tree.onContextMenu((e) => {
+ e.browserEvent.preventDefault();
+ e.browserEvent.stopPropagation();
+ }));
tree.setInput(data).then(() => {
if (!ref.isStale()) {
@@ -969,6 +977,12 @@ class CodeBlockPart extends Disposable implements IChatResultCodeBlockPart {
element: data.element,
languageId: vscodeLanguageId
};
+
+ if (isResponseVM(data.element) && data.element.errorDetails?.responseIsFiltered) {
+ dom.hide(this.toolbar.getElement());
+ } else {
+ dom.show(this.toolbar.getElement());
+ }
}
private fixCodeText(text: string, languageId: string): string {
@@ -1190,7 +1204,8 @@ class ChatListTreeRenderer implements ICompressibleTreeRenderer, index: number, templateData: IChatListTreeRendererTemplate, height: number | undefined): void {
templateData.label.element.style.display = 'flex';
- if (!element.children.length) {
+ const hasExtension = /\.[^/.]+$/.test(element.element.label);
+ if (!element.children.length && hasExtension) {
templateData.label.setFile(element.element.uri, {
fileKind: FileKind.FILE,
hidePath: true,
diff --git a/src/vs/workbench/contrib/chat/browser/chatQuick.ts b/src/vs/workbench/contrib/chat/browser/chatQuick.ts
index 32b6ca797fd..5c41a1a6f7e 100644
--- a/src/vs/workbench/contrib/chat/browser/chatQuick.ts
+++ b/src/vs/workbench/contrib/chat/browser/chatQuick.ts
@@ -5,12 +5,14 @@
import * as dom from 'vs/base/browser/dom';
import { Orientation, Sash } from 'vs/base/browser/ui/sash/sash';
+import { disposableTimeout } from 'vs/base/common/async';
import { CancellationToken } from 'vs/base/common/cancellation';
import { Emitter } from 'vs/base/common/event';
-import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
+import { Disposable, DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
+import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { IQuickInputService, IQuickWidget } from 'vs/platform/quickinput/common/quickInput';
import { inputBackground, quickInputBackground, quickInputForeground } from 'vs/platform/theme/common/colorRegistry';
import { IChatWidgetService, IQuickChatService } from 'vs/workbench/contrib/chat/browser/chat';
@@ -26,7 +28,7 @@ export class QuickChatService extends Disposable implements IQuickChatService {
readonly onDidClose = this._onDidClose.event;
private _input: IQuickWidget | undefined;
- // TODO: support multiple chat providers eventually
+ // TODO@TylerLeonhardt: support multiple chat providers eventually
private _currentChat: QuickChat | undefined;
private _container: HTMLElement | undefined;
@@ -58,8 +60,9 @@ export class QuickChatService extends Disposable implements IQuickChatService {
this.open(providerId, query);
}
}
+
open(providerId?: string, query?: string | undefined): void {
- if (this.focused) {
+ if (this._input) {
return this.focus();
}
@@ -90,10 +93,13 @@ export class QuickChatService extends Disposable implements IQuickChatService {
// show needs to come after the quickpick is shown
this._currentChat.render(this._container);
+ } else {
+ this._currentChat.show();
}
disposableStore.add(this._input.onDidHide(() => {
disposableStore.dispose();
+ this._currentChat!.hide();
this._input = undefined;
this._onDidClose.fire();
}));
@@ -119,17 +125,24 @@ export class QuickChatService extends Disposable implements IQuickChatService {
}
class QuickChat extends Disposable {
+ // TODO@TylerLeonhardt: be responsive to window size
+ static DEFAULT_MIN_HEIGHT = 200;
+ private static readonly DEFAULT_HEIGHT_OFFSET = 100;
+
private widget!: ChatWidget;
private sash!: Sash;
private model: ChatModel | undefined;
private _currentQuery: string | undefined;
+ private maintainScrollTimer: MutableDisposable = this._register(new MutableDisposable());
+ private _deferUpdatingDynamicLayout: boolean = false;
constructor(
private readonly _options: IChatViewOptions,
@IInstantiationService private readonly instantiationService: IInstantiationService,
@IContextKeyService private readonly contextKeyService: IContextKeyService,
@IChatService private readonly chatService: IChatService,
- @IChatWidgetService private readonly _chatWidgetService: IChatWidgetService
+ @IChatWidgetService private readonly _chatWidgetService: IChatWidgetService,
+ @ILayoutService private readonly layoutService: ILayoutService
) {
super();
}
@@ -156,6 +169,30 @@ class QuickChat extends Disposable {
}
}
+ hide(): void {
+ this.widget.setVisible(false);
+ // Maintain scroll position for a short time so that if the user re-shows the chat
+ // the same scroll position will be used.
+ this.maintainScrollTimer.value = disposableTimeout(() => {
+ // At this point, clear this mutable disposable which will be our signal that
+ // the timer has expired and we should stop maintaining scroll position
+ this.maintainScrollTimer.clear();
+ }, 30 * 1000); // 30 seconds
+ }
+
+ show(): void {
+ this.widget.setVisible(true);
+ // If the mutable disposable is set, then we are keeping the existing scroll position
+ // so we should not update the layout.
+ if (this._deferUpdatingDynamicLayout) {
+ this._deferUpdatingDynamicLayout = false;
+ this.widget.updateDynamicChatTreeItemLayout(2, this.maxHeight);
+ }
+ if (!this.maintainScrollTimer.value) {
+ this.widget.layoutDynamicChatTreeItemMode();
+ }
+ }
+
render(parent: HTMLElement): void {
if (this.widget) {
throw new Error('Cannot render quick chat twice');
@@ -178,26 +215,47 @@ class QuickChat extends Disposable {
}));
this.widget.render(parent);
this.widget.setVisible(true);
- this.widget.setDynamicChatTreeItemLayout(2, 900);
+ this.widget.setDynamicChatTreeItemLayout(2, this.maxHeight);
this.updateModel();
this.sash = this._register(new Sash(parent, { getHorizontalSashTop: () => parent.offsetHeight }, { orientation: Orientation.HORIZONTAL }));
this.registerListeners(parent);
}
+ private get maxHeight(): number {
+ return this.layoutService.dimension.height - QuickChat.DEFAULT_HEIGHT_OFFSET;
+ }
+
private registerListeners(parent: HTMLElement): void {
+ this._register(this.layoutService.onDidLayout(() => {
+ if (this.widget.visible) {
+ this.widget.updateDynamicChatTreeItemLayout(2, this.maxHeight);
+ } else {
+ // If the chat is not visible, then we should defer updating the layout
+ // because it relies on offsetHeight which only works correctly
+ // when the chat is visible.
+ this._deferUpdatingDynamicLayout = true;
+ }
+ }));
this._register(this.widget.inputEditor.onDidChangeModelContent((e) => {
this._currentQuery = this.widget.inputEditor.getValue();
}));
this._register(this.widget.onDidClear(() => this.clear()));
this._register(this.widget.onDidChangeHeight((e) => this.sash.layout()));
const width = parent.offsetWidth;
+ this._register(this.sash.onDidStart(() => {
+ this.widget.isDynamicChatTreeItemLayoutEnabled = false;
+ }));
this._register(this.sash.onDidChange((e) => {
- if (e.currentY < 200) {
+ if (e.currentY < QuickChat.DEFAULT_MIN_HEIGHT || e.currentY > this.maxHeight) {
return;
}
this.widget.layout(e.currentY, width);
this.sash.layout();
}));
+ this._register(this.sash.onDidReset(() => {
+ this.widget.isDynamicChatTreeItemLayoutEnabled = true;
+ this.widget.layoutDynamicChatTreeItemMode();
+ }));
}
async acceptInput(): Promise {
diff --git a/src/vs/workbench/contrib/chat/browser/chatWidget.ts b/src/vs/workbench/contrib/chat/browser/chatWidget.ts
index 500ff2b372b..91c15635f2e 100644
--- a/src/vs/workbench/contrib/chat/browser/chatWidget.ts
+++ b/src/vs/workbench/contrib/chat/browser/chatWidget.ts
@@ -77,9 +77,12 @@ export class ChatWidget extends Disposable implements IChatWidget {
private container!: HTMLElement;
private bodyDimension: dom.Dimension | undefined;
- private visible = false;
private visibleChangeCount = 0;
private requestInProgress: IContextKey;
+ private _visible = false;
+ public get visible() {
+ return this._visible;
+ }
private previousTreeScrollHeight: number = 0;
@@ -207,11 +210,14 @@ export class ChatWidget extends Disposable implements IChatWidget {
}
clear(): void {
+ if (this._dynamicMessageLayoutData) {
+ this._dynamicMessageLayoutData.enabled = true;
+ }
this._onDidClear.fire();
}
- private onDidChangeItems() {
- if (this.tree && this.visible) {
+ private onDidChangeItems(skipDynamicLayout?: boolean) {
+ if (this.tree && this._visible) {
const treeItems = (this.viewModel?.getItems() ?? [])
.map(item => {
return >{
@@ -236,7 +242,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
}
});
- if (this._dynamicMessageLayoutData) {
+ if (!skipDynamicLayout && this._dynamicMessageLayoutData) {
this.layoutDynamicChatTreeItemMode();
}
@@ -258,7 +264,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
}
setVisible(visible: boolean): void {
- this.visible = visible;
+ this._visible = visible;
this.visibleChangeCount++;
this.renderer.setVisible(visible);
@@ -266,8 +272,8 @@ export class ChatWidget extends Disposable implements IChatWidget {
this._register(disposableTimeout(() => {
// Progressive rendering paused while hidden, so start it up again.
// Do it after a timeout because the container is not visible yet (it should be but offsetHeight returns 0 here)
- if (this.visible) {
- this.onDidChangeItems();
+ if (this._visible) {
+ this.onDidChangeItems(true);
}
}, 0));
}
@@ -525,17 +531,23 @@ export class ChatWidget extends Disposable implements IChatWidget {
this._onDidChangeHeight.fire(height);
}
- private _dynamicMessageLayoutData?: { numOfMessages: number; maxHeight: number };
+ private _dynamicMessageLayoutData?: { numOfMessages: number; maxHeight: number; enabled: boolean };
// An alternative to layout, this allows you to specify the number of ChatTreeItems
// you want to show, and the max height of the container. It will then layout the
// tree to show that many items.
+ // TODO@TylerLeonhardt: This could use some refactoring to make it clear which layout strategy is being used
setDynamicChatTreeItemLayout(numOfChatTreeItems: number, maxHeight: number) {
- this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight };
+ this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight, enabled: true };
this._register(this.renderer.onDidChangeItemHeight(() => this.layoutDynamicChatTreeItemMode()));
const mutableDisposable = this._register(new MutableDisposable());
this._register(this.tree.onDidScroll((e) => {
+ // TODO@TylerLeonhardt this should probably just be disposed when this is disabled
+ // and then set up again when it is enabled again
+ if (!this._dynamicMessageLayoutData?.enabled) {
+ return;
+ }
mutableDisposable.value = dom.scheduleAtNextAnimationFrame(() => {
if (!e.scrollTopChanged || e.heightChanged || e.scrollHeightChanged) {
return;
@@ -546,19 +558,52 @@ export class ChatWidget extends Disposable implements IChatWidget {
return;
}
- const newHeight = Math.min(renderHeight + diff, maxHeight);
+ const possibleMaxHeight = (this._dynamicMessageLayoutData?.maxHeight ?? maxHeight);
const width = this.bodyDimension?.width ?? this.container.offsetWidth;
- const inputPartHeight = this.inputPart.layout(newHeight, width);
+ const inputPartHeight = this.inputPart.layout(possibleMaxHeight, width);
+ const newHeight = Math.min(renderHeight + diff, possibleMaxHeight - inputPartHeight);
this.layout(newHeight + inputPartHeight, width);
});
}));
}
- layoutDynamicChatTreeItemMode(): void {
- if (!this.viewModel) {
+ updateDynamicChatTreeItemLayout(numOfChatTreeItems: number, maxHeight: number) {
+ this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight, enabled: true };
+ let hasChanged = false;
+ let height = this.bodyDimension!.height;
+ let width = this.bodyDimension!.width;
+ if (maxHeight < this.bodyDimension!.height) {
+ height = maxHeight;
+ hasChanged = true;
+ }
+ const containerWidth = this.container.offsetWidth;
+ if (this.bodyDimension?.width !== containerWidth) {
+ width = containerWidth;
+ hasChanged = true;
+ }
+ if (hasChanged) {
+ this.layout(height, width);
+ }
+ }
+
+ get isDynamicChatTreeItemLayoutEnabled(): boolean {
+ return this._dynamicMessageLayoutData?.enabled ?? false;
+ }
+
+ set isDynamicChatTreeItemLayoutEnabled(value: boolean) {
+ if (!this._dynamicMessageLayoutData) {
return;
}
- const inputHeight = this.inputPart.layout(this._dynamicMessageLayoutData!.maxHeight, this.container.offsetWidth);
+ this._dynamicMessageLayoutData.enabled = value;
+ }
+
+ layoutDynamicChatTreeItemMode(): void {
+ if (!this.viewModel || !this._dynamicMessageLayoutData?.enabled) {
+ return;
+ }
+
+ const width = this.bodyDimension?.width ?? this.container.offsetWidth;
+ const inputHeight = this.inputPart.layout(this._dynamicMessageLayoutData!.maxHeight, width);
const totalMessages = this.viewModel.getItems();
// grab the last N messages
@@ -575,10 +620,10 @@ export class ChatWidget extends Disposable implements IChatWidget {
inputHeight + listHeight + (totalMessages.length > 2 ? 18 : 0),
this._dynamicMessageLayoutData!.maxHeight
),
- this.container.offsetWidth
+ width
);
- if (needsRerender) {
+ if (needsRerender || !listHeight) {
// TODO: figure out a better place to reveal the last element
revealLastElement(this.tree);
}
diff --git a/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts b/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts
index 9ef0f6b1601..d4ff01aec83 100644
--- a/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts
+++ b/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { CancellationToken } from 'vs/base/common/cancellation';
+import { Iterable } from 'vs/base/common/iterator';
import { Disposable } from 'vs/base/common/lifecycle';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import { Position } from 'vs/editor/common/core/position';
@@ -24,7 +25,7 @@ import { ChatInputPart } from 'vs/workbench/contrib/chat/browser/chatInputPart';
import { SlashCommandContentWidget } from 'vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget';
import { ChatWidget } from 'vs/workbench/contrib/chat/browser/chatWidget';
import { chatSlashCommandBackground, chatSlashCommandForeground } from 'vs/workbench/contrib/chat/common/chatColors';
-import { IChatService } from 'vs/workbench/contrib/chat/common/chatService';
+import { IChatService, ISlashCommand } from 'vs/workbench/contrib/chat/common/chatService';
import { IChatVariablesService } from 'vs/workbench/contrib/chat/common/chatVariables';
import { isResponseVM } from 'vs/workbench/contrib/chat/common/chatViewModel';
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
@@ -44,6 +45,7 @@ class InputEditorDecorations extends Disposable {
@ICodeEditorService private readonly codeEditorService: ICodeEditorService,
@IThemeService private readonly themeService: IThemeService,
@IChatService private readonly chatService: IChatService,
+ @IChatVariablesService private readonly chatVariablesService: IChatVariablesService,
) {
super();
@@ -175,21 +177,22 @@ class InputEditorDecorations extends Disposable {
this.widget.inputEditor.setDecorationsByType(decorationDescription, slashCommandTextDecorationType, []);
}
- // const variables = this.chatVariablesService.getVariables();
+ const variables = this.chatVariablesService.getVariables();
const variableReg = /(^|\s)@(\w+)(:\d+)?(?=(\s|$))/ig;
let match: RegExpMatchArray | null;
const varDecorations: IDecorationOptions[] = [];
while (match = variableReg.exec(inputValue)) {
- // const candidate = match[2];
- // if (Iterable.find(variables, v => v.name === candidate))
- varDecorations.push({
- range: {
- startLineNumber: 1,
- endLineNumber: 1,
- startColumn: match.index! + match[1].length + 1,
- endColumn: match.index! + match[0].length + 1
- }
- });
+ const varName = match[2];
+ if (Iterable.find(variables, v => v.name === varName)) {
+ varDecorations.push({
+ range: {
+ startLineNumber: 1,
+ endLineNumber: 1,
+ startColumn: match.index! + match[1].length + 1,
+ endColumn: match.index! + match[0].length + 1
+ }
+ });
+ }
}
this.widget.inputEditor.setDecorationsByType(decorationDescription, variableTextDecorationType, varDecorations);
@@ -253,14 +256,14 @@ class SlashCommandCompletions extends Disposable {
}
return {
- suggestions: slashCommands.map(c => {
+ suggestions: sortSlashCommandsByYieldTo(slashCommands).map((c, i) => {
const withSlash = `/${c.command}`;
return {
label: withSlash,
insertText: c.executeImmediately ? '' : `${withSlash} `,
detail: c.detail,
range: new Range(1, 1, 1, 1),
- sortText: c.sortText ?? c.command,
+ sortText: c.sortText ?? 'a'.repeat(i + 1),
kind: CompletionItemKind.Text, // The icons are disabled here anyway,
command: c.executeImmediately ? { id: SubmitAction.ID, title: withSlash, arguments: [{ widget, inputValue: `${withSlash} ` }] } : undefined,
};
@@ -271,6 +274,79 @@ class SlashCommandCompletions extends Disposable {
}
}
+interface SlashCommandYieldTo {
+ command: string;
+}
+
+// Adapted from https://github.com/microsoft/vscode/blob/ca2c1636f87ea4705f32345c2e348e815996e129/src/vs/editor/contrib/dropOrPasteInto/browser/edit.ts#L31-L99
+function sortSlashCommandsByYieldTo;
+}>(slashCommands: readonly T[]): T[] {
+ function yieldsTo(yTo: SlashCommandYieldTo, other: T): boolean {
+ return 'command' in yTo && other.command === yTo.command;
+ }
+
+ // Build list of nodes each node yields to
+ const yieldsToMap = new Map();
+ for (const slashCommand of slashCommands) {
+ for (const yTo of slashCommand.yieldsTo ?? []) {
+ for (const other of slashCommands) {
+ if (other.command === slashCommand.command) {
+ continue;
+ }
+
+ if (yieldsTo(yTo, other)) {
+ let arr = yieldsToMap.get(slashCommand);
+ if (!arr) {
+ arr = [];
+ yieldsToMap.set(slashCommand, arr);
+ }
+ arr.push(other);
+ }
+ }
+ }
+ }
+
+ if (!yieldsToMap.size) {
+ return Array.from(slashCommands);
+ }
+
+ // Topological sort
+ const visited = new Set();
+ const tempStack: T[] = [];
+
+ function visit(nodes: T[]): T[] {
+ if (!nodes.length) {
+ return [];
+ }
+
+ const node = nodes[0];
+ if (tempStack.includes(node)) {
+ console.warn(`Yield to cycle detected for ${node.command}`);
+ return nodes;
+ }
+
+ if (visited.has(node)) {
+ return visit(nodes.slice(1));
+ }
+
+ let pre: T[] = [];
+ const yTo = yieldsToMap.get(node);
+ if (yTo) {
+ tempStack.push(node);
+ pre = visit(yTo);
+ tempStack.pop();
+ }
+
+ visited.add(node);
+
+ return [...pre, node, ...visit(nodes.slice(1))];
+ }
+
+ return visit(Array.from(slashCommands));
+}
+
Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(SlashCommandCompletions, LifecyclePhase.Eventually);
class VariableCompletions extends Disposable {
diff --git a/src/vs/workbench/contrib/chat/browser/media/chat.css b/src/vs/workbench/contrib/chat/browser/media/chat.css
index 60b78970f75..eb1c33b9fa6 100644
--- a/src/vs/workbench/contrib/chat/browser/media/chat.css
+++ b/src/vs/workbench/contrib/chat/browser/media/chat.css
@@ -238,7 +238,7 @@
.interactive-session .interactive-input-and-side-toolbar {
display: flex;
- gap: 6px;
+ gap: 4px;
align-items: center;
}
@@ -427,6 +427,12 @@
.quick-input-widget .interactive-session .interactive-input-and-execute-toolbar {
margin: 0;
border-radius: 2px;
+ padding: 0 4px 0 6px;
+}
+
+.quick-input-widget .interactive-list {
+ border-bottom-right-radius: 6px;
+ border-bottom-left-radius: 6px;
}
/* #endregion */
diff --git a/src/vs/workbench/contrib/chat/common/chatContextKeys.ts b/src/vs/workbench/contrib/chat/common/chatContextKeys.ts
index 7509c369304..631f0af7d00 100644
--- a/src/vs/workbench/contrib/chat/common/chatContextKeys.ts
+++ b/src/vs/workbench/contrib/chat/common/chatContextKeys.ts
@@ -8,6 +8,7 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
export const CONTEXT_RESPONSE_HAS_PROVIDER_ID = new RawContextKey('chatSessionResponseHasProviderId', false, { type: 'boolean', description: localize('interactiveSessionResponseHasProviderId', "True when the provider has assigned an id to this response.") });
export const CONTEXT_RESPONSE_VOTE = new RawContextKey('chatSessionResponseVote', '', { type: 'string', description: localize('interactiveSessionResponseVote', "When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.") });
+export const CONTEXT_RESPONSE_FILTERED = new RawContextKey('chatSessionResponseFiltered', false, { type: 'boolean', description: localize('chatResponseFiltered', "True when the chat response was filtered out by the server.") });
export const CONTEXT_CHAT_REQUEST_IN_PROGRESS = new RawContextKey('chatSessionRequestInProgress', false, { type: 'boolean', description: localize('interactiveSessionRequestInProgress', "True when the current request is still in progress.") });
export const CONTEXT_RESPONSE = new RawContextKey('chatResponse', false, { type: 'boolean', description: localize('chatResponse', "The chat item is a response.") });
diff --git a/src/vs/workbench/contrib/chat/common/chatModel.ts b/src/vs/workbench/contrib/chat/common/chatModel.ts
index 23fec163a79..5f51abedb9a 100644
--- a/src/vs/workbench/contrib/chat/common/chatModel.ts
+++ b/src/vs/workbench/contrib/chat/common/chatModel.ts
@@ -160,6 +160,7 @@ export class Response implements IResponse {
});
} else if (isCompleteInteractiveProgressTreeData(responsePart)) {
this._responseParts.push(responsePart);
+ this._updateRepr(quiet);
}
}
diff --git a/src/vs/workbench/contrib/chat/common/chatService.ts b/src/vs/workbench/contrib/chat/common/chatService.ts
index 9039dfb5150..39fb93a4739 100644
--- a/src/vs/workbench/contrib/chat/common/chatService.ts
+++ b/src/vs/workbench/contrib/chat/common/chatService.ts
@@ -90,6 +90,11 @@ export interface ISlashCommand {
* Has no effect if `shouldRepopulate` is `false`.
*/
followupPlaceholder?: string;
+ /**
+ * The slash command(s) that this command wants to be
+ * deprioritized in favor of.
+ */
+ yieldsTo?: ReadonlyArray<{ readonly command: string }>;
}
export interface IChatReplyFollowup {
diff --git a/src/vs/workbench/contrib/chat/electron-sandbox/actions/media/voiceChatActions.css b/src/vs/workbench/contrib/chat/electron-sandbox/actions/media/voiceChatActions.css
new file mode 100644
index 00000000000..b081c2c8d2f
--- /dev/null
+++ b/src/vs/workbench/contrib/chat/electron-sandbox/actions/media/voiceChatActions.css
@@ -0,0 +1,14 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+.monaco-workbench .interactive-input-part .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled):hover,
+.monaco-workbench .inline-chat .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled):hover {
+ animation: none; /* stop the running voice recording animation for showing another codicon to stop */
+}
+
+.monaco-workbench .interactive-input-part .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled):hover::before,
+.monaco-workbench .inline-chat .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled):hover::before {
+ content: "\ead7"; /* use `debug-stop` icon unicode for hovering over running voice recording */
+}
diff --git a/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts b/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts
index 8773eff46d5..b244992f104 100644
--- a/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts
+++ b/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts
@@ -3,11 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
+import 'vs/css!./media/voiceChatActions';
import { Event } from 'vs/base/common/event';
import { firstOrDefault } from 'vs/base/common/arrays';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { Codicon } from 'vs/base/common/codicons';
-import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
+import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
import { equalsIgnoreCase } from 'vs/base/common/strings';
import { ServicesAccessor } from 'vs/editor/browser/editorExtensions';
import { localize } from 'vs/nls';
@@ -16,7 +17,7 @@ import { ContextKeyExpr, IContextKeyService, RawContextKey } from 'vs/platform/c
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { spinningLoading } from 'vs/platform/theme/common/iconRegistry';
import { CHAT_CATEGORY } from 'vs/workbench/contrib/chat/browser/actions/chatActions';
-import { IChatWidgetService, IQuickChatService } from 'vs/workbench/contrib/chat/browser/chat';
+import { IChatWidget, IChatWidgetService, IQuickChatService } from 'vs/workbench/contrib/chat/browser/chat';
import { IChatService } from 'vs/workbench/contrib/chat/common/chatService';
import { IWorkbenchVoiceRecognitionService } from 'vs/workbench/services/voiceRecognition/electron-sandbox/workbenchVoiceRecognitionService';
import { MENU_INLINE_CHAT_WIDGET } from 'vs/workbench/contrib/inlineChat/common/inlineChat';
@@ -24,58 +25,197 @@ import { CONTEXT_PROVIDER_EXISTS } from 'vs/workbench/contrib/chat/common/chatCo
import { InlineChatController } from 'vs/workbench/contrib/inlineChat/browser/inlineChatController';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { getCodeEditor } from 'vs/editor/browser/editorBrowser';
-import { isExecuteActionContext } from 'vs/workbench/contrib/chat/browser/actions/chatExecuteActions';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
import product from 'vs/platform/product/common/product';
import { ActiveEditorContext } from 'vs/workbench/common/contextkeys';
+import { IViewsService } from 'vs/workbench/common/views';
+import { IChatContributionService } from 'vs/workbench/contrib/chat/common/chatContributionService';
+import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
+import { KeyCode } from 'vs/base/common/keyCodes';
+import { isExecuteActionContext } from 'vs/workbench/contrib/chat/browser/actions/chatExecuteActions';
+import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
-const CONTEXT_VOICE_CHAT_GETTING_READY = new RawContextKey('voiceChatGettingReady', false, { type: 'boolean', description: localize('voiceChatGettingReady', "True when getting ready for receiving voice input from the microphone.") });
-const CONTEXT_VOICE_CHAT_IN_PROGRESS = new RawContextKey('voiceChatInProgress', false, { type: 'boolean', description: localize('voiceChatInProgress', "True when voice recording from microphone is in progress.") });
+const CONTEXT_VOICE_CHAT_GETTING_READY = new RawContextKey('voiceChatGettingReady', false, { type: 'boolean', description: localize('voiceChatGettingReady', "True when getting ready for receiving voice input from the microphone for voice chat.") });
+const CONTEXT_VOICE_CHAT_IN_PROGRESS = new RawContextKey('voiceChatInProgress', false, { type: 'boolean', description: localize('voiceChatInProgress', "True when voice recording from microphone is in progress for voice chat.") });
+
+const CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS = new RawContextKey('quickVoiceChatInProgress', false, { type: 'boolean', description: localize('quickVoiceChatInProgress', "True when voice recording from microphone is in progress for quick chat.") });
+const CONTEXT_INLINE_VOICE_CHAT_IN_PROGRESS = new RawContextKey('inlineVoiceChatInProgress', false, { type: 'boolean', description: localize('inlineVoiceChatInProgress', "True when voice recording from microphone is in progress for inline chat.") });
+const CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS = new RawContextKey('voiceChatInViewInProgress', false, { type: 'boolean', description: localize('voiceChatInViewInProgress', "True when voice recording from microphone is in progress in the chat view.") });
+const CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS = new RawContextKey('voiceChatInEditorInProgress', false, { type: 'boolean', description: localize('voiceChatInEditorInProgress', "True when voice recording from microphone is in progress in the chat editor.") });
+
+type VoiceChatSessionContext = 'inline' | 'quick' | 'view' | 'editor';
interface IVoiceChatSessionController {
readonly onDidAcceptInput: Event;
+ readonly onDidCancelInput: Event;
+
+ readonly context: VoiceChatSessionContext;
focusInput(): void;
acceptInput(): void;
updateInput(text: string): void;
}
-function getController(controller: InlineChatController): IVoiceChatSessionController;
-function getController(context: unknown): IVoiceChatSessionController | undefined;
-function getController(context: unknown): IVoiceChatSessionController | undefined {
- if (context instanceof InlineChatController) {
+class VoiceChatSessionControllerFactory {
+
+ static create(accessor: ServicesAccessor, context: 'inline'): Promise;
+ static create(accessor: ServicesAccessor, context: 'quick'): Promise;
+ static create(accessor: ServicesAccessor, context: 'view'): Promise;
+ static create(accessor: ServicesAccessor, context: 'focussed'): Promise;
+ static async create(accessor: ServicesAccessor, context: 'inline' | 'quick' | 'view' | 'focussed'): Promise {
+ const chatWidgetService = accessor.get(IChatWidgetService);
+ const chatService = accessor.get(IChatService);
+ const viewsService = accessor.get(IViewsService);
+ const chatContributionService = accessor.get(IChatContributionService);
+ const editorService = accessor.get(IEditorService);
+ const quickChatService = accessor.get(IQuickChatService);
+ const layoutService = accessor.get(IWorkbenchLayoutService);
+
+ // Currently Focussed Context
+ if (context === 'focussed') {
+
+ // Try with the chat widget service, which currently
+ // only supports the chat view and quick chat
+ // https://github.com/microsoft/vscode/issues/191191
+ const chatInput = chatWidgetService.lastFocusedWidget;
+ if (chatInput?.hasInputFocus()) {
+ // Unfortunately there does not seem to be a better way
+ // to figure out if the chat widget is in a part or picker
+ if (
+ layoutService.hasFocus(Parts.SIDEBAR_PART) ||
+ layoutService.hasFocus(Parts.PANEL_PART) ||
+ layoutService.hasFocus(Parts.AUXILIARYBAR_PART)
+ ) {
+ return VoiceChatSessionControllerFactory.doCreateForChatView(chatInput, viewsService, chatContributionService);
+ }
+
+ if (layoutService.hasFocus(Parts.EDITOR_PART)) {
+ return VoiceChatSessionControllerFactory.doCreateForChatEditor(chatInput, viewsService, chatContributionService);
+ }
+
+ return VoiceChatSessionControllerFactory.doCreateForQuickChat(chatInput, quickChatService);
+ }
+
+ // Try with the inline chat
+ const activeCodeEditor = getCodeEditor(editorService.activeTextEditorControl);
+ if (activeCodeEditor) {
+ const inlineChat = InlineChatController.get(activeCodeEditor);
+ if (inlineChat?.hasFocus()) {
+ return VoiceChatSessionControllerFactory.doCreateForInlineChat(inlineChat);
+ }
+ }
+ }
+
+ // View Chat
+ if (context === 'view') {
+ const provider = firstOrDefault(chatService.getProviderInfos());
+ if (provider) {
+ const chatView = await chatWidgetService.revealViewForProvider(provider.id);
+ if (chatView) {
+ return VoiceChatSessionControllerFactory.doCreateForChatView(chatView, viewsService, chatContributionService);
+ }
+ }
+ }
+
+ // Inline Chat
+ if (context === 'inline') {
+ const activeCodeEditor = getCodeEditor(editorService.activeTextEditorControl);
+ if (activeCodeEditor) {
+ const inlineChat = InlineChatController.get(activeCodeEditor);
+ if (inlineChat) {
+ return VoiceChatSessionControllerFactory.doCreateForInlineChat(inlineChat);
+ }
+ }
+ }
+
+ // Quick Chat
+ if (context === 'quick') {
+ quickChatService.open();
+
+ const quickChat = chatWidgetService.lastFocusedWidget;
+ if (quickChat) {
+ return VoiceChatSessionControllerFactory.doCreateForQuickChat(quickChat, quickChatService);
+ }
+ }
+
+ return undefined;
+ }
+
+ private static doCreateForChatView(chatView: IChatWidget, viewsService: IViewsService, chatContributionService: IChatContributionService): IVoiceChatSessionController {
+ return VoiceChatSessionControllerFactory.doCreateForChatViewOrEditor('view', chatView, viewsService, chatContributionService);
+ }
+
+ private static doCreateForChatEditor(chatView: IChatWidget, viewsService: IViewsService, chatContributionService: IChatContributionService): IVoiceChatSessionController {
+ return VoiceChatSessionControllerFactory.doCreateForChatViewOrEditor('editor', chatView, viewsService, chatContributionService);
+ }
+
+ private static doCreateForChatViewOrEditor(context: 'view' | 'editor', chatView: IChatWidget, viewsService: IViewsService, chatContributionService: IChatContributionService): IVoiceChatSessionController {
return {
- onDidAcceptInput: context.onDidAcceptInput,
- focusInput: () => context.focus(),
- acceptInput: () => context.acceptInput(),
- updateInput: text => context.updateInput(text)
+ context,
+ onDidAcceptInput: chatView.onDidAcceptInput,
+ // TODO@bpasero cancellation needs to work better for chat editors that are not view bound
+ onDidCancelInput: Event.filter(viewsService.onDidChangeViewVisibility, e => e.id === chatContributionService.getViewIdForProvider(chatView.providerId)),
+ focusInput: () => chatView.focusInput(),
+ acceptInput: () => chatView.acceptInput(),
+ updateInput: text => chatView.updateInput(text)
};
}
- if (isExecuteActionContext(context)) {
- return context.widget;
+ private static doCreateForQuickChat(quickChat: IChatWidget, quickChatService: IQuickChatService): IVoiceChatSessionController {
+ return {
+ context: 'quick',
+ onDidAcceptInput: quickChat.onDidAcceptInput,
+ onDidCancelInput: quickChatService.onDidClose,
+ focusInput: () => quickChat.focusInput(),
+ acceptInput: () => quickChat.acceptInput(),
+ updateInput: text => quickChat.updateInput(text)
+ };
}
- return undefined;
+ private static doCreateForInlineChat(inlineChat: InlineChatController,): IVoiceChatSessionController {
+ const inlineChatSession = inlineChat.run();
+
+ return {
+ context: 'inline',
+ onDidAcceptInput: inlineChat.onDidAcceptInput,
+ onDidCancelInput: Event.any(
+ inlineChat.onDidCancelInput,
+ Event.fromPromise(inlineChatSession)
+ ),
+ focusInput: () => inlineChat.focus(),
+ acceptInput: () => inlineChat.acceptInput(),
+ updateInput: text => inlineChat.updateInput(text)
+ };
+ }
}
-class VoiceChatSession {
+interface ActiveVoiceChatSession {
+ readonly controller: IVoiceChatSessionController;
+ readonly disposables: DisposableStore;
+}
- private static instance: VoiceChatSession | undefined = undefined;
- static getInstance(instantiationService: IInstantiationService): VoiceChatSession {
- if (!VoiceChatSession.instance) {
- VoiceChatSession.instance = instantiationService.createInstance(VoiceChatSession);
+class VoiceChatSessions {
+
+ private static instance: VoiceChatSessions | undefined = undefined;
+ static getInstance(instantiationService: IInstantiationService): VoiceChatSessions {
+ if (!VoiceChatSessions.instance) {
+ VoiceChatSessions.instance = instantiationService.createInstance(VoiceChatSessions);
}
- return VoiceChatSession.instance;
+ return VoiceChatSessions.instance;
}
private voiceChatInProgressKey = CONTEXT_VOICE_CHAT_IN_PROGRESS.bindTo(this.contextKeyService);
private voiceChatGettingReadyKey = CONTEXT_VOICE_CHAT_GETTING_READY.bindTo(this.contextKeyService);
- private currentVoiceChatSession: DisposableStore | undefined = undefined;
+ private quickVoiceChatInProgressKey = CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS.bindTo(this.contextKeyService);
+ private inlineVoiceChatInProgressKey = CONTEXT_INLINE_VOICE_CHAT_IN_PROGRESS.bindTo(this.contextKeyService);
+ private voiceChatInViewInProgressKey = CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS.bindTo(this.contextKeyService);
+ private voiceChatInEditorInProgressKey = CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS.bindTo(this.contextKeyService);
+
+ private currentVoiceChatSession: ActiveVoiceChatSession | undefined = undefined;
private voiceChatSessionIds = 0;
constructor(
@@ -83,33 +223,60 @@ class VoiceChatSession {
@IWorkbenchVoiceRecognitionService private readonly voiceRecognitionService: IWorkbenchVoiceRecognitionService
) { }
- async start(context: IVoiceChatSessionController): Promise {
+ async start(controller: IVoiceChatSessionController): Promise {
this.stop();
- this.voiceChatGettingReadyKey.set(true);
- this.currentVoiceChatSession = new DisposableStore();
+ const voiceChatSessionId = ++this.voiceChatSessionIds;
+ this.currentVoiceChatSession = {
+ controller,
+ disposables: new DisposableStore()
+ };
const cts = new CancellationTokenSource();
- this.currentVoiceChatSession.add(toDisposable(() => cts.dispose(true)));
+ this.currentVoiceChatSession.disposables.add(toDisposable(() => cts.dispose(true)));
- context.focusInput();
+ this.currentVoiceChatSession.disposables.add(controller.onDidAcceptInput(() => this.stop(voiceChatSessionId, controller.context)));
+ this.currentVoiceChatSession.disposables.add(controller.onDidCancelInput(() => this.stop(voiceChatSessionId, controller.context)));
+
+ controller.updateInput('');
+ controller.focusInput();
+
+ this.voiceChatGettingReadyKey.set(true);
const onDidTranscribe = await this.voiceRecognitionService.transcribe(cts.token, {
- onDidCancel: () => this.stop(voiceChatSessionId)
+ onDidCancel: () => this.stop(voiceChatSessionId, controller.context)
});
- if (cts.token.isCancellationRequested) {
- return Disposable.None;
- }
- const voiceChatSessionId = ++this.voiceChatSessionIds;
+ if (cts.token.isCancellationRequested) {
+ return;
+ }
this.voiceChatGettingReadyKey.set(false);
this.voiceChatInProgressKey.set(true);
+ switch (controller.context) {
+ case 'inline':
+ this.inlineVoiceChatInProgressKey.set(true);
+ break;
+ case 'quick':
+ this.quickVoiceChatInProgressKey.set(true);
+ break;
+ case 'view':
+ this.voiceChatInViewInProgressKey.set(true);
+ break;
+ case 'editor':
+ this.voiceChatInEditorInProgressKey.set(true);
+ break;
+ }
+
+ this.registerTranscriptionListener(this.currentVoiceChatSession, onDidTranscribe);
+ }
+
+ private registerTranscriptionListener(session: ActiveVoiceChatSession, onDidTranscribe: Event) {
let lastText: string | undefined = undefined;
let lastTextSimilarCount = 0;
- this.currentVoiceChatSession.add(onDidTranscribe(text => {
+ session.disposables.add(onDidTranscribe(text => {
if (!text && lastText) {
text = lastText;
}
@@ -123,17 +290,12 @@ class VoiceChatSession {
}
if (lastTextSimilarCount >= 2) {
- context.acceptInput();
+ session.controller.acceptInput();
} else {
- context.updateInput(text);
+ session.controller.updateInput(text);
}
-
}
}));
-
- this.currentVoiceChatSession.add(context.onDidAcceptInput(() => this.stop(voiceChatSessionId)));
-
- return toDisposable(() => this.stop(voiceChatSessionId));
}
private isSimilarTranscription(textA: string, textB: string): boolean {
@@ -150,20 +312,36 @@ class VoiceChatSession {
);
}
- stop(voiceChatSessionId = this.voiceChatSessionIds): void {
- if (!this.currentVoiceChatSession) {
+ stop(voiceChatSessionId = this.voiceChatSessionIds, context?: VoiceChatSessionContext): void {
+ if (
+ !this.currentVoiceChatSession ||
+ this.voiceChatSessionIds !== voiceChatSessionId ||
+ (context && this.currentVoiceChatSession.controller.context !== context)
+ ) {
return;
}
- if (this.voiceChatSessionIds !== voiceChatSessionId) {
- return;
- }
-
- this.currentVoiceChatSession.dispose();
+ this.currentVoiceChatSession.disposables.dispose();
this.currentVoiceChatSession = undefined;
this.voiceChatGettingReadyKey.set(false);
this.voiceChatInProgressKey.set(false);
+
+ this.quickVoiceChatInProgressKey.set(false);
+ this.inlineVoiceChatInProgressKey.set(false);
+ this.voiceChatInViewInProgressKey.set(false);
+ this.voiceChatInEditorInProgressKey.set(false);
+ }
+
+ accept(voiceChatSessionId = this.voiceChatSessionIds): void {
+ if (
+ !this.currentVoiceChatSession ||
+ this.voiceChatSessionIds !== voiceChatSessionId
+ ) {
+ return;
+ }
+
+ this.currentVoiceChatSession.controller.acceptInput();
}
}
@@ -185,16 +363,11 @@ class VoiceChatInChatViewAction extends Action2 {
}
async run(accessor: ServicesAccessor): Promise {
- const chatWidgetService = accessor.get(IChatWidgetService);
- const chatService = accessor.get(IChatService);
const instantiationService = accessor.get(IInstantiationService);
- const provider = firstOrDefault(chatService.getProviderInfos());
- if (provider) {
- const controller = await chatWidgetService.revealViewForProvider(provider.id);
- if (controller) {
- VoiceChatSession.getInstance(instantiationService).start(controller);
- }
+ const controller = await VoiceChatSessionControllerFactory.create(accessor, 'view');
+ if (controller) {
+ VoiceChatSessions.getInstance(instantiationService).start(controller);
}
}
}
@@ -217,23 +390,12 @@ class InlineVoiceChatAction extends Action2 {
}
async run(accessor: ServicesAccessor): Promise {
- const editorService = accessor.get(IEditorService);
const instantiationService = accessor.get(IInstantiationService);
- const activeCodeEditor = getCodeEditor(editorService.activeTextEditorControl);
- if (!activeCodeEditor) {
- return;
+ const controller = await VoiceChatSessionControllerFactory.create(accessor, 'inline');
+ if (controller) {
+ VoiceChatSessions.getInstance(instantiationService).start(controller);
}
-
- const controller = InlineChatController.get(activeCodeEditor);
- if (!controller) {
- return;
- }
-
- const inlineChatSession = controller.run();
-
- const disposable = await VoiceChatSession.getInstance(instantiationService).start(getController(controller));
- inlineChatSession.finally(() => disposable.dispose());
}
}
@@ -255,16 +417,11 @@ class QuickVoiceChatAction extends Action2 {
}
async run(accessor: ServicesAccessor): Promise {
- const quickChatService = accessor.get(IQuickChatService);
- const chatWidgetService = accessor.get(IChatWidgetService);
const instantiationService = accessor.get(IInstantiationService);
- quickChatService.open();
-
- const controller = chatWidgetService.lastFocusedWidget;
+ const controller = await VoiceChatSessionControllerFactory.create(accessor, 'quick');
if (controller) {
- const disposable = await VoiceChatSession.getInstance(instantiationService).start(controller);
- Event.once(quickChatService.onDidClose)(() => disposable.dispose());
+ VoiceChatSessions.getInstance(instantiationService).start(controller);
}
}
}
@@ -280,16 +437,16 @@ class StartVoiceChatAction extends Action2 {
value: localize('workbench.action.chat.startVoiceChat', "Start Voice Chat"),
original: 'Start Voice Chat'
},
- icon: Codicon.record,
+ icon: Codicon.mic,
precondition: CONTEXT_VOICE_CHAT_GETTING_READY.negate(),
menu: [{
id: MenuId.ChatExecute,
- when: CONTEXT_VOICE_CHAT_IN_PROGRESS.negate(),
+ when: ContextKeyExpr.and(CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS.negate(), CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS.negate(), CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS.negate()),
group: 'navigation',
order: -1
}, {
id: MENU_INLINE_CHAT_WIDGET,
- when: CONTEXT_VOICE_CHAT_IN_PROGRESS.negate(),
+ when: CONTEXT_INLINE_VOICE_CHAT_IN_PROGRESS.negate(),
group: 'main',
order: -1
}]
@@ -297,45 +454,27 @@ class StartVoiceChatAction extends Action2 {
}
async run(accessor: ServicesAccessor, context: unknown): Promise {
- const editorService = accessor.get(IEditorService);
- const chatWidgetService = accessor.get(IChatWidgetService);
const instantiationService = accessor.get(IInstantiationService);
const commandService = accessor.get(ICommandService);
- let controller = getController(context);
- if (!controller) {
-
- // Without a controller, this action potentially executed from
- // a global keybinding, and thus we have to find the chat
- // input that is currently focussed, or have a fallback
-
- // 1.) a chat input widget has focus
- if (chatWidgetService.lastFocusedWidget?.hasInputFocus()) {
- controller = chatWidgetService.lastFocusedWidget;
- }
-
- // 2.) a inline chat input widget has focus
- if (!controller) {
- const activeCodeEditor = getCodeEditor(editorService.activeTextEditorControl);
- if (activeCodeEditor) {
- const chatInput = InlineChatController.get(activeCodeEditor);
- if (chatInput?.hasFocus()) {
- controller = getController(chatInput);
- }
- }
- }
-
- // 3.) open a quick chat view
- if (!controller) {
- return commandService.executeCommand(QuickVoiceChatAction.ID);
- }
+ if (isExecuteActionContext(context)) {
+ // if we already get a context when the action is executed
+ // from a toolbar within the chat widget, then make sure
+ // to move focus into the input field so that the controller
+ // is properly retrieved
+ // TODO@bpasero this will actually not work if the button
+ // is clicked from the inline editor while focus is in a
+ // chat input field in a view or picker
+ context.widget.focusInput();
}
- if (!controller) {
- return;
+ const controller = await VoiceChatSessionControllerFactory.create(accessor, 'focussed');
+ if (controller) {
+ VoiceChatSessions.getInstance(instantiationService).start(controller);
+ } else {
+ // fallback to Quick Voice Chat command
+ commandService.executeCommand(QuickVoiceChatAction.ID);
}
-
- VoiceChatSession.getInstance(instantiationService).start(controller);
}
}
@@ -352,16 +491,141 @@ class StopVoiceChatAction extends Action2 {
},
category: CHAT_CATEGORY,
f1: true,
- precondition: CONTEXT_VOICE_CHAT_IN_PROGRESS,
+ keybinding: {
+ weight: KeybindingWeight.WorkbenchContrib + 100,
+ when: CONTEXT_VOICE_CHAT_IN_PROGRESS,
+ primary: KeyCode.Escape
+ },
+ precondition: CONTEXT_VOICE_CHAT_IN_PROGRESS
+ });
+ }
+
+ run(accessor: ServicesAccessor): void {
+ VoiceChatSessions.getInstance(accessor.get(IInstantiationService)).stop();
+ }
+}
+
+class StopVoiceChatInChatViewAction extends Action2 {
+
+ static readonly ID = 'workbench.action.chat.stopVoiceChatInChatView';
+
+ constructor() {
+ super({
+ id: StopVoiceChatInChatViewAction.ID,
+ title: {
+ value: localize('workbench.action.chat.stopVoiceChatInChatView.label', "Stop Voice Chat (Chat View)"),
+ original: 'Stop Voice Chat (Chat View)'
+ },
+ category: CHAT_CATEGORY,
+ keybinding: {
+ weight: KeybindingWeight.WorkbenchContrib + 100,
+ when: CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS,
+ primary: KeyCode.Escape
+ },
+ precondition: CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS,
icon: spinningLoading,
menu: [{
id: MenuId.ChatExecute,
- when: CONTEXT_VOICE_CHAT_IN_PROGRESS,
+ when: CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS,
group: 'navigation',
order: -1
- }, {
+ }]
+ });
+ }
+
+ run(accessor: ServicesAccessor): void {
+ VoiceChatSessions.getInstance(accessor.get(IInstantiationService)).stop(undefined, 'view');
+ }
+}
+
+class StopVoiceChatInChatEditorAction extends Action2 {
+
+ static readonly ID = 'workbench.action.chat.stopVoiceChatInChatEditor';
+
+ constructor() {
+ super({
+ id: StopVoiceChatInChatEditorAction.ID,
+ title: {
+ value: localize('workbench.action.chat.stopVoiceChatInChatEditor.label', "Stop Voice Chat (Chat Editor)"),
+ original: 'Stop Voice Chat (Chat Editor)'
+ },
+ category: CHAT_CATEGORY,
+ keybinding: {
+ weight: KeybindingWeight.WorkbenchContrib + 100,
+ when: CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS,
+ primary: KeyCode.Escape
+ },
+ precondition: CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS,
+ icon: spinningLoading,
+ menu: [{
+ id: MenuId.ChatExecute,
+ when: CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS,
+ group: 'navigation',
+ order: -1
+ }]
+ });
+ }
+
+ run(accessor: ServicesAccessor): void {
+ VoiceChatSessions.getInstance(accessor.get(IInstantiationService)).stop(undefined, 'editor');
+ }
+}
+
+class StopQuickVoiceChatAction extends Action2 {
+
+ static readonly ID = 'workbench.action.chat.stopQuickVoiceChat';
+
+ constructor() {
+ super({
+ id: StopQuickVoiceChatAction.ID,
+ title: {
+ value: localize('workbench.action.chat.stopQuickVoiceChat.label', "Stop Voice Chat (Quick Chat)"),
+ original: 'Stop Voice Chat (Quick Chat)'
+ },
+ category: CHAT_CATEGORY,
+ keybinding: {
+ weight: KeybindingWeight.WorkbenchContrib + 100,
+ when: CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS,
+ primary: KeyCode.Escape
+ },
+ precondition: CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS,
+ icon: spinningLoading,
+ menu: [{
+ id: MenuId.ChatExecute,
+ when: CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS,
+ group: 'navigation',
+ order: -1
+ }]
+ });
+ }
+
+ run(accessor: ServicesAccessor): void {
+ VoiceChatSessions.getInstance(accessor.get(IInstantiationService)).stop(undefined, 'quick');
+ }
+}
+
+class StopInlineVoiceChatAction extends Action2 {
+
+ static readonly ID = 'workbench.action.chat.stopInlineVoiceChat';
+
+ constructor() {
+ super({
+ id: StopInlineVoiceChatAction.ID,
+ title: {
+ value: localize('workbench.action.chat.stopInlineVoiceChat.label', "Stop Voice Chat (Inline Editor)"),
+ original: 'Stop Voice Chat (Inline Editor)'
+ },
+ category: CHAT_CATEGORY,
+ keybinding: {
+ weight: KeybindingWeight.WorkbenchContrib + 100,
+ when: CONTEXT_INLINE_VOICE_CHAT_IN_PROGRESS,
+ primary: KeyCode.Escape
+ },
+ precondition: CONTEXT_INLINE_VOICE_CHAT_IN_PROGRESS,
+ icon: spinningLoading,
+ menu: [{
id: MENU_INLINE_CHAT_WIDGET,
- when: CONTEXT_VOICE_CHAT_IN_PROGRESS,
+ when: CONTEXT_INLINE_VOICE_CHAT_IN_PROGRESS,
group: 'main',
order: -1
}]
@@ -369,7 +633,29 @@ class StopVoiceChatAction extends Action2 {
}
run(accessor: ServicesAccessor): void {
- VoiceChatSession.getInstance(accessor.get(IInstantiationService)).stop();
+ VoiceChatSessions.getInstance(accessor.get(IInstantiationService)).stop(undefined, 'inline');
+ }
+}
+
+class StopVoiceChatAndSubmitAction extends Action2 {
+
+ static readonly ID = 'workbench.action.chat.stopVoiceChatAndSubmit';
+
+ constructor() {
+ super({
+ id: StopVoiceChatAndSubmitAction.ID,
+ title: {
+ value: localize('workbench.action.chat.stopAndAcceptVoiceChat.label', "Stop Voice Chat and Submit"),
+ original: 'Stop Voice Chat and Submit'
+ },
+ category: CHAT_CATEGORY,
+ f1: true,
+ precondition: CONTEXT_VOICE_CHAT_IN_PROGRESS
+ });
+ }
+
+ run(accessor: ServicesAccessor): void {
+ VoiceChatSessions.getInstance(accessor.get(IInstantiationService)).accept();
}
}
@@ -381,5 +667,11 @@ export function registerVoiceChatActions() {
registerAction2(StartVoiceChatAction);
registerAction2(StopVoiceChatAction);
+ registerAction2(StopVoiceChatAndSubmitAction);
+
+ registerAction2(StopVoiceChatInChatViewAction);
+ registerAction2(StopVoiceChatInChatEditorAction);
+ registerAction2(StopQuickVoiceChatAction);
+ registerAction2(StopInlineVoiceChatAction);
}
}
diff --git a/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css b/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css
index 25fcb4b03d8..f8044ced3b2 100644
--- a/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css
+++ b/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css
@@ -21,3 +21,34 @@
width: 100%;
justify-content: flex-end;
}
+
+.accessible-view-title-bar {
+ display: flex;
+ align-items: center;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+}
+
+.accessible-view-title {
+ padding: 3px 0px;
+ text-align: center;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ width: 100%;
+}
+
+.accessible-view-action-bar {
+ justify-content: flex-end;
+ margin-right: 4px;
+ flex: 1;
+}
+
+.accessible-view-action-bar > .actions-container {
+ justify-content: flex-end;
+}
+
+.accessible-view-title-bar .monaco-action-bar .action-label.codicon {
+ background-position: center;
+ background-repeat: no-repeat;
+ padding: 2px;
+}
diff --git a/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.ts b/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.ts
index 22148696b72..f9f2bd13d28 100644
--- a/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.ts
+++ b/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.ts
@@ -23,6 +23,8 @@ import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibil
import { AccessibleViewType, IAccessibleViewService } from 'vs/workbench/contrib/accessibility/browser/accessibleView';
import { AccessibilityHelpAction } from 'vs/workbench/contrib/accessibility/browser/accessibleViewActions';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
+import { Registry } from 'vs/platform/registry/common/platform';
+import { Extensions, IConfigurationMigrationRegistry } from 'vs/workbench/common/configuration';
class DiffEditorHelperContribution extends Disposable implements IDiffEditorContribution {
public static readonly ID = 'editor.contrib.diffEditorHelper';
@@ -120,3 +122,14 @@ function createScreenReaderHelp(): IDisposable {
}
registerDiffEditorContribution(DiffEditorHelperContribution.ID, DiffEditorHelperContribution);
+
+Registry.as(Extensions.ConfigurationMigration)
+ .registerConfigurationMigrations([{
+ key: 'diffEditor.experimental.collapseUnchangedRegions',
+ migrateFn: (value, accessor) => {
+ return [
+ ['diffEditor.hideUnchangedRegions.enabled', { value }],
+ ['diffEditor.experimental.collapseUnchangedRegions', { value: undefined }]
+ ];
+ }
+ }]);
diff --git a/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts b/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts
index 1f00b285fa2..74590df5c4c 100644
--- a/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts
+++ b/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts
@@ -129,7 +129,7 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
@IContextKeyService contextKeyService: IContextKeyService,
@IConfigurationService private readonly configurationService: IConfigurationService
) {
- super(editor, { keepEditorSelection: true });
+ super(editor, { keepEditorSelection: true, isAccessible: true });
this._contextKeyService = contextKeyService.createScoped(this.domNode);
this._scopedInstantiationService = instantiationService.createChild(new ServiceCollection(
diff --git a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts
index c0e24d570e5..890437bb65a 100644
--- a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts
+++ b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts
@@ -33,6 +33,7 @@ import { IListStyles } from 'vs/base/browser/ui/list/listWidget';
export const COMMENTS_VIEW_ID = 'workbench.panel.comments';
export const COMMENTS_VIEW_STORAGE_ID = 'Comments';
+export const COMMENTS_VIEW_ORIGINAL_TITLE = 'Comments';
export const COMMENTS_VIEW_TITLE = nls.localize('comments.view.title', "Comments");
interface IResourceTemplateData {
diff --git a/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.ts b/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.ts
index c8ec74a476f..f087642f26b 100644
--- a/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.ts
+++ b/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.ts
@@ -104,7 +104,8 @@ export class SimpleCommentEditor extends CodeEditorWidget {
enabled: false
},
autoClosingBrackets: configurationService.getValue('editor.autoClosingBrackets'),
- quickSuggestions: false
+ quickSuggestions: false,
+ accessibilitySupport: configurationService.getValue<'auto' | 'off' | 'on'>('editor.accessibilitySupport'),
};
}
}
diff --git a/src/vs/workbench/contrib/comments/test/browser/commentsView.test.ts b/src/vs/workbench/contrib/comments/test/browser/commentsView.test.ts
index 7dbdff3d855..83d2bf1ccea 100644
--- a/src/vs/workbench/contrib/comments/test/browser/commentsView.test.ts
+++ b/src/vs/workbench/contrib/comments/test/browser/commentsView.test.ts
@@ -54,7 +54,7 @@ export class TestViewDescriptorService implements Partial(ViewExtensions.ViewContainersRegistry).registerViewContainer({
id: DEBUG_PANEL_ID,
- title: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),
+ title: { value: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"), original: 'Debug Console' },
icon: icons.debugConsoleViewIcon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [DEBUG_PANEL_ID, { mergeViewWithContainerWhenSingleView: true }]),
storageId: DEBUG_PANEL_ID,
diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts
index 2ac22f1d0d7..9495543aad6 100644
--- a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts
+++ b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts
@@ -10,7 +10,7 @@ import { ILifecycleService, LifecyclePhase, ShutdownReason } from 'vs/workbench/
import { Action2, IAction2Options, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
import { ServicesAccessor } from 'vs/editor/browser/editorExtensions';
import { localize } from 'vs/nls';
-import { IEditSessionsStorageService, Change, ChangeType, Folder, EditSession, FileType, EDIT_SESSION_SYNC_CATEGORY, EDIT_SESSIONS_CONTAINER_ID, EditSessionSchemaVersion, IEditSessionsLogService, EDIT_SESSIONS_VIEW_ICON, EDIT_SESSIONS_TITLE, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_DATA_VIEW_ID, decodeEditSessionFileContent, hashedEditSessionId, editSessionsLogId, EDIT_SESSIONS_PENDING } from 'vs/workbench/contrib/editSessions/common/editSessions';
+import { IEditSessionsStorageService, Change, ChangeType, Folder, EditSession, FileType, EDIT_SESSION_SYNC_CATEGORY, EDIT_SESSIONS_CONTAINER_ID, EditSessionSchemaVersion, IEditSessionsLogService, EDIT_SESSIONS_VIEW_ICON, EDIT_SESSIONS_TITLE, EDIT_SESSIONS_ORIGINAL_TITLE, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_DATA_VIEW_ID, decodeEditSessionFileContent, hashedEditSessionId, editSessionsLogId, EDIT_SESSIONS_PENDING } from 'vs/workbench/contrib/editSessions/common/editSessions';
import { ISCMRepository, ISCMService } from 'vs/workbench/contrib/scm/common/scm';
import { IFileService } from 'vs/platform/files/common/files';
import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
@@ -274,7 +274,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
const container = Registry.as(ViewExtensions.ViewContainersRegistry).registerViewContainer(
{
id: EDIT_SESSIONS_CONTAINER_ID,
- title: EDIT_SESSIONS_TITLE,
+ title: { value: EDIT_SESSIONS_TITLE, original: EDIT_SESSIONS_ORIGINAL_TITLE },
ctorDescriptor: new SyncDescriptor(
ViewPaneContainer,
[EDIT_SESSIONS_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]
diff --git a/src/vs/workbench/contrib/editSessions/common/editSessions.ts b/src/vs/workbench/contrib/editSessions/common/editSessions.ts
index 53c39076411..4cb53dc45f7 100644
--- a/src/vs/workbench/contrib/editSessions/common/editSessions.ts
+++ b/src/vs/workbench/contrib/editSessions/common/editSessions.ts
@@ -98,6 +98,7 @@ export const EDIT_SESSIONS_PENDING = new RawContextKey(EDIT_SESSIONS_PE
export const EDIT_SESSIONS_CONTAINER_ID = 'workbench.view.editSessions';
export const EDIT_SESSIONS_DATA_VIEW_ID = 'workbench.views.editSessions.data';
+export const EDIT_SESSIONS_ORIGINAL_TITLE = 'Cloud Changes';
export const EDIT_SESSIONS_TITLE = localize('cloud changes', 'Cloud Changes');
export const EDIT_SESSIONS_VIEW_ICON = registerIcon('edit-sessions-view-icon', Codicon.cloudDownload, localize('editSessionViewIcon', 'View icon of the cloud changes view.'));
diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
index 0cb4cdeab43..16a37dc27c9 100644
--- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
+++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
@@ -855,10 +855,12 @@ export class ExtensionEditor extends EditorPane {
extensionPackReadme.style.maxWidth = '882px';
const extensionPack = append(extensionPackReadme, $('div', { class: 'extension-pack' }));
- if (manifest.extensionPack!.length < 3) {
+ if (manifest.extensionPack!.length <= 3) {
extensionPackReadme.classList.add('one-row');
- } else if (manifest.extensionPack!.length < 5) {
+ } else if (manifest.extensionPack!.length <= 6) {
extensionPackReadme.classList.add('two-rows');
+ } else if (manifest.extensionPack!.length <= 9) {
+ extensionPackReadme.classList.add('three-rows');
} else {
extensionPackReadme.classList.add('more-rows');
}
diff --git a/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css b/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css
index 575e6870b54..174b332538b 100644
--- a/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css
+++ b/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css
@@ -517,6 +517,10 @@
height: 224px;
}
+.extension-editor > .body > .content > .details > .readme-container > .extension-pack-readme.three-rows > .extension-pack {
+ height: 306px;
+}
+
.extension-editor > .body > .content > .details > .readme-container > .extension-pack-readme.more-rows > .extension-pack {
height: 326px;
}
diff --git a/src/vs/workbench/contrib/files/browser/explorerViewlet.ts b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts
index 602ffa99968..af0be566a8b 100644
--- a/src/vs/workbench/contrib/files/browser/explorerViewlet.ts
+++ b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts
@@ -252,7 +252,7 @@ const viewContainerRegistry = Registry.as(Extensions.Vi
*/
export const VIEW_CONTAINER: ViewContainer = viewContainerRegistry.registerViewContainer({
id: VIEWLET_ID,
- title: localize('explore', "Explorer"),
+ title: { value: localize('explore', "Explorer"), original: 'Explorer' },
ctorDescriptor: new SyncDescriptor(ExplorerViewPaneContainer),
storageId: 'workbench.explorer.views.state',
icon: explorerViewIcon,
diff --git a/src/vs/workbench/contrib/files/electron-sandbox/fileCommands.ts b/src/vs/workbench/contrib/files/electron-sandbox/fileCommands.ts
index eb3744a25a3..4f62c9c804c 100644
--- a/src/vs/workbench/contrib/files/electron-sandbox/fileCommands.ts
+++ b/src/vs/workbench/contrib/files/electron-sandbox/fileCommands.ts
@@ -15,7 +15,7 @@ export function revealResourcesInOS(resources: URI[], nativeHostService: INative
if (resources.length) {
sequence(resources.map(r => async () => {
if (r.scheme === Schemas.file || r.scheme === Schemas.vscodeUserData) {
- nativeHostService.showItemInFolder(r.fsPath);
+ nativeHostService.showItemInFolder(r.with({ scheme: Schemas.file }).fsPath);
}
}));
} else if (workspaceContextService.getWorkspace().folders.length) {
diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts
index 023fee9cfd2..1d8cacb2985 100644
--- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts
+++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts
@@ -101,6 +101,7 @@ export class InlineChatController implements IEditorContribution {
private _messages = this._store.add(new Emitter());
readonly onDidAcceptInput = Event.filter(this._messages.event, m => m === Message.ACCEPT_INPUT, this._store);
+ readonly onDidCancelInput = Event.filter(this._messages.event, m => m === Message.CANCEL_INPUT || m === Message.CANCEL_SESSION, this._store);
private readonly _sessionStore: DisposableStore = this._store.add(new DisposableStore());
private readonly _stashedSession: MutableDisposable = this._store.add(new MutableDisposable());
diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.ts
index 1374da20090..a9b339e7ae5 100644
--- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.ts
+++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.ts
@@ -18,7 +18,7 @@ import * as editorColorRegistry from 'vs/editor/common/core/editorColorRegistry'
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { INLINE_CHAT_ID, inlineChatDiffInserted, inlineChatDiffRemoved, inlineChatRegionHighlight } from 'vs/workbench/contrib/inlineChat/common/inlineChat';
import { LineRange } from 'vs/editor/common/core/lineRange';
-import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { Position } from 'vs/editor/common/core/position';
import { EditorExtensionsRegistry } from 'vs/editor/browser/editorExtensions';
import { ScrollType } from 'vs/editor/common/editorCommon';
@@ -163,7 +163,7 @@ export class InlineChatLivePreviewWidget extends ZoneWidget {
this._isDiffLocked = true;
}
- private _updateFromChanges(range: Range, changes: readonly LineRangeMapping[]): void {
+ private _updateFromChanges(range: Range, changes: readonly DetailedLineRangeMapping[]): void {
assertType(this.editor.hasModel());
if (this._isDiffLocked) {
@@ -177,7 +177,7 @@ export class InlineChatLivePreviewWidget extends ZoneWidget {
// --- full diff
- private _renderChangesWithFullDiff(changes: readonly LineRangeMapping[], range: Range) {
+ private _renderChangesWithFullDiff(changes: readonly DetailedLineRangeMapping[], range: Range) {
const modified = this.editor.getModel()!;
const ranges = this._computeHiddenRanges(modified, range, changes);
@@ -206,16 +206,16 @@ export class InlineChatLivePreviewWidget extends ZoneWidget {
super.hide();
}
- private _computeHiddenRanges(model: ITextModel, range: Range, changes: readonly LineRangeMapping[]) {
+ private _computeHiddenRanges(model: ITextModel, range: Range, changes: readonly DetailedLineRangeMapping[]) {
if (changes.length === 0) {
- changes = [new LineRangeMapping(LineRange.fromRange(range), LineRange.fromRange(range), undefined)];
+ changes = [new DetailedLineRangeMapping(LineRange.fromRange(range), LineRange.fromRange(range), undefined)];
}
- let originalLineRange = changes[0].originalRange;
- let modifiedLineRange = changes[0].modifiedRange;
+ let originalLineRange = changes[0].original;
+ let modifiedLineRange = changes[0].modified;
for (let i = 1; i < changes.length; i++) {
- originalLineRange = originalLineRange.join(changes[i].originalRange);
- modifiedLineRange = modifiedLineRange.join(changes[i].modifiedRange);
+ originalLineRange = originalLineRange.join(changes[i].original);
+ modifiedLineRange = modifiedLineRange.join(changes[i].modified);
}
const startDelta = modifiedLineRange.startLineNumber - range.startLineNumber;
diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts
index fcbb998dc79..8de79727cea 100644
--- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts
+++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts
@@ -23,7 +23,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
import { Iterable } from 'vs/base/common/iterator';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { isCancellationError } from 'vs/base/common/errors';
-import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { ISingleEditOperation } from 'vs/editor/common/core/editOperation';
import { raceCancellation } from 'vs/base/common/async';
@@ -112,7 +112,7 @@ export class Session {
private _lastInput: SessionPrompt | undefined;
private _lastExpansionState: ExpansionState | undefined;
- private _lastTextModelChanges: readonly LineRangeMapping[] | undefined;
+ private _lastTextModelChanges: readonly DetailedLineRangeMapping[] | undefined;
private _isUnstashed: boolean = false;
private readonly _exchange: SessionExchange[] = [];
private readonly _startTime = new Date();
@@ -191,7 +191,7 @@ export class Session {
return this._lastTextModelChanges ?? [];
}
- set lastTextModelChanges(changes: readonly LineRangeMapping[]) {
+ set lastTextModelChanges(changes: readonly DetailedLineRangeMapping[]) {
this._lastTextModelChanges = changes;
}
@@ -207,8 +207,8 @@ export class Session {
let startLine = Number.MAX_VALUE;
let endLine = Number.MIN_VALUE;
for (const change of this._lastTextModelChanges) {
- startLine = Math.min(startLine, change.modifiedRange.startLineNumber);
- endLine = Math.max(endLine, change.modifiedRange.endLineNumberExclusive);
+ startLine = Math.min(startLine, change.modified.startLineNumber);
+ endLine = Math.max(endLine, change.modified.endLineNumberExclusive);
}
return this.textModelN.getValueInRange(new Range(startLine, 1, endLine, Number.MAX_VALUE));
diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.ts
index c3a08e55ce9..76944f5b38e 100644
--- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.ts
+++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.ts
@@ -354,7 +354,7 @@ export class LiveStrategy extends EditModeStrategy {
const lastTextModelChanges = this._session.lastTextModelChanges;
let lastLineOfLocalEdits: number | undefined;
for (const change of lastTextModelChanges) {
- const changeEndLineNumber = change.modifiedRange.endLineNumberExclusive - 1;
+ const changeEndLineNumber = change.modified.endLineNumberExclusive - 1;
if (typeof lastLineOfLocalEdits === 'undefined' || lastLineOfLocalEdits < changeEndLineNumber) {
lastLineOfLocalEdits = changeEndLineNumber;
}
diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts
index 343749ce5c6..9703af6a00a 100644
--- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts
+++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts
@@ -36,7 +36,7 @@ import { FileKind } from 'vs/platform/files/common/files';
import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';
import { LanguageSelector } from 'vs/editor/common/languageSelector';
import { createTextBufferFactoryFromSnapshot } from 'vs/editor/common/model/textModel';
-import { LineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { DetailedLineRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { invertLineRange, lineRangeAsRange } from 'vs/workbench/contrib/inlineChat/browser/utils';
import { ICodeEditorViewState, ScrollType } from 'vs/editor/common/editorCommon';
import { LineRange } from 'vs/editor/common/core/lineRange';
@@ -612,7 +612,7 @@ export class InlineChatWidget {
// --- preview
- showEditsPreview(textModelv0: ITextModel, allEdits: ISingleEditOperation[][], changes: readonly LineRangeMapping[]) {
+ showEditsPreview(textModelv0: ITextModel, allEdits: ISingleEditOperation[][], changes: readonly DetailedLineRangeMapping[]) {
if (changes.length === 0) {
this.hideEditsPreview();
return;
@@ -628,11 +628,11 @@ export class InlineChatWidget {
this._previewDiffEditor.value.setModel({ original: textModelv0, modified });
// joined ranges
- let originalLineRange = changes[0].originalRange;
- let modifiedLineRange = changes[0].modifiedRange;
+ let originalLineRange = changes[0].original;
+ let modifiedLineRange = changes[0].modified;
for (let i = 1; i < changes.length; i++) {
- originalLineRange = originalLineRange.join(changes[i].originalRange);
- modifiedLineRange = modifiedLineRange.join(changes[i].modifiedRange);
+ originalLineRange = originalLineRange.join(changes[i].original);
+ modifiedLineRange = modifiedLineRange.join(changes[i].modified);
}
// apply extra padding
diff --git a/src/vs/workbench/contrib/interactive/browser/interactiveEditor.css b/src/vs/workbench/contrib/interactive/browser/interactiveEditor.css
index 491aa3e8c17..d43c6a6e98b 100644
--- a/src/vs/workbench/contrib/interactive/browser/interactiveEditor.css
+++ b/src/vs/workbench/contrib/interactive/browser/interactiveEditor.css
@@ -17,5 +17,5 @@
.interactive-editor .input-cell-container .monaco-editor-background,
.interactive-editor .input-cell-container .margin-view-overlays {
- background-color: var(--vscode-notebook-cellEditorBackground, --vscode-editor-background);
+ background-color: var(--vscode-notebook-cellEditorBackground, var(--vscode-editor-background));
}
diff --git a/src/vs/workbench/contrib/localHistory/electron-sandbox/localHistoryCommands.ts b/src/vs/workbench/contrib/localHistory/electron-sandbox/localHistoryCommands.ts
index 9ac4e2cd92f..20d20356e6e 100644
--- a/src/vs/workbench/contrib/localHistory/electron-sandbox/localHistoryCommands.ts
+++ b/src/vs/workbench/contrib/localHistory/electron-sandbox/localHistoryCommands.ts
@@ -39,7 +39,7 @@ registerAction2(class extends Action2 {
const { entry } = await findLocalHistoryEntry(workingCopyHistoryService, item);
if (entry) {
- await nativeHostService.showItemInFolder(entry.location.fsPath);
+ await nativeHostService.showItemInFolder(entry.location.with({ scheme: Schemas.file }).fsPath);
}
}
});
diff --git a/src/vs/workbench/contrib/logs/electron-sandbox/logsActions.ts b/src/vs/workbench/contrib/logs/electron-sandbox/logsActions.ts
index 3a057d2b8b9..cbc2a01dbb5 100644
--- a/src/vs/workbench/contrib/logs/electron-sandbox/logsActions.ts
+++ b/src/vs/workbench/contrib/logs/electron-sandbox/logsActions.ts
@@ -9,6 +9,7 @@ import { INativeHostService } from 'vs/platform/native/common/native';
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
import { IFileService } from 'vs/platform/files/common/files';
import { joinPath } from 'vs/base/common/resources';
+import { Schemas } from 'vs/base/common/network';
export class OpenLogsFolderAction extends Action {
@@ -23,7 +24,7 @@ export class OpenLogsFolderAction extends Action {
}
override run(): Promise {
- return this.nativeHostService.showItemInFolder(joinPath(this.environmentService.logsHome, 'main.log').fsPath);
+ return this.nativeHostService.showItemInFolder(joinPath(this.environmentService.logsHome, 'main.log').with({ scheme: Schemas.file }).fsPath);
}
}
@@ -43,7 +44,7 @@ export class OpenExtensionLogsFolderAction extends Action {
override async run(): Promise {
const folderStat = await this.fileService.resolve(this.environmentSerice.extHostLogsPath);
if (folderStat.children && folderStat.children[0]) {
- return this.nativeHostService.showItemInFolder(folderStat.children[0].resource.fsPath);
+ return this.nativeHostService.showItemInFolder(folderStat.children[0].resource.with({ scheme: Schemas.file }).fsPath);
}
}
}
diff --git a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts
index 275a84b8c9a..ef2f37cee8c 100644
--- a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts
+++ b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts
@@ -128,7 +128,7 @@ const markersViewIcon = registerIcon('markers-view-icon', Codicon.warning, local
// markers view container
const VIEW_CONTAINER: ViewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: Markers.MARKERS_CONTAINER_ID,
- title: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
+ title: { value: Messages.MARKERS_PANEL_TITLE_PROBLEMS, original: Messages.MARKERS_PANEL_ORIGINAL_TITLE_PROBLEMS },
icon: markersViewIcon,
hideIfEmpty: true,
order: 0,
diff --git a/src/vs/workbench/contrib/markers/browser/messages.ts b/src/vs/workbench/contrib/markers/browser/messages.ts
index 7ff0582f02f..767485b3692 100644
--- a/src/vs/workbench/contrib/markers/browser/messages.ts
+++ b/src/vs/workbench/contrib/markers/browser/messages.ts
@@ -21,6 +21,7 @@ export default class Messages {
public static PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_SEVERITY: string = nls.localize('problems.panel.configuration.compareOrder.severity', "Navigate problems ordered by severity");
public static PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_POSITION: string = nls.localize('problems.panel.configuration.compareOrder.position', "Navigate problems ordered by position");
+ public static MARKERS_PANEL_ORIGINAL_TITLE_PROBLEMS: string = 'Problems';
public static MARKERS_PANEL_TITLE_PROBLEMS: string = nls.localize('markers.panel.title.problems', "Problems");
public static MARKERS_PANEL_NO_PROBLEMS_BUILT: string = nls.localize('markers.panel.no.problems.build', "No problems have been detected in the workspace.");
diff --git a/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.ts b/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.ts
index cc1be27460f..334479df903 100644
--- a/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.ts
+++ b/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.ts
@@ -5,7 +5,7 @@
import { assertFn, checkAdjacentItems } from 'vs/base/common/assert';
import { IReader } from 'vs/base/common/observable';
-import { RangeMapping as DiffRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
+import { RangeMapping as DiffRangeMapping } from 'vs/editor/common/diff/rangeMapping';
import { ITextModel } from 'vs/editor/common/model';
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@@ -56,9 +56,9 @@ export class MergeDiffComputer implements IMergeDiffComputer {
const changes = result.changes.map(c =>
new DetailedLineRangeMapping(
- toLineRange(c.originalRange),
+ toLineRange(c.original),
textModel1,
- toLineRange(c.modifiedRange),
+ toLineRange(c.modified),
textModel2,
c.innerChanges?.map(ic => toRangeMapping(ic))
)
diff --git a/src/vs/workbench/contrib/mergeEditor/test/browser/model.test.ts b/src/vs/workbench/contrib/mergeEditor/test/browser/model.test.ts
index d411e9a4c1f..0441e4483d3 100644
--- a/src/vs/workbench/contrib/mergeEditor/test/browser/model.test.ts
+++ b/src/vs/workbench/contrib/mergeEditor/test/browser/model.test.ts
@@ -290,9 +290,9 @@ class MergeModelInterface extends Disposable {
);
const changes = result.changes.map(c =>
new DetailedLineRangeMapping(
- toLineRange(c.originalRange),
+ toLineRange(c.original),
textModel1,
- toLineRange(c.modifiedRange),
+ toLineRange(c.modified),
textModel2,
c.innerChanges?.map(ic => toRangeMapping(ic)).filter(isDefined)
)
diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.ts b/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.ts
index 576ded3d1f6..a544461cc28 100644
--- a/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.ts
+++ b/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.ts
@@ -61,5 +61,7 @@ export const TEXT_BASED_MIMETYPES = [
'application/x.notebook.stream',
'application/vnd.code.notebook.stderr',
'application/x.notebook.stderr',
- 'text/plain'
+ 'text/plain',
+ 'text/markdown',
+ 'application/json'
];
diff --git a/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.ts b/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.ts
index 956222d7a36..1f73db4342a 100644
--- a/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.ts
+++ b/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.ts
@@ -17,13 +17,13 @@ import { ICellOutputViewModel, ICellViewModel, INotebookEditor, getNotebookEdito
import { CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon';
import { CodeCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
-export const COPY_OUTPUT_COMMAND_ID = 'notebook.cellOutput.copyToClipboard';
+export const COPY_OUTPUT_COMMAND_ID = 'notebook.cellOutput.copy';
registerAction2(class CopyCellOutputAction extends Action2 {
constructor() {
super({
id: COPY_OUTPUT_COMMAND_ID,
- title: localize('notebookActions.copyOutput', "Copy Output to Clipboard"),
+ title: localize('notebookActions.copyOutput', "Copy Output"),
menu: {
id: MenuId.NotebookOutputToolbar,
when: NOTEBOOK_CELL_HAS_OUTPUTS
@@ -55,7 +55,7 @@ registerAction2(class CopyCellOutputAction extends Action2 {
const mimeType = outputViewModel.pickedMimeType?.mimeType;
if (mimeType?.startsWith('image/')) {
- const focusOptions = { skipReveal: true, outputId: outputViewModel.model.outputId };
+ const focusOptions = { skipReveal: true, outputId: outputViewModel.model.outputId, altOutputId: outputViewModel.model.alternativeOutputId };
await notebookEditor.focusNotebookCell(outputViewModel.cellViewModel as ICellViewModel, 'output', focusOptions);
notebookEditor.copyOutputImage(outputViewModel);
} else {
diff --git a/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css b/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css
index 8107bfb1282..5750b20cd65 100644
--- a/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css
+++ b/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css
@@ -15,7 +15,17 @@
.notebookOverlay
.notebook-sticky-scroll-container
.notebook-sticky-scroll-line {
+ background-color: var(--vscode-notebook-editorBackground);
+ position: relative;
+ z-index: 0;
padding-left: 12px;
+ /* transition: margin-top 0.2s ease-in-out; */
+}
+
+.monaco-workbench.hc-light .notebookOverlay .notebook-sticky-scroll-container,
+.monaco-workbench.hc-black .notebookOverlay .notebook-sticky-scroll-container {
+ background-color: var(--vscode-editorStickyScroll-background);
+ border-bottom: 1px solid var(--vscode-contrastBorder);
}
.monaco-workbench
diff --git a/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts b/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
index 4f1d98b86bb..158b98692fe 100644
--- a/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
+++ b/src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
@@ -152,6 +152,7 @@ export interface IFocusNotebookCellOptions {
readonly focusEditorLine?: number;
readonly minimalScrolling?: boolean;
readonly outputId?: string;
+ readonly altOutputId?: string;
}
//#endregion
diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
index ba8ae7da1db..3830664287b 100644
--- a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
+++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
@@ -2350,7 +2350,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
}
const focusElementId = options?.outputId ?? cell.id;
- this._webview.focusOutput(focusElementId, this._webviewFocused);
+ this._webview.focusOutput(focusElementId, options?.altOutputId, this._webviewFocused);
cell.updateEditState(CellEditState.Preview, 'focusNotebookCell');
cell.focusMode = CellFocusMode.Output;
diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts
index b2359655e6d..b89185074f7 100644
--- a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts
+++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts
@@ -1548,7 +1548,8 @@ export class BackLayerWebView extends Themable {
async copyImage(output: ICellOutputViewModel): Promise {
this._sendMessageToWebview({
type: 'copyImage',
- outputId: output.model.outputId
+ outputId: output.model.outputId,
+ altOutputId: output.model.alternativeOutputId
});
}
@@ -1608,7 +1609,7 @@ export class BackLayerWebView extends Themable {
this.webview?.focus();
}
- focusOutput(cellOrOutputId: string, viewFocused: boolean) {
+ focusOutput(cellOrOutputId: string, alternateId: string | undefined, viewFocused: boolean) {
if (this._disposed) {
return;
}
@@ -1620,6 +1621,7 @@ export class BackLayerWebView extends Themable {
this._sendMessageToWebview({
type: 'focus-output',
cellOrOutputId: cellOrOutputId,
+ alternateId: alternateId
});
}
diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.ts
index e74e173ae33..b46964be307 100644
--- a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.ts
+++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.ts
@@ -269,11 +269,13 @@ export interface IShowOutputMessage {
export interface ICopyImageMessage {
readonly type: 'copyImage';
readonly outputId: string;
+ readonly altOutputId: string;
}
export interface IFocusOutputMessage {
readonly type: 'focus-output';
readonly cellOrOutputId: string;
+ readonly alternateId?: string;
}
export interface IAckOutputHeight {
diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts
index 4715e64aa08..5197ae5372d 100644
--- a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts
+++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts
@@ -474,8 +474,9 @@ async function webviewPreloads(ctx: PreloadContext) {
});
};
- function focusFirstFocusableOrContainerInOutput(cellOrOutputId: string) {
- const cellOutputContainer = document.getElementById(cellOrOutputId);
+ function focusFirstFocusableOrContainerInOutput(cellOrOutputId: string, alternateId?: string) {
+ const cellOutputContainer = document.getElementById(cellOrOutputId) ??
+ alternateId ? document.getElementById(alternateId!) : undefined;
if (cellOutputContainer) {
if (cellOutputContainer.contains(document.activeElement)) {
return;
@@ -1362,17 +1363,18 @@ async function webviewPreloads(ctx: PreloadContext) {
});
};
- const copyOutputImage = async (outputId: string, retries = 5) => {
+ const copyOutputImage = async (outputId: string, altOutputId: string, retries = 5) => {
if (!document.hasFocus() && retries > 0) {
// copyImage can be called from outside of the webview, which means this function may be running whilst the webview is gaining focus.
// Since navigator.clipboard.write requires the document to be focused, we need to wait for focus.
// We cannot use a listener, as there is a high chance the focus is gained during the setup of the listener resulting in us missing it.
- setTimeout(() => { copyOutputImage(outputId, retries - 1); }, 20);
+ setTimeout(() => { copyOutputImage(outputId, altOutputId, retries - 1); }, 20);
return;
}
try {
- const image = document.getElementById(outputId)?.querySelector('img');
+ const image = document.getElementById(outputId)?.querySelector('img')
+ ?? document.getElementById(altOutputId)?.querySelector('img');
if (image) {
await navigator.clipboard.write([new ClipboardItem({
'image/png': new Promise((resolve) => {
@@ -1500,9 +1502,7 @@ async function webviewPreloads(ctx: PreloadContext) {
break;
}
case 'copyImage': {
-
- await copyOutputImage(event.data.outputId);
-
+ await copyOutputImage(event.data.outputId, event.data.altOutputId);
break;
}
case 'ack-dimension': {
@@ -1524,7 +1524,7 @@ async function webviewPreloads(ctx: PreloadContext) {
break;
}
case 'focus-output':
- focusFirstFocusableOrContainerInOutput(event.data.cellOrOutputId);
+ focusFirstFocusableOrContainerInOutput(event.data.cellOrOutputId, event.data.alternateId);
break;
case 'decorations': {
let outputContainer = document.getElementById(event.data.cellId);
diff --git a/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.ts b/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.ts
index 824835d21d0..426f767e89d 100644
--- a/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.ts
+++ b/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.ts
@@ -5,6 +5,7 @@
import { localize } from 'vs/nls';
import * as DOM from 'vs/base/browser/dom';
+import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { ServicesAccessor } from 'vs/editor/browser/editorExtensions';
import { Categories } from 'vs/platform/action/common/actionCommonCategories';
@@ -16,7 +17,6 @@ import { INotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookB
import { INotebookCellList } from 'vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon';
import { NotebookCellOutlineProvider, OutlineEntry } from 'vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider';
import { CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon';
-import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
export class ToggleNotebookStickyScroll extends Action2 {
@@ -48,7 +48,7 @@ export class ToggleNotebookStickyScroll extends Action2 {
}
}
-class NotebookStickyLine extends Disposable {
+export class NotebookStickyLine extends Disposable {
constructor(
public readonly element: HTMLElement,
public readonly entry: OutlineEntry,
@@ -79,10 +79,19 @@ class NotebookStickyLine extends Disposable {
}
}
-
+// TODO @Yoyokrazy:
+// BEHAVIOR
+// - [ ] bug with some popping around the cell transition
+// - [ ] bug with only bottom most sticky being partially transitioned
+// - partial rendering/transition only occuring when the headers shrink against a new section
+// - **and only for BOTTOM of that initial sticky tree**
+// - issues with HC themes
+// UX
+// - [ ] render symbols instead of #'s?
+// - maybe 'Hx >' where x is the level
export class NotebookStickyScroll extends Disposable {
private readonly _disposables = new DisposableStore();
- private currentStickyLines = new Map();
+ private currentStickyLines = new Map();
getDomNode(): HTMLElement {
return this.domNode;
@@ -92,6 +101,10 @@ export class NotebookStickyScroll extends Disposable {
return this.currentStickyLines.size * 22;
}
+ private setCurrentStickyLines(newStickyLines: Map) {
+ this.currentStickyLines = newStickyLines;
+ }
+
constructor(
private readonly domNode: HTMLElement,
private readonly notebookEditor: INotebookEditor,
@@ -132,9 +145,7 @@ export class NotebookStickyScroll extends Disposable {
this.init();
} else {
this._disposables.clear();
- this.currentStickyLines.forEach((value) => {
- value.dispose();
- });
+ this.disposeCurrentStickyLines();
DOM.clearNode(this.domNode);
this.updateDisplay();
}
@@ -153,7 +164,9 @@ export class NotebookStickyScroll extends Disposable {
this.initializeContent();
this._disposables.add(this.notebookOutline.onDidChange(() => {
- this.updateContent();
+ DOM.clearNode(this.domNode);
+ this.disposeCurrentStickyLines();
+ this.updateContent(computeContent(this.domNode, this.notebookEditor, this.notebookCellList, this.notebookOutline.entries));
}));
this._disposables.add(this.notebookEditor.onDidAttachViewModel(() => {
@@ -162,18 +175,23 @@ export class NotebookStickyScroll extends Disposable {
}));
this._disposables.add(this.notebookEditor.onDidScroll(() => {
- this.updateContent();
+ DOM.clearNode(this.domNode);
+ this.disposeCurrentStickyLines();
+ this.updateContent(computeContent(this.domNode, this.notebookEditor, this.notebookCellList, this.notebookOutline.entries));
}));
}
- private getVisibleOutlineEntry(visibleIndex: number): OutlineEntry | undefined {
+ static getVisibleOutlineEntry(visibleIndex: number, notebookOutlineEntries: OutlineEntry[]): OutlineEntry | undefined {
let left = 0;
- let right = this.notebookOutline.entries.length - 1;
+ let right = notebookOutlineEntries.length - 1;
let bucket = -1;
while (left <= right) {
const mid = Math.floor((left + right) / 2);
- if (this.notebookOutline.entries[mid].index < visibleIndex) {
+ if (notebookOutlineEntries[mid].index === visibleIndex) {
+ bucket = mid;
+ break;
+ } else if (notebookOutlineEntries[mid].index < visibleIndex) {
bucket = mid;
left = mid + 1;
} else {
@@ -182,7 +200,7 @@ export class NotebookStickyScroll extends Disposable {
}
if (bucket !== -1) {
- const rootEntry = this.notebookOutline.entries[bucket];
+ const rootEntry = notebookOutlineEntries[bucket];
const flatList: OutlineEntry[] = [];
rootEntry.asFlatList(flatList);
return flatList.find(entry => entry.index === visibleIndex);
@@ -206,32 +224,30 @@ export class NotebookStickyScroll extends Disposable {
for (let i = visibleRange.start; i < visibleRange.end; i++) {
if (i === 0) { // don't show headers when you're viewing the top cell
this.updateDisplay();
- this.currentStickyLines = new Map();
+ this.setCurrentStickyLines(new Map());
return;
}
const cell = this.notebookEditor.cellAt(i);
if (!cell) {
return;
}
- if (cell.cellKind === CellKind.Markup) {
- continue;
- }
// if we are here, the cell is a code cell.
- // check next visible cell, if markdown, that means this is the end of the section
- const nextVisibleCell = this.notebookEditor.cellAt(i + 1);
- if (nextVisibleCell && i + 1 < visibleRange.end) {
- if (nextVisibleCell.cellKind === CellKind.Markup) {
+ // check next cell, if markdown, that means this is the end of the section
+ // check if cell is within visible range
+ const nextCell = this.notebookEditor.cellAt(i + 1);
+ if (nextCell && i + 1 < visibleRange.end) {
+ if (nextCell.cellKind === CellKind.Markup) {
// this is the end of the section
// store the bottom scroll position of this cell
sectionBottom = this.notebookCellList.getCellViewScrollBottom(cell);
// compute sticky scroll height
- const entry = this.getVisibleOutlineEntry(i);
+ const entry = NotebookStickyScroll.getVisibleOutlineEntry(i, this.notebookOutline.entries);
if (!entry) {
return;
}
// using 22 instead of stickyscrollheight, as we don't necessarily render each line. 22 starts rendering sticky when we have space for at least 1 of them
- const newStickyHeight = this.computeStickyHeight(entry!);
+ const newStickyHeight = NotebookStickyScroll.computeStickyHeight(entry!);
if (editorScrollTop + newStickyHeight < sectionBottom) {
trackedEntry = entry;
break;
@@ -243,7 +259,7 @@ export class NotebookStickyScroll extends Disposable {
} else {
// there is no next cell, so use the bottom of the editor as the sectionBottom, using scrolltop + height
sectionBottom = this.notebookEditor.scrollTop + this.notebookEditor.getLayoutInfo().scrollHeight;
- trackedEntry = this.getVisibleOutlineEntry(i);
+ trackedEntry = NotebookStickyScroll.getVisibleOutlineEntry(i, this.notebookOutline.entries);
break;
}
} // cell loop close
@@ -253,130 +269,14 @@ export class NotebookStickyScroll extends Disposable {
// compute the space available for sticky lines, and render sticky lines
const linesToRender = Math.floor((sectionBottom - editorScrollTop) / 22);
- let newMap: Map | undefined = new Map();
- newMap = this.renderStickyLines(trackedEntry?.parent, this.domNode, linesToRender, newMap);
- if (!newMap) {
- newMap = new Map();
- }
- this.currentStickyLines = newMap;
+ let newMap: Map = new Map();
+ newMap = NotebookStickyScroll.renderStickyLines(trackedEntry?.parent, this.domNode, linesToRender, newMap, this.notebookEditor);
+ this.setCurrentStickyLines(newMap);
this.updateDisplay();
}
-
- private updateContent() {
- // find first code cell in visible range. this marks the start of the first section
- // find the last code cell in the first section of the visible range, store the bottom scroll position in a const sectionBottom
- // compute sticky scroll height, and check if editorScrolltop + stickyScrollHeight < sectionBottom
- // if that condition is true, break out of the loop with that cell as the tracked cell
- // if that condition is false, continue to next cell
-
- DOM.clearNode(this.domNode);
- // iterate over current map and dispose each notebookstickyline
- this.currentStickyLines.forEach((value) => {
- value.dispose();
- });
-
- const editorScrollTop = this.notebookEditor.scrollTop;
-
- // find last code cell of section, store bottom scroll position in sectionBottom
- const visibleRange = this.notebookEditor.visibleRanges[0];
- if (!visibleRange) {
- this.updateDisplay();
- this.currentStickyLines = new Map();
- return;
- }
-
- let trackedEntry = undefined;
- let sectionBottom = 0;
- for (let i = visibleRange.start; i < visibleRange.end; i++) {
- if (i === 0) { // don't show headers when you're viewing the top cell
- this.updateDisplay();
- this.currentStickyLines = new Map();
- return;
- }
- const cell = this.notebookEditor.cellAt(i);
- if (!cell) {
- return;
- }
- if (cell.cellKind === CellKind.Markup) {
- continue;
- }
-
- // if we are here, the cell is a code cell.
- // check next cell, if markdown, that means this is the end of the section
- const nextVisibleCell = this.notebookEditor.cellAt(i + 1);
- if (nextVisibleCell && i + 1 < visibleRange.end) {
- if (nextVisibleCell.cellKind === CellKind.Markup) {
- // this is the end of the section
- // store the bottom scroll position of this cell
- sectionBottom = this.notebookCellList.getCellViewScrollBottom(cell);
- // compute sticky scroll height
- const entry = this.getVisibleOutlineEntry(i);
- if (!entry) {
- return;
- }
- // check if we can render this section of sticky
- const currentSectionStickyHeight = this.computeStickyHeight(entry!);
- if (editorScrollTop + currentSectionStickyHeight < sectionBottom) {
- const linesToRender = Math.floor((sectionBottom - editorScrollTop) / 22);
- let newMap: Map | undefined = new Map();
- newMap = this.renderStickyLines(entry?.parent, this.domNode, linesToRender, newMap);
- if (!newMap) {
- newMap = new Map();
- }
- this.currentStickyLines = newMap;
- break;
- }
-
- let nextSectionEntry = undefined;
- for (let j = 1; j < visibleRange.end - i; j++) {
- // find next code cell after this one
- const cellCheck = this.notebookEditor.cellAt(i + j);
- if (cellCheck && cellCheck.cellKind === CellKind.Code) {
- nextSectionEntry = this.getVisibleOutlineEntry(i + j);
- break;
- }
- }
- const nextSectionStickyHeight = this.computeStickyHeight(nextSectionEntry!);
-
- // this block of logic cleans transitions between two sections that share a parent.
- // if the current section and the next section share a parent, then we can render the next section's sticky lines to avoid pop-in between
- if (entry?.parent?.parent === nextSectionEntry?.parent) {
- const linesToRender = Math.floor((sectionBottom - editorScrollTop) / 22) + 1;
- let newMap: Map | undefined = new Map();
- newMap = this.renderStickyLines(nextSectionEntry?.parent, this.domNode, linesToRender, newMap);
- if (!newMap) {
- newMap = new Map();
- }
- this.currentStickyLines = newMap;
- break;
- } else if (Math.abs(currentSectionStickyHeight - nextSectionStickyHeight) > 22) { // only shrink sticky
- const linesToRender = Math.floor((sectionBottom - editorScrollTop) / 22);
- let newMap: Map | undefined = new Map();
- newMap = this.renderStickyLines(entry?.parent, this.domNode, linesToRender, newMap);
- if (!newMap) {
- newMap = new Map();
- }
- this.currentStickyLines = newMap;
- break;
- }
- }
- } else {
- // there is no next cell, so use the bottom of the editor as the sectionBottom, using scrolltop + height
- sectionBottom = this.notebookEditor.scrollTop + this.notebookEditor.getLayoutInfo().scrollHeight;
- trackedEntry = this.getVisibleOutlineEntry(i);
- const linesToRender = Math.floor((sectionBottom - editorScrollTop) / 22);
-
- let newMap: Map | undefined = new Map();
- newMap = this.renderStickyLines(trackedEntry?.parent, this.domNode, linesToRender, newMap);
- if (!newMap) {
- newMap = new Map();
- }
- this.currentStickyLines = newMap;
-
- break;
- }
- } // cell loop close
+ private updateContent(newMap: Map) {
+ this.setCurrentStickyLines(newMap);
this.updateDisplay();
}
@@ -390,8 +290,11 @@ export class NotebookStickyScroll extends Disposable {
this.setTop();
}
- private computeStickyHeight(entry: OutlineEntry) {
+ static computeStickyHeight(entry: OutlineEntry) {
let height = 0;
+ if (entry.cell.cellKind === CellKind.Markup) {
+ height += 22;
+ }
while (entry.parent) {
height += 22;
entry = entry.parent;
@@ -399,23 +302,34 @@ export class NotebookStickyScroll extends Disposable {
return height;
}
- private renderStickyLines(entry: OutlineEntry | undefined, containerElement: HTMLElement, numLinesToRender: number, newMap: Map) {
- const partial = false;
+ static renderStickyLines(entry: OutlineEntry | undefined, containerElement: HTMLElement, numLinesToRender: number, newMap: Map, notebookEditor: INotebookEditor) {
let currentEntry = entry;
const elementsToRender = [];
while (currentEntry) {
if (currentEntry.level === 7) {
- // level 7 represents a comment in python, which we don't want to render
+ // level 7 represents a non-header entry, which we don't want to render
currentEntry = currentEntry.parent;
continue;
}
- const lineToRender = this.createStickyElement(currentEntry, partial);
- newMap.set(currentEntry, lineToRender);
+ const lineToRender = NotebookStickyScroll.createStickyElement(currentEntry, notebookEditor);
+ newMap.set(currentEntry, { line: lineToRender, rendered: false });
elementsToRender.unshift(lineToRender);
currentEntry = currentEntry.parent;
}
+ // TODO: clean up partial cell animation
+ // [ ] slight pop as lines finish disappearing
+ // [ ] only actually works when shrunk against new section. **and only for BOTTOM of that initial sticky tree**
+ // [ ] issues with HC themes
+ // use negative margins to render the bottom sticky line as a partial element
+ // todo: partial render logic here
+ // if (numLinesToRender % 1 !== 0) {
+ // const partialHeight = 22 - Math.floor((numLinesToRender % 1) * 22);
+ // elementsToRender[elementsToRender.length - 1].element.style.zIndex = '-1';
+ // elementsToRender[elementsToRender.length - 1].element.style.marginTop = `-${partialHeight}px`;
+ // }
+
// iterate over elements to render, and append to container
// break when we reach numLinesToRender
for (let i = 0; i < elementsToRender.length; i++) {
@@ -423,33 +337,138 @@ export class NotebookStickyScroll extends Disposable {
break;
}
containerElement.append(elementsToRender[i].element);
+ newMap.set(elementsToRender[i].entry, { line: elementsToRender[i], rendered: true });
}
containerElement.append(DOM.$('div', { class: 'notebook-shadow' })); // ensure we have dropShadow at base of sticky scroll
return newMap;
}
- private createStickyElement(entry: OutlineEntry, partial: boolean) {
+ static createStickyElement(entry: OutlineEntry, notebookEditor: INotebookEditor) {
const stickyElement = document.createElement('div');
stickyElement.classList.add('notebook-sticky-scroll-line');
stickyElement.innerText = '#'.repeat(entry.level) + ' ' + entry.label;
+ return new NotebookStickyLine(stickyElement, entry, notebookEditor);
+ }
- // todo: partial line rendering for animater
- if (partial) {
- // const partialHeight = Math.floor(remainder * 22);
- // stickyLine.style.height = `${partialHeight}px`;
- }
-
- return new NotebookStickyLine(stickyElement, entry, this.notebookEditor);
+ private disposeCurrentStickyLines() {
+ this.currentStickyLines.forEach((value) => {
+ value.line.dispose();
+ });
}
override dispose() {
this._disposables.dispose();
- this.currentStickyLines.forEach((value) => {
- value.dispose();
- });
+ this.disposeCurrentStickyLines();
super.dispose();
}
}
+export function computeContent(domNode: HTMLElement, notebookEditor: INotebookEditor, notebookCellList: INotebookCellList, notebookOutlineEntries: OutlineEntry[]): Map {
+ // find first code cell in visible range. this marks the start of the first section
+ // find the last code cell in the first section of the visible range, store the bottom scroll position in a const sectionBottom
+ // compute sticky scroll height, and check if editorScrolltop + stickyScrollHeight < sectionBottom
+ // if that condition is true, break out of the loop with that cell as the tracked cell
+ // if that condition is false, continue to next cell
+
+ const editorScrollTop = notebookEditor.scrollTop;
+
+ // find last code cell of section, store bottom scroll position in sectionBottom
+ const visibleRange = notebookEditor.visibleRanges[0];
+ if (!visibleRange) {
+ return new Map();
+ }
+
+ let trackedEntry = undefined;
+ let sectionBottom = 0;
+ for (let i = visibleRange.start; i < visibleRange.end; i++) {
+ const cell = notebookEditor.cellAt(i);
+ if (!cell) {
+ return new Map();
+ }
+
+ const nextCell = notebookEditor.cellAt(i + 1);
+
+ // account for transitions between top level headers
+ if (cell.cellKind === CellKind.Markup) {
+ sectionBottom = notebookCellList.getCellViewScrollBottom(cell);
+ const entry = NotebookStickyScroll.getVisibleOutlineEntry(i, notebookOutlineEntries);
+ if (!entry) {
+ return new Map();
+ }
+
+ if (!entry.parent) {
+ // if the cell is a top level header, only render once we have scrolled past the bottom of the cell
+ // todo: (polish) figure out what padding value to use here. need to account properly for bottom insert cell toolbar, cell toolbar, and md cell bottom padding
+ if (sectionBottom > editorScrollTop) {
+ return new Map();
+ }
+ }
+ }
+
+ // if we are here, the cell is a code cell.
+ // check next cell, if markdown, that means this is the end of the section
+ if (nextCell && i + 1 < visibleRange.end) {
+ if (nextCell.cellKind === CellKind.Markup) {
+ // this is the end of the section
+ // store the bottom scroll position of this cell
+ sectionBottom = notebookCellList.getCellViewScrollBottom(cell);
+ // compute sticky scroll height
+ const entry = NotebookStickyScroll.getVisibleOutlineEntry(i, notebookOutlineEntries);
+ if (!entry) {
+ return new Map();
+ }
+ // check if we can render this section of sticky
+ const currentSectionStickyHeight = NotebookStickyScroll.computeStickyHeight(entry!);
+ if (editorScrollTop + currentSectionStickyHeight < sectionBottom) {
+ const linesToRender = Math.floor((sectionBottom - editorScrollTop) / 22);
+ let newMap: Map = new Map();
+ newMap = NotebookStickyScroll.renderStickyLines(entry, domNode, linesToRender, newMap, notebookEditor);
+ return newMap;
+ }
+
+ let nextSectionEntry = undefined;
+ for (let j = 1; j < visibleRange.end - i; j++) {
+ // find next section after this one
+ const cellCheck = notebookEditor.cellAt(i + j);
+ if (cellCheck) {
+ nextSectionEntry = NotebookStickyScroll.getVisibleOutlineEntry(i + j, notebookOutlineEntries);
+ if (nextSectionEntry) {
+ break;
+ }
+ }
+ }
+ const nextSectionStickyHeight = NotebookStickyScroll.computeStickyHeight(nextSectionEntry!);
+
+ // recompute section bottom based on the top of the next section
+ sectionBottom = notebookCellList.getCellViewScrollTop(nextSectionEntry!.cell) - 10;
+
+ // this block of logic cleans transitions between two sections that share a parent.
+ // if the current section and the next section share a parent, then we can render the next section's sticky lines to avoid pop-in between
+ if (entry?.parent?.parent === nextSectionEntry?.parent) {
+ const linesToRender = Math.floor((sectionBottom - editorScrollTop) / 22) + 100;
+ let newMap: Map = new Map();
+ newMap = NotebookStickyScroll.renderStickyLines(nextSectionEntry?.parent, domNode, linesToRender, newMap, notebookEditor);
+ return newMap;
+ } else if (Math.abs(currentSectionStickyHeight - nextSectionStickyHeight) > 22) { // only shrink sticky
+ const linesToRender = (sectionBottom - editorScrollTop) / 22;
+ let newMap: Map = new Map();
+ newMap = NotebookStickyScroll.renderStickyLines(entry?.parent, domNode, linesToRender, newMap, notebookEditor);
+ return newMap;
+ }
+ }
+ } else {
+ // there is no next visible cell, so use the bottom of the editor as the sectionBottom, using scrolltop + height
+ sectionBottom = notebookEditor.getLayoutInfo().scrollHeight;
+ trackedEntry = NotebookStickyScroll.getVisibleOutlineEntry(i, notebookOutlineEntries);
+ const linesToRender = Math.floor((sectionBottom - editorScrollTop) / 22);
+
+ let newMap: Map = new Map();
+ newMap = NotebookStickyScroll.renderStickyLines(trackedEntry?.parent, domNode, linesToRender, newMap, notebookEditor);
+ return newMap;
+ }
+ } // for cell loop close
+ return new Map();
+}
+
registerAction2(ToggleNotebookStickyScroll);
diff --git a/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test0__should_render_empty___scrollTop_at_0_0.snap b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test0__should_render_empty___scrollTop_at_0_0.snap
new file mode 100644
index 00000000000..f6ffad5cb32
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test0__should_render_empty___scrollTop_at_0_0.snap
@@ -0,0 +1 @@
+[ ]
\ No newline at end of file
diff --git a/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test1__should_render_0-_1___visible_range_3-_8_0.snap b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test1__should_render_0-_1___visible_range_3-_8_0.snap
new file mode 100644
index 00000000000..1bcf0a58d43
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test1__should_render_0-_1___visible_range_3-_8_0.snap
@@ -0,0 +1 @@
+[ "# header a", "## header aa" ]
\ No newline at end of file
diff --git a/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test2__should_render_0____visible_range_6-_9_so_collapsing_next_2_against_following_section_0.snap b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test2__should_render_0____visible_range_6-_9_so_collapsing_next_2_against_following_section_0.snap
new file mode 100644
index 00000000000..3f23335f240
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test2__should_render_0____visible_range_6-_9_so_collapsing_next_2_against_following_section_0.snap
@@ -0,0 +1 @@
+[ "# header a" ]
\ No newline at end of file
diff --git a/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test3__should_render_0-_1___collapsing_against_equivalent_level_header_0.snap b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test3__should_render_0-_1___collapsing_against_equivalent_level_header_0.snap
new file mode 100644
index 00000000000..1bcf0a58d43
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test3__should_render_0-_1___collapsing_against_equivalent_level_header_0.snap
@@ -0,0 +1 @@
+[ "# header a", "## header aa" ]
\ No newline at end of file
diff --git a/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test4__should_render_0____scrolltop_halfway_through_cell_0_0.snap b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test4__should_render_0____scrolltop_halfway_through_cell_0_0.snap
new file mode 100644
index 00000000000..3f23335f240
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test4__should_render_0____scrolltop_halfway_through_cell_0_0.snap
@@ -0,0 +1 @@
+[ "# header a" ]
\ No newline at end of file
diff --git a/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test5__should_render_0-_2___scrolltop_halfway_through_cell_2_0.snap b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test5__should_render_0-_2___scrolltop_halfway_through_cell_2_0.snap
new file mode 100644
index 00000000000..cf5583b0ab9
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test5__should_render_0-_2___scrolltop_halfway_through_cell_2_0.snap
@@ -0,0 +1 @@
+[ "# header a", "## header aa", "### header aaa" ]
diff --git a/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test6__should_render_6-_7___scrolltop_halfway_through_cell_7_0.snap b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test6__should_render_6-_7___scrolltop_halfway_through_cell_7_0.snap
new file mode 100644
index 00000000000..77fe21fe781
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test6__should_render_6-_7___scrolltop_halfway_through_cell_7_0.snap
@@ -0,0 +1 @@
+[ "# header b", "## header bb" ]
\ No newline at end of file
diff --git a/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test7__should_render_0-_1___collapsing_against_next_section_0.snap b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test7__should_render_0-_1___collapsing_against_next_section_0.snap
new file mode 100644
index 00000000000..1bcf0a58d43
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/__snapshots__/NotebookEditorStickyScroll_test7__should_render_0-_1___collapsing_against_next_section_0.snap
@@ -0,0 +1 @@
+[ "# header a", "## header aa" ]
\ No newline at end of file
diff --git a/src/vs/workbench/contrib/notebook/test/browser/notebookStickyScroll.test.ts b/src/vs/workbench/contrib/notebook/test/browser/notebookStickyScroll.test.ts
new file mode 100644
index 00000000000..99cb8117b61
--- /dev/null
+++ b/src/vs/workbench/contrib/notebook/test/browser/notebookStickyScroll.test.ts
@@ -0,0 +1,368 @@
+/*---------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import * as assert from 'assert';
+import { isWeb } from 'vs/base/common/platform';
+import { Event } from 'vs/base/common/event';
+import { DisposableStore } from 'vs/base/common/lifecycle';
+import { mock } from 'vs/base/test/common/mock';
+import { assertSnapshot } from 'vs/base/test/common/snapshot';
+import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
+import { NotebookCellOutline } from 'vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline';
+import { INotebookEditor, INotebookEditorPane } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
+import { INotebookCellList } from 'vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon';
+import { OutlineEntry } from 'vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider';
+import { NotebookStickyLine, computeContent } from 'vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll';
+import { CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon';
+import { createNotebookCellList, setupInstantiationService, withTestNotebook } from 'vs/workbench/contrib/notebook/test/browser/testNotebookEditor';
+import { OutlineTarget } from 'vs/workbench/services/outline/browser/outline';
+
+
+(isWeb ? suite.skip : suite)('NotebookEditorStickyScroll', () => {
+
+ let disposables: DisposableStore;
+ let instantiationService: TestInstantiationService;
+
+ const domNode: HTMLElement = document.createElement('div');
+
+ suiteSetup(() => {
+ disposables = new DisposableStore();
+ instantiationService = setupInstantiationService(disposables);
+ });
+
+ suiteTeardown(() => disposables.dispose());
+
+ function getOutline(editor: any) {
+ if (!editor.hasModel()) {
+ assert.ok(false, 'MUST have active text editor');
+ }
+ const outline = instantiationService.createInstance(NotebookCellOutline, new class extends mock() {
+ override getControl() {
+ return editor;
+ }
+ override onDidChangeModel: Event = Event.None;
+ }, OutlineTarget.QuickPick);
+ return outline;
+ }
+
+ function nbStickyTestHelper(domNode: HTMLElement, notebookEditor: INotebookEditor, notebookCellList: INotebookCellList, notebookOutlineEntries: OutlineEntry[]) {
+ const output = computeContent(domNode, notebookEditor, notebookCellList, notebookOutlineEntries);
+ return createStickyTestElement(output.values());
+ }
+
+ function createStickyTestElement(stickyLines: IterableIterator<{ line: NotebookStickyLine; rendered: boolean }>) {
+ const outputElements = [];
+ for (const stickyLine of stickyLines) {
+ if (stickyLine.rendered) {
+ outputElements.unshift(stickyLine.line.element.innerText);
+ }
+ }
+ return outputElements;
+ }
+
+ test('test0: should render empty, scrollTop at 0', async function () {
+ await withTestNotebook(
+ [
+ ['# header a', 'markdown', CellKind.Markup, [], {}],
+ ['## header aa', 'markdown', CellKind.Markup, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['# header b', 'markdown', CellKind.Markup, [], {}],
+ ['var c = 2;', 'javascript', CellKind.Code, [], {}]
+ ],
+ async (editor, viewModel) => {
+ viewModel.restoreEditorViewState({
+ editingCells: Array.from({ length: 8 }, () => false),
+ editorViewStates: Array.from({ length: 8 }, () => null),
+ cellTotalHeights: Array.from({ length: 8 }, () => 50),
+ cellLineNumberStates: {},
+ collapsedInputCells: {},
+ collapsedOutputCells: {},
+ });
+
+ const cellList = createNotebookCellList(instantiationService);
+ cellList.attachViewModel(viewModel);
+ cellList.layout(400, 100);
+
+ editor.setScrollTop(0);
+ editor.visibleRanges = [{ start: 0, end: 8 }];
+
+ const notebookOutlineEntries = getOutline(editor).entries;
+ const resultingMap = nbStickyTestHelper(domNode, editor, cellList, notebookOutlineEntries);
+ await assertSnapshot(resultingMap);
+ });
+ });
+
+ test('test1: should render 0->1, visible range 3->8', async function () {
+ await withTestNotebook(
+ [
+ ['# header a', 'markdown', CellKind.Markup, [], {}], // 0
+ ['## header aa', 'markdown', CellKind.Markup, [], {}], // 50
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 100
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 150
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 200
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 250
+ ['# header b', 'markdown', CellKind.Markup, [], {}], // 300
+ ['var c = 2;', 'javascript', CellKind.Code, [], {}] // 350
+ ],
+ async (editor, viewModel) => {
+ viewModel.restoreEditorViewState({
+ editingCells: Array.from({ length: 8 }, () => false),
+ editorViewStates: Array.from({ length: 8 }, () => null),
+ cellTotalHeights: Array.from({ length: 8 }, () => 50),
+ cellLineNumberStates: {},
+ collapsedInputCells: {},
+ collapsedOutputCells: {},
+ });
+
+ const cellList = createNotebookCellList(instantiationService);
+ cellList.attachViewModel(viewModel);
+ cellList.layout(400, 100);
+
+ editor.setScrollTop(175);
+ editor.visibleRanges = [{ start: 3, end: 8 }];
+
+ const notebookOutlineEntries = getOutline(editor).entries;
+ const resultingMap = nbStickyTestHelper(domNode, editor, cellList, notebookOutlineEntries);
+
+ await assertSnapshot(resultingMap);
+ });
+ });
+
+ test('test2: should render 0, visible range 6->9 so collapsing next 2 against following section', async function () {
+ await withTestNotebook(
+ [
+ ['# header a', 'markdown', CellKind.Markup, [], {}], // 0
+ ['## header aa', 'markdown', CellKind.Markup, [], {}], // 50
+ ['### header aaa', 'markdown', CellKind.Markup, [], {}],// 100
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 150
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 200
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 250
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 300
+ ['# header b', 'markdown', CellKind.Markup, [], {}], // 350
+ ['var c = 2;', 'javascript', CellKind.Code, [], {}] // 400
+ ],
+ async (editor, viewModel) => {
+ viewModel.restoreEditorViewState({
+ editingCells: Array.from({ length: 9 }, () => false),
+ editorViewStates: Array.from({ length: 9 }, () => null),
+ cellTotalHeights: Array.from({ length: 9 }, () => 50),
+ cellLineNumberStates: {},
+ collapsedInputCells: {},
+ collapsedOutputCells: {},
+ });
+
+ const cellList = createNotebookCellList(instantiationService);
+ cellList.attachViewModel(viewModel);
+ cellList.layout(400, 100);
+
+ editor.setScrollTop(325); // room for a single header
+ editor.visibleRanges = [{ start: 6, end: 9 }];
+
+ const notebookOutlineEntries = getOutline(editor).entries;
+ const resultingMap = nbStickyTestHelper(domNode, editor, cellList, notebookOutlineEntries);
+
+ await assertSnapshot(resultingMap);
+ });
+ });
+
+ test('test3: should render 0->1, collapsing against equivalent level header', async function () {
+ await withTestNotebook(
+ [
+ ['# header a', 'markdown', CellKind.Markup, [], {}], // 0
+ ['## header aa', 'markdown', CellKind.Markup, [], {}], // 50
+ ['### header aaa', 'markdown', CellKind.Markup, [], {}],// 100
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 150
+ ['### header aab', 'markdown', CellKind.Markup, [], {}],// 200
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 250
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 300
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], // 350
+ ['# header b', 'markdown', CellKind.Markup, [], {}], // 400
+ ['var c = 2;', 'javascript', CellKind.Code, [], {}] // 450
+ ],
+ async (editor, viewModel) => {
+ viewModel.restoreEditorViewState({
+ editingCells: Array.from({ length: 10 }, () => false),
+ editorViewStates: Array.from({ length: 10 }, () => null),
+ cellTotalHeights: Array.from({ length: 10 }, () => 50),
+ cellLineNumberStates: {},
+ collapsedInputCells: {},
+ collapsedOutputCells: {},
+ });
+
+ const cellList = createNotebookCellList(instantiationService);
+ cellList.attachViewModel(viewModel);
+ cellList.layout(400, 100);
+
+ editor.setScrollTop(175); // room for a single header
+ editor.visibleRanges = [{ start: 3, end: 10 }];
+
+ const notebookOutlineEntries = getOutline(editor).entries;
+ const resultingMap = nbStickyTestHelper(domNode, editor, cellList, notebookOutlineEntries);
+
+ await assertSnapshot(resultingMap);
+ });
+ });
+
+ // outdated/improper behavior
+ test.skip('test4: should render 0, scrolltop halfway through cell 0', async function () {
+ await withTestNotebook(
+ [
+ ['# header a', 'markdown', CellKind.Markup, [], {}],
+ ['## header aa', 'markdown', CellKind.Markup, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['# header b', 'markdown', CellKind.Markup, [], {}],
+ ['var c = 2;', 'javascript', CellKind.Code, [], {}]
+ ],
+ async (editor, viewModel) => {
+ viewModel.restoreEditorViewState({
+ editingCells: Array.from({ length: 8 }, () => false),
+ editorViewStates: Array.from({ length: 8 }, () => null),
+ cellTotalHeights: Array.from({ length: 8 }, () => 50),
+ cellLineNumberStates: {},
+ collapsedInputCells: {},
+ collapsedOutputCells: {},
+ });
+
+ const cellList = createNotebookCellList(instantiationService);
+ cellList.attachViewModel(viewModel);
+ cellList.layout(400, 100);
+
+ editor.setScrollTop(50);
+ editor.visibleRanges = [{ start: 0, end: 8 }];
+
+ const notebookOutlineEntries = getOutline(editor).entries;
+ const resultingMap = nbStickyTestHelper(domNode, editor, cellList, notebookOutlineEntries);
+
+ await assertSnapshot(resultingMap);
+ });
+ });
+
+ // outdated/improper behavior
+ test.skip('test5: should render 0->2, scrolltop halfway through cell 2', async function () {
+ await withTestNotebook(
+ [
+ ['# header a', 'markdown', CellKind.Markup, [], {}],
+ ['## header aa', 'markdown', CellKind.Markup, [], {}],
+ ['### header aaa', 'markdown', CellKind.Markup, [], {}],
+ ['#### header aaaa', 'markdown', CellKind.Markup, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['# header b', 'markdown', CellKind.Markup, [], {}],
+ ['var c = 2;', 'javascript', CellKind.Code, [], {}]
+ ],
+ async (editor, viewModel) => {
+ viewModel.restoreEditorViewState({
+ editingCells: Array.from({ length: 10 }, () => false),
+ editorViewStates: Array.from({ length: 10 }, () => null),
+ cellTotalHeights: Array.from({ length: 10 }, () => 50),
+ cellLineNumberStates: {},
+ collapsedInputCells: {},
+ collapsedOutputCells: {},
+ });
+
+ const cellList = createNotebookCellList(instantiationService);
+ cellList.attachViewModel(viewModel);
+ cellList.layout(400, 100);
+
+ editor.setScrollTop(125);
+ editor.visibleRanges = [{ start: 2, end: 10 }];
+
+ const notebookOutlineEntries = getOutline(editor).entries;
+ const resultingMap = nbStickyTestHelper(domNode, editor, cellList, notebookOutlineEntries);
+
+ await assertSnapshot(resultingMap);
+ });
+ });
+
+ // outdated/improper behavior
+ test.skip('test6: should render 6->7, scrolltop halfway through cell 7', async function () {
+ await withTestNotebook(
+ [
+ ['# header a', 'markdown', CellKind.Markup, [], {}],
+ ['## header aa', 'markdown', CellKind.Markup, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}],
+ ['# header b', 'markdown', CellKind.Markup, [], {}],
+ ['## header bb', 'markdown', CellKind.Markup, [], {}],
+ ['### header bbb', 'markdown', CellKind.Markup, [], {}],
+ ['var c = 2;', 'javascript', CellKind.Code, [], {}]
+ ],
+ async (editor, viewModel) => {
+ viewModel.restoreEditorViewState({
+ editingCells: Array.from({ length: 10 }, () => false),
+ editorViewStates: Array.from({ length: 10 }, () => null),
+ cellTotalHeights: Array.from({ length: 10 }, () => 50),
+ cellLineNumberStates: {},
+ collapsedInputCells: {},
+ collapsedOutputCells: {},
+ });
+
+ const cellList = createNotebookCellList(instantiationService);
+ cellList.attachViewModel(viewModel);
+ cellList.layout(400, 100);
+
+ editor.setScrollTop(375);
+ editor.visibleRanges = [{ start: 7, end: 10 }];
+
+ const notebookOutlineEntries = getOutline(editor).entries;
+ const resultingMap = nbStickyTestHelper(domNode, editor, cellList, notebookOutlineEntries);
+
+ await assertSnapshot(resultingMap);
+ });
+ });
+
+ // waiting on behavior push to fix this.
+ test('test7: should render 0->1, collapsing against next section', async function () {
+ await withTestNotebook(
+ [
+ ['# header a', 'markdown', CellKind.Markup, [], {}], //0
+ ['## header aa', 'markdown', CellKind.Markup, [], {}], //50
+ ['### header aaa', 'markdown', CellKind.Markup, [], {}], //100
+ ['#### header aaaa', 'markdown', CellKind.Markup, [], {}], //150
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], //200
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], //250
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], //300
+ ['var b = 1;', 'javascript', CellKind.Code, [], {}], //350
+ ['# header b', 'markdown', CellKind.Markup, [], {}], //400
+ ['## header bb', 'markdown', CellKind.Markup, [], {}], //450
+ ['### header bbb', 'markdown', CellKind.Markup, [], {}],
+ ['var c = 2;', 'javascript', CellKind.Code, [], {}]
+ ],
+ async (editor, viewModel) => {
+ viewModel.restoreEditorViewState({
+ editingCells: Array.from({ length: 12 }, () => false),
+ editorViewStates: Array.from({ length: 12 }, () => null),
+ cellTotalHeights: Array.from({ length: 12 }, () => 50),
+ cellLineNumberStates: {},
+ collapsedInputCells: {},
+ collapsedOutputCells: {},
+ });
+
+ const cellList = createNotebookCellList(instantiationService);
+ cellList.attachViewModel(viewModel);
+ cellList.layout(400, 100);
+
+ editor.setScrollTop(350);
+ editor.visibleRanges = [{ start: 7, end: 12 }];
+
+ const notebookOutlineEntries = getOutline(editor).entries;
+ const resultingMap = nbStickyTestHelper(domNode, editor, cellList, notebookOutlineEntries);
+
+ await assertSnapshot(resultingMap);
+ });
+ });
+
+
+});
diff --git a/src/vs/workbench/contrib/notebook/test/browser/testNotebookEditor.ts b/src/vs/workbench/contrib/notebook/test/browser/testNotebookEditor.ts
index 54cdf355fcf..c7bcfcf6d3b 100644
--- a/src/vs/workbench/contrib/notebook/test/browser/testNotebookEditor.ts
+++ b/src/vs/workbench/contrib/notebook/test/browser/testNotebookEditor.ts
@@ -42,7 +42,7 @@ import { IWorkspaceTrustRequestService } from 'vs/platform/workspace/common/work
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { EditorModel } from 'vs/workbench/common/editor/editorModel';
import { CellFindMatchWithIndex, IActiveNotebookEditorDelegate, IBaseCellEditorOptions, ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
-import { NotebookCellStateChangedEvent } from 'vs/workbench/contrib/notebook/browser/notebookViewEvents';
+import { NotebookCellStateChangedEvent, NotebookLayoutInfo } from 'vs/workbench/contrib/notebook/browser/notebookViewEvents';
import { NotebookCellStatusBarService } from 'vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl';
import { ListViewInfoAccessor, NotebookCellList } from 'vs/workbench/contrib/notebook/browser/view/notebookCellList';
import { BaseCellRenderTemplate } from 'vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon';
@@ -61,6 +61,8 @@ import { IWorkingCopySaveEvent } from 'vs/workbench/services/workingCopy/common/
import { TestWorkspaceTrustRequestService } from 'vs/workbench/services/workspaces/test/common/testWorkspaceTrustService';
import { TestLayoutService } from 'vs/workbench/test/browser/workbenchTestServices';
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
+import { FontInfo } from 'vs/editor/common/config/fontInfo';
+import { EditorFontLigatures, EditorFontVariations } from 'vs/editor/common/config/editorOptions';
export class TestCell extends NotebookCellTextModel {
constructor(
@@ -218,6 +220,8 @@ function _createTestNotebookEditor(instantiationService: TestInstantiationServic
cellList.attachViewModel(viewModel);
const listViewInfoAccessor = new ListViewInfoAccessor(cellList);
+ let visibleRanges: ICellRange[] = [{ start: 0, end: 100 }];
+
const notebookEditor: IActiveNotebookEditorDelegate = new class extends mock() {
override dispose() {
viewModel.dispose();
@@ -289,8 +293,48 @@ function _createTestNotebookEditor(instantiationService: TestInstantiationServic
}
override deltaCellDecorations() { return []; }
override onDidChangeVisibleRanges = Event.None;
- override visibleRanges: ICellRange[] = [{ start: 0, end: 100 }];
+
+ override get visibleRanges() {
+ return visibleRanges;
+ }
+
+ override set visibleRanges(_ranges: ICellRange[]) {
+ visibleRanges = _ranges;
+ }
+
override getId(): string { return ''; }
+ override setScrollTop(scrollTop: number): void {
+ cellList.scrollTop = scrollTop;
+ }
+ override get scrollTop(): number {
+ return cellList.scrollTop;
+ }
+ override getLayoutInfo(): NotebookLayoutInfo {
+ return {
+ width: 0,
+ height: 0,
+ scrollHeight: cellList.getScrollHeight(),
+ fontInfo: new FontInfo({
+ pixelRatio: 1,
+ fontFamily: 'mockFont',
+ fontWeight: 'normal',
+ fontSize: 14,
+ fontFeatureSettings: EditorFontLigatures.OFF,
+ fontVariationSettings: EditorFontVariations.OFF,
+ lineHeight: 19,
+ letterSpacing: 1.5,
+ isMonospace: true,
+ typicalHalfwidthCharacterWidth: 10,
+ typicalFullwidthCharacterWidth: 20,
+ canUseHalfwidthRightwardsArrow: true,
+ spaceWidth: 10,
+ middotWidth: 10,
+ wsmiddotWidth: 10,
+ maxDigitWidth: 10,
+ }, true),
+ stickyHeight: 0
+ };
+ }
};
return { editor: notebookEditor, viewModel };
@@ -345,7 +389,11 @@ export async function withTestNotebookDiffModel(originalCells: [source:
return res;
}
-export async function withTestNotebook(cells: [source: string, lang: string, kind: CellKind, output?: IOutputDto[], metadata?: NotebookCellMetadata][], callback: (editor: IActiveNotebookEditorDelegate, viewModel: NotebookViewModel, accessor: TestInstantiationService) => Promise | R, accessor?: TestInstantiationService): Promise {
+interface IActiveTestNotebookEditorDelegate extends IActiveNotebookEditorDelegate {
+ visibleRanges: ICellRange[];
+}
+
+export async function withTestNotebook(cells: [source: string, lang: string, kind: CellKind, output?: IOutputDto[], metadata?: NotebookCellMetadata][], callback: (editor: IActiveTestNotebookEditorDelegate, viewModel: NotebookViewModel, accessor: TestInstantiationService) => Promise | R, accessor?: TestInstantiationService): Promise {
const disposables = new DisposableStore();
const instantiationService = accessor ?? setupInstantiationService(disposables);
const notebookEditor = _createTestNotebookEditor(instantiationService, cells);
diff --git a/src/vs/workbench/contrib/output/browser/output.contribution.ts b/src/vs/workbench/contrib/output/browser/output.contribution.ts
index 87d04e5fb83..44b292ed5b1 100644
--- a/src/vs/workbench/contrib/output/browser/output.contribution.ts
+++ b/src/vs/workbench/contrib/output/browser/output.contribution.ts
@@ -54,7 +54,7 @@ ModesRegistry.registerLanguage({
const outputViewIcon = registerIcon('output-view-icon', Codicon.output, nls.localize('outputViewIcon', 'View icon of the output view.'));
const VIEW_CONTAINER: ViewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: OUTPUT_VIEW_ID,
- title: nls.localize('output', "Output"),
+ title: { value: nls.localize('output', "Output"), original: 'Output' },
icon: outputViewIcon,
order: 1,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [OUTPUT_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]),
diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
index d0666ca8be5..d751cf35bdd 100644
--- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
+++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
@@ -1273,8 +1273,9 @@ export class SettingsEditor2 extends EditorPane {
if (toggleData && groups.filter(g => g.extensionInfo).length) {
for (const key in toggleData.settingsEditorRecommendedExtensions) {
const extensionId = key;
- // Always recommend prerelease for now.
- const [extension] = await this.extensionGalleryService.getExtensions([{ id: extensionId, preRelease: true }], CancellationToken.None);
+ // Recommend prerelease if not on Stable.
+ const isStable = this.productService.quality === 'stable';
+ const [extension] = await this.extensionGalleryService.getExtensions([{ id: extensionId, preRelease: !isStable }], CancellationToken.None);
if (!extension) {
continue;
}
diff --git a/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts b/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
index fef42ab467a..f3785c75aed 100644
--- a/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
+++ b/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
@@ -61,7 +61,7 @@ export class ForwardedPortsView extends Disposable implements IWorkbenchContribu
private async getViewContainer(): Promise {
return Registry.as(Extensions.ViewContainersRegistry).registerViewContainer({
id: TUNNEL_VIEW_CONTAINER_ID,
- title: nls.localize('ports', "Ports"),
+ title: { value: nls.localize('ports', "Ports"), original: 'Ports' },
icon: portsViewIcon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [TUNNEL_VIEW_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]),
storageId: TUNNEL_VIEW_CONTAINER_ID,
diff --git a/src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts b/src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts
index c71388d51fb..145c7c81a1e 100644
--- a/src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts
+++ b/src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts
@@ -789,7 +789,7 @@ Registry.as(ConfigurationExtensions.Configuration).regis
[CONFIGURATION_KEY_HOST_NAME]: {
description: localize('remoteTunnelAccess.machineName', "The name under which the remote tunnel access is registered. If not set, the host name is used."),
type: 'string',
- scope: ConfigurationScope.MACHINE,
+ scope: ConfigurationScope.APPLICATION,
pattern: '^(\\w[\\w-]*)?$',
patternErrorMessage: localize('remoteTunnelAccess.machineNameRegex', "The name must only consist of letters, numbers, underscore and dash. It must not start with a dash."),
maxLength: 20,
@@ -798,7 +798,7 @@ Registry.as(ConfigurationExtensions.Configuration).regis
[CONFIGURATION_KEY_PREVENT_SLEEP]: {
description: localize('remoteTunnelAccess.preventSleep', "Prevent the computer from sleeping when remote tunnel access is turned on."),
type: 'boolean',
- scope: ConfigurationScope.MACHINE,
+ scope: ConfigurationScope.APPLICATION,
default: false,
}
}
diff --git a/src/vs/workbench/contrib/scm/browser/scm.contribution.ts b/src/vs/workbench/contrib/scm/browser/scm.contribution.ts
index e034cf09200..f78bcd673ab 100644
--- a/src/vs/workbench/contrib/scm/browser/scm.contribution.ts
+++ b/src/vs/workbench/contrib/scm/browser/scm.contribution.ts
@@ -47,7 +47,7 @@ const sourceControlViewIcon = registerIcon('source-control-view-icon', Codicon.s
const viewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: VIEWLET_ID,
- title: localize('source control', "Source Control"),
+ title: { value: localize('source control', "Source Control"), original: 'Source Control' },
ctorDescriptor: new SyncDescriptor(SCMViewPaneContainer),
storageId: 'workbench.scm.views.state',
icon: sourceControlViewIcon,
diff --git a/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.ts b/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.ts
index 6324613fbfd..14b1636c0b8 100644
--- a/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.ts
+++ b/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.ts
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { CancellationToken } from 'vs/base/common/cancellation';
import { IMatch } from 'vs/base/common/filters';
-import { DisposableStore } from 'vs/base/common/lifecycle';
+import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
import { basenameOrAuthority, dirname } from 'vs/base/common/resources';
import { ThemeIcon } from 'vs/base/common/themables';
import { IRange, Range } from 'vs/editor/common/core/range';
@@ -15,8 +15,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { ILabelService } from 'vs/platform/label/common/label';
import { WorkbenchCompressibleObjectTree, getSelectionKeyboardEvent } from 'vs/platform/list/browser/listService';
import { FastAndSlowPicks, IPickerQuickAccessItem, PickerQuickAccessProvider, Picks } from 'vs/platform/quickinput/browser/pickerQuickAccess';
-import { DefaultQuickAccessFilterValue } from 'vs/platform/quickinput/common/quickAccess';
-import { IKeyMods, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';
+import { DefaultQuickAccessFilterValue, IQuickAccessProviderRunOptions } from 'vs/platform/quickinput/common/quickAccess';
+import { IKeyMods, IQuickPick, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';
import { IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor';
import { IViewsService } from 'vs/workbench/common/views';
@@ -75,6 +75,19 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider, token: CancellationToken, runOptions?: IQuickAccessProviderRunOptions): IDisposable {
+ const disposables = new DisposableStore();
+ disposables.add(super.provide(picker, token, runOptions));
+ disposables.add(picker.onDidHide(() => this.searchModel.searchResult.toggleHighlights(false)));
+ disposables.add(picker.onDidAccept(() => this.searchModel.searchResult.toggleHighlights(false)));
+ return disposables;
+ }
+
private get configuration() {
const editorConfig = this._configurationService.getValue().workbench?.editor;
const searchConfig = this._configurationService.getValue().search;
@@ -247,6 +260,9 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider 0) {
+ this.searchModel.searchResult.toggleHighlights(true);
+ }
if (matches.length >= MAX_FILES_SHOWN) {
return syncResult;
@@ -254,9 +270,14 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider {
- return this._getPicksFromMatches(asyncResults, MAX_FILES_SHOWN - matches.length);
- })
+ additionalPicks: allMatches.asyncResults
+ .then(asyncResults => this._getPicksFromMatches(asyncResults, MAX_FILES_SHOWN - matches.length))
+ .then(picks => {
+ if (picks.length > 0) {
+ this.searchModel.searchResult.toggleHighlights(true);
+ }
+ return picks;
+ })
};
}
diff --git a/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.ts b/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.ts
index 3971c1f112c..b517ae9e2b3 100644
--- a/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.ts
+++ b/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.ts
@@ -6,7 +6,7 @@ import * as nls from 'vs/nls';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import * as Constants from 'vs/workbench/contrib/search/common/constants';
import { RenderableMatch } from 'vs/workbench/contrib/search/browser/searchModel';
-import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions';
+import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
import { category } from 'vs/workbench/contrib/search/browser/searchActionsBase';
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
import { TEXT_SEARCH_QUICK_ACCESS_PREFIX } from 'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess';
@@ -22,11 +22,6 @@ registerAction2(class TextSearchQuickAccessAction extends Action2 {
original: 'Quick Text Search (Experimental)'
},
category,
- menu: [{
- id: MenuId.SearchContext,
- group: 'search_2',
- order: 1
- }],
f1: true
});
diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts
index b87d1347816..dd150169376 100644
--- a/src/vs/workbench/contrib/search/browser/searchView.ts
+++ b/src/vs/workbench/contrib/search/browser/searchView.ts
@@ -1894,7 +1894,6 @@ export class SearchView extends ViewPane {
pinned,
selection,
revealIfVisible: true,
- indexedCellOptions: element instanceof MatchInNotebook ? { index: element.cellIndex, selection: element.range() } : undefined,
};
try {
diff --git a/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts b/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts
index c53bc26175e..ad3172b3878 100644
--- a/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts
+++ b/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts
@@ -638,6 +638,21 @@ export class WorkspaceTagsService implements IWorkspaceTagsService {
return Promise.resolve(tags);
}
+ const aiGeneratedWorkspaces = URI.joinPath(this.environmentService.workspaceStorageHome, 'aiGeneratedWorkspaces.json');
+ await this.fileService.exists(aiGeneratedWorkspaces).then(async result => {
+ if (result) {
+ try {
+ const content = await this.fileService.readFile(aiGeneratedWorkspaces);
+ const workspaces = JSON.parse(content.value.toString()) as string[];
+ if (workspaces.indexOf(workspace.folders[0].uri.toString()) > -1) {
+ tags['aiGenerated'] = true;
+ }
+ } catch (e) {
+ // Ignore errors when resolving file contents
+ }
+ }
+ });
+
return this.fileService.resolveAll(folders.map(resource => ({ resource }))).then((files: IFileStatResult[]) => {
const names = ([]).concat(...files.map(result => result.success ? (result.stat!.children || []) : [])).map(c => c.name);
const nameSet = names.reduce((s, n) => s.add(n.toLowerCase()), new Set());
diff --git a/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh b/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh
index 09718cfbab2..cc2cb83e0d2 100644
--- a/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh
+++ b/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh
@@ -51,7 +51,7 @@ if [ -n "${VSCODE_ENV_PREPEND:-}" ]; then
IFS=':' read -rA ADDR <<< "$VSCODE_ENV_PREPEND"
for ITEM in "${ADDR[@]}"; do
VARNAME="$(echo ${ITEM%%=*})"
- export $VARNAME="$(echo -e {ITEM#*=})${(P)VARNAME}"
+ export $VARNAME="$(echo -e ${ITEM#*=})${(P)VARNAME}"
done
unset VSCODE_ENV_PREPEND
fi
@@ -59,7 +59,7 @@ if [ -n "${VSCODE_ENV_APPEND:-}" ]; then
IFS=':' read -rA ADDR <<< "$VSCODE_ENV_APPEND"
for ITEM in "${ADDR[@]}"; do
VARNAME="$(echo ${ITEM%%=*})"
- export $VARNAME="${(P)VARNAME}$(echo -e {ITEM#*=})"
+ export $VARNAME="${(P)VARNAME}$(echo -e ${ITEM#*=})"
done
unset VSCODE_ENV_APPEND
fi
diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
index eea627b0e88..1bb341555ef 100644
--- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
+++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
@@ -123,7 +123,7 @@ Registry.as(DragAndDropExtensions.DragAndDropC
// Register views
const VIEW_CONTAINER = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: TERMINAL_VIEW_ID,
- title: nls.localize('terminal', "Terminal"),
+ title: { value: nls.localize('terminal', "Terminal"), original: 'Terminal' },
icon: terminalViewIcon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [TERMINAL_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]),
storageId: TERMINAL_VIEW_ID,
diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.ts b/src/vs/workbench/contrib/terminal/browser/terminal.ts
index e02fbf99e5e..4092072afd7 100644
--- a/src/vs/workbench/contrib/terminal/browser/terminal.ts
+++ b/src/vs/workbench/contrib/terminal/browser/terminal.ts
@@ -170,7 +170,7 @@ export interface IDetachedTerminalInstance extends IDisposable {
attachToElement(container: HTMLElement, options?: Partial