diff --git a/.github/workflows/job-compile-and-test.yml b/.github/workflows/job-compile-and-test.yml index 2b3998d49..1756d2986 100644 --- a/.github/workflows/job-compile-and-test.yml +++ b/.github/workflows/job-compile-and-test.yml @@ -42,6 +42,14 @@ jobs: run: yarn test working-directory: Extension + # These tests don't require the binary. + # On Linux, it is failing (before the tests actually run) with: Test run terminated with signal SIGSEGV. + # But it works on Linux during the E2E test. + - name: Run SingleRootProject tests + if: ${{ inputs.platform != 'linux' }} + run: yarn test --scenario=SingleRootProject --skipCheckBinaries + working-directory: Extension + # NOTE : We can't run the test that require the native binary files # yet -- there will be an update soon that allows the tester to # acquire them on-the-fly diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92d7a6944..8acc52bac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ * [Build and debug the extension](Documentation/Building%20the%20Extension.md). * File an [issue](https://github.com/Microsoft/vscode-cpptools/issues) and a [pull request](https://github.com/Microsoft/vscode-cpptools/pulls) with the change and we will review it. * If the change affects functionality, add a line describing the change to [**CHANGELOG.md**](Extension/CHANGELOG.md). -* Try and add a test in [**test/extension.test.ts**](Extension/test/unitTests/extension.test.ts). +* Try and add a test in [**test/extension.test.ts**](Extension/test/scenarios/SingleRootProject/tests/extension.test.ts). * Run tests via opening the [**Extension**](https://github.com/Microsoft/vscode-cpptools/tree/main/Extension) folder in Visual Studio Code, selecting the "Launch Tests" configuration in the Debug pane, and choosing "Start Debugging". ## About the Code diff --git a/Extension/.eslintrc.js b/Extension/.eslintrc.js index 43ce2e76c..4cd07eb8b 100644 --- a/Extension/.eslintrc.js +++ b/Extension/.eslintrc.js @@ -24,17 +24,6 @@ module.exports = { "eslint-plugin-header" ], "rules": { - "indent": [ - "warn", - 4, - { - "SwitchCase": 1, - "ObjectExpression": "first" - } - ], - "@typescript-eslint/indent": [ - "error", 4 - ], "@typescript-eslint/adjacent-overload-signatures": "error", "@typescript-eslint/array-type": "error", "@typescript-eslint/await-thenable": "error", diff --git a/Extension/.scripts/common.ts b/Extension/.scripts/common.ts index 490d464c2..598ff97e8 100644 --- a/Extension/.scripts/common.ts +++ b/Extension/.scripts/common.ts @@ -334,6 +334,9 @@ export async function checkDTS() { } export async function checkBinaries() { + if ($switches.includes('--skipCheckBinaries')) { + return false; + } let failing = false; failing = !await assertAnyFile(['bin/cpptools.exe', 'bin/cpptools']) && (quiet || warn(`The native binary files are not present. You should either build or install the native binaries\n\n.`)) || failing; diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 4ac81cfed..dbf651f47 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,33 @@ # C/C++ for Visual Studio Code Changelog +## Version 1.23.3: January 9, 2025 +### New Feature +* Enable setting multiple compile commands. [#7029](https://github.com/microsoft/vscode-cpptools/issues/7029) + * Thank you for the contribution. [@yiftahw](https://github.com/yiftahw) [PR #12960](https://github.com/microsoft/vscode-cpptools/pull/12960) + +### Enhancements +* Modifications to the snippet completions to more closely match the snippets provided by TypeScript. [#4482](https://github.com/microsoft/vscode-cpptools/issues/4482) +* Update clang path setting descriptions. [PR #13071](https://github.com/microsoft/vscode-cpptools/pull/13071) +* Update clang-format and clang-tidy from 19.1.5 to 19.1.6. +* IntelliSense parser updates. + +### Bug Fixes +* Fix `compile_commands.json` no longer being used if the containing folder is deleted and recreated. [#7030](https://github.com/microsoft/vscode-cpptools/issues/7030) + * Thank you for the contribution. [@yiftahw](https://github.com/yiftahw) [PR #13032](https://github.com/microsoft/vscode-cpptools/pull/13032) +* Fix `C_Cpp.enhancedColorization` not taking effect after it's changed. [#10565](https://github.com/microsoft/vscode-cpptools/issues/10565) +* Fix changes to `files.encoding` not triggering a database reset. [#10892](https://github.com/microsoft/vscode-cpptools/issues/10892) +* Fix parameter hints interpreting `*` in a comment as markdown. [#11082](https://github.com/microsoft/vscode-cpptools/issues/11082) +* Fix an incorrect IntelliSense error when using `std::unique_ptr`. [#11979](https://github.com/microsoft/vscode-cpptools/issues/11979) +* Fix an incorrect IntelliSense error with designated initializers. [#12239](https://github.com/microsoft/vscode-cpptools/issues/12239) +* Fix handling of `koi8ru` and `koi8t` file encodings on Windows. [#12272](https://github.com/microsoft/vscode-cpptools/issues/12272) +* Fix description of `C_Cpp.preferredPathSeparator`. [#12597](https://github.com/microsoft/vscode-cpptools/issues/12597) +* Fix the IntelliSense process launching when it's disabled and the Copilot extension is used. [#12750](https://github.com/microsoft/vscode-cpptools/issues/12750), [#13058](https://github.com/microsoft/vscode-cpptools/issues/13058) +* Fix the IntelliSense mode being `macos` instead of `windows` when `_WIN32` is defined on macOS. [#13016](https://github.com/Microsoft/vscode-cpptools/issues/13016) +* Fix IntelliSense bugs when using non-UTF8 file encodings. [#13028](https://github.com/microsoft/vscode-cpptools/issues/13028), [#13044](https://github.com/microsoft/vscode-cpptools/issues/13044) +* Fix an incorrect translation for "binary operator". [#13048](https://github.com/microsoft/vscode-cpptools/issues/13048) +* Fix the "references may be missing" logging pane being shown when the `C_Cpp.loggingLevel` is `Error` or `None`. [#13066](https://github.com/microsoft/vscode-cpptools/issues/13066) +* Fix `C_Cpp.default.compilerPath` not using the `C_Cpp.preferredPathSeparator` setting when generated from the 'Select IntelliSense Configuration' command. [#13083](https://github.com/microsoft/vscode-cpptools/issues/13083) + ### Version 1.23.2: December 5, 2024 ### Enhancements * Changes to how paths are internally canonicalized on Linux and macOS, avoiding file system access to improve performance and delay resolution of symbolic links. [#12924](https://github.com/microsoft/vscode-cpptools/issues/12924) @@ -11,6 +39,7 @@ * Update clang-format and clang-tidy from 19.1.2 to 19.1.5. ### Bug Fixes +* Fix a perf regression in hover operation by using cached lexer line states. [#3126](https://github.com/microsoft/vscode-cpptools/issues/3126) * Increase clang-format timeout from 10 seconds to 30 seconds. [#10213](https://github.com/microsoft/vscode-cpptools/issues/10213) * Fix casing of path in include completion tooltip on Windows. [#12895](https://github.com/microsoft/vscode-cpptools/issues/12895) * Fix pattern matching of sections in `.editorConfig` files. [#12933](https://github.com/microsoft/vscode-cpptools/issues/12933) diff --git a/Extension/ThirdPartyNotices.txt b/Extension/ThirdPartyNotices.txt index 3dc5f2feb..c933515dd 100644 --- a/Extension/ThirdPartyNotices.txt +++ b/Extension/ThirdPartyNotices.txt @@ -601,6 +601,32 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +--------------------------------------------------------- + +--------------------------------------------------------- + +minimatch 4.2.3 - ISC +https://github.com/isaacs/minimatch#readme + +Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors + +The ISC License + +Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + --------------------------------------------------------- --------------------------------------------------------- @@ -732,6 +758,77 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +--------------------------------------------------------- + +--------------------------------------------------------- + +@microsoft/1ds-core-js 4.3.3 - MIT +https://github.com/microsoft/ApplicationInsights-JS#readme + +copyright Microsoft 2018 +Copyright (c) Microsoft Corporation +Copyright (c) Microsoft and contributors +Copyright (c) NevWare21 Solutions LLC and contributors + +The MIT License (MIT) + +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. + +--------------------------------------------------------- + +--------------------------------------------------------- + +@microsoft/1ds-post-js 4.3.3 - MIT +https://github.com/microsoft/ApplicationInsights-JS#readme + +copyright Microsoft 2018 +copyright Microsoft 2020 +copyright Microsoft 2018-2020 +copyright Microsoft 2022 Simple +Copyright (c) Microsoft Corporation +Copyright (c) Microsoft and contributors +Copyright (c) NevWare21 Solutions LLC and contributors + +The MIT License (MIT) + +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. + --------------------------------------------------------- --------------------------------------------------------- @@ -867,6 +964,40 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +--------------------------------------------------------- + +--------------------------------------------------------- + +@microsoft/applicationinsights-web-basic 3.3.3 - MIT +https://github.com/microsoft/ApplicationInsights-JS#readme + +Copyright (c) Microsoft Corporation +Copyright (c) Microsoft and contributors +Copyright (c) NevWare21 Solutions LLC and contributors + +The MIT License (MIT) + +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. + + --------------------------------------------------------- --------------------------------------------------------- @@ -936,6 +1067,41 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +--------------------------------------------------------- + +--------------------------------------------------------- + +@nevware21/ts-utils 0.11.4 - MIT +https://github.com/nevware21/ts-utils + +Copyright (c) 2022 NevWare21 Solutions LLC +Copyright (c) 2023 NevWare21 Solutions LLC +Copyright (c) 2024 NevWare21 Solutions LLC +Copyright (c) NevWare21 Solutions LLC and contributors + +MIT License + +Copyright (c) 2022 NevWare21 Solutions LLC + +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. + + --------------------------------------------------------- --------------------------------------------------------- @@ -2434,6 +2600,8 @@ The notices below are from non-npm sources. - Guidelines Support Library (https://github.com/Microsoft/GSL) - libc++ (https://libcxx.llvm.org/index.html) - libexecinfo (https://github.com/ronchaine/libexecinfo) +- libiconv (https://www.gnu.org/software/libiconv/) +- libiconv Win32 modifications (https://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio) - libuv (https://github.com/libuv/libuv) - LLDB (https://lldb.llvm.org/) - LLVM (http://llvm.org/) @@ -3335,6 +3503,238 @@ SUCH DAMAGE. ========================================= END OF libexecinfo NOTICES AND INFORMATION +%% libiconv NOTICES AND INFORMATION BEGIN HERE +========================================= +GNU LESSER GENERAL PUBLIC LICENSE +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] +Preamble +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, 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 this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + +a) The modified work must itself be a software library. +b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. +c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. +d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. +(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + +a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) +b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. +c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. +d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. +e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + +a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. +b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS +How to Apply These Terms to Your New Libraries +If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). + +To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + +one line to give the library's name and an idea of what it does. +Copyright (C) year name of author + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library 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 +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, see +. + +========================================= +END OF libiconv NOTICES AND INFORMATION + +%% libiconv Win32 Modifications NOTICES AND INFORMATION BEGIN HERE +========================================= +GNU LESSER GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +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. + +This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. + +0. Additional Definitions. + +As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. + +“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. + +An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. + +A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. + +The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. + +The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. + +1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. + +2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: + +a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or +b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. +3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: + +a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. +b) Accompany the object code with a copy of the GNU GPL and this license document. +4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: + +a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. +b) Accompany the Combined Work with a copy of the GNU GPL and this license document. +c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. +d) Do one of the following: +0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. +1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user’s computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. +e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) +5. Combined Libraries. + +You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: + +a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. +b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. +6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions of the GNU Lesser 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 Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy’s public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. +========================================= +END OF libiconv Win32 Modifications NOTICES AND INFORMATION + %% libuv NOTICES AND INFORMATION BEGIN HERE ========================================= libuv is licensed for use as follows: diff --git a/Extension/bin/messages/cs/messages.json b/Extension/bin/messages/cs/messages.json index f66e374c6..c9e8d11f3 100644 --- a/Extension/bin/messages/cs/messages.json +++ b/Extension/bin/messages/cs/messages.json @@ -3601,5 +3601,33 @@ "pro aktuální jednotku překladu se nepovedlo vytvořit jednotku hlavičky", "aktuální jednotka překladu používá jednu nebo více funkcí, které se v tuto chvíli nedají zapsat do jednotky hlavičky", "explicit(bool) je funkcí C++20", - "musí být zadán název modulu pro mapování souboru modulu odkazující na soubor %sq" + "musí být zadán název modulu pro mapování souboru modulu odkazující na soubor %sq", + "Byla přijata hodnota indexu null, kde byl očekáván uzel v oddílu IFC %sq", + "%nd nemůže mít typ %t.", + "Kvalifikátor odkazu je v tomto režimu nestandardní.", + "příkaz for založený na rozsahu není v tomto režimu standardní", + "Auto, protože specifikátor typu je v tomto režimu nestandardní", + "soubor modulu nelze importovat %sq z důvodu poškození souboru.", + "IFC", + "Nadbytečné tokeny vložené po deklaraci člena", + "chybný obor vkládání (%r)", + "Očekávala se hodnota typu std::string_view, ale získala se %t", + "nadbytečné tokeny vložené po příkazu", + "Nadbytečné tokeny vložené po deklaraci", + "přetečení hodnoty indexu řazené kolekce členů (%d)", + ">> výstup z std::meta::__report_tokens", + ">> koncový výstup z std::meta::__report_tokens", + "není v kontextu s proměnnými parametrů", + "Řídicí sekvence s oddělovači musí mít aspoň jeden znak.", + "neukončená řídicí sekvence s oddělovači", + "Konstanta obsahuje adresu místní proměnné.", + "strukturovanou vazbu nejde deklarovat jako consteval", + "%no je v konfliktu s importovanou deklarací %nd", + "Znak nelze v zadaném typu znaku reprezentovat.", + "Poznámka se nemůže vyskytovat v kontextu předpony atributu using.", + "typ %t poznámky není literálový typ.", + "Atribut ext_vector_type se vztahuje pouze na logické hodnoty (bool), celočíselné typy (integer) nebo typy s plovoucí desetinnou čárkou (floating-point).", + "Více specifikátorů do stejného sjednocení se nepovoluje.", + "testovací zpráva", + "Aby se dalo použít --ms_c++23, musí být verze Microsoftu, která se emuluje, aspoň 1943." ] diff --git a/Extension/bin/messages/de/messages.json b/Extension/bin/messages/de/messages.json index ac1cb6f09..5c05d13cd 100644 --- a/Extension/bin/messages/de/messages.json +++ b/Extension/bin/messages/de/messages.json @@ -3601,5 +3601,33 @@ "für die aktuelle Übersetzungseinheit konnte keine Headereinheit erstellt werden", "Die aktuelle Übersetzungseinheit verwendet mindestens ein Feature, das derzeit nicht in eine Headereinheit geschrieben werden kann", "\"explicit(bool)\" ist ein C++20-Feature", - "Für die Moduldateizuordnung, die auf die Datei \"%sq\" verweist, muss ein Modulname angegeben werden." + "Für die Moduldateizuordnung, die auf die Datei \"%sq\" verweist, muss ein Modulname angegeben werden.", + "Ein Nullindexwert wurde empfangen, obwohl ein Knoten in der IFC-Partition %sq erwartet wurde.", + "%nd darf nicht den Typ \"%t\" aufweisen", + "Ein ref-Qualifizierer entspricht in diesem Modus nicht dem Standard.", + "Eine bereichsbasierte \"for-Anweisung\" entspricht in diesem Modus nicht dem Standard", + "\"auto\" als Typspezifizierer entspricht in diesem Modus nicht dem Standard.", + "Die Moduldatei konnte aufgrund einer Beschädigung der Datei nicht %sq importiert werden.", + "IFC", + "Nach der Memberdeklaration eingefügte zusätzliche Token", + "Ungültiger Einschleusungsbereich (%r)", + "Es wurde ein Wert vom Typ \"std::string_view\" erwartet, der jedoch %t wurde.", + "Zusätzliche Token, die nach der Anweisung eingefügt wurden", + "Zusätzliche Token, die nach der Deklaration eingefügt wurden", + "Tupelindexwertüberlauf (%d)", + ">> Ausgabe von std::meta::__report_tokens", + ">> Endausgabe von std::meta::__report_tokens", + "nicht in einem Kontext mit Parametervariablen", + "Eine durch Trennzeichen getrennte Escapesequenz muss mindestens ein Zeichen enthalten.", + "nicht abgeschlossene, durch Trennzeichen getrennte Escapesequenz", + "Die Konstante enthält die Adresse einer lokalen Variablen.", + "eine strukturierte Bindung kann nicht als \"consteval\" deklariert werden", + "%no steht in Konflikt mit der importierten %nd", + "Zeichen kann im angegebenen Zeichentyp nicht dargestellt werden.", + "Eine Anmerkung kann nicht im Kontext eines using-Attributpräfixes angezeigt werden.", + "Der Typ %t der Anmerkung ist kein Literaltyp.", + "Das Attribut \"ext_vector_type\" gilt nur für boolesche, ganzzahlige oder Gleitkommatypen", + "Mehrere Kennzeichner in derselben Union sind nicht zulässig.", + "Testnachricht", + "Die zu emulierende Microsoft-Version muss mindestens 1943 sein, damit \"--ms_c++23\" verwendet werden kann." ] diff --git a/Extension/bin/messages/es/messages.json b/Extension/bin/messages/es/messages.json index c77eb7264..926681c81 100644 --- a/Extension/bin/messages/es/messages.json +++ b/Extension/bin/messages/es/messages.json @@ -3601,5 +3601,33 @@ "no se pudo crear una unidad de encabezado para la unidad de traducción actual", "la unidad de traducción actual usa una o varias características que no se pueden escribir actualmente en una unidad de encabezado", "'explicit(bool)' es una característica de C++20", - "se debe especificar un nombre de módulo para la asignación de archivos de módulo que hace referencia al archivo %sq" + "se debe especificar un nombre de módulo para la asignación de archivos de módulo que hace referencia al archivo %sq", + "se recibió un valor de índice nulo donde se esperaba un nodo en la partición IFC %sq", + "%nd no puede tener el tipo %t", + "un calificador ref no es estándar en este modo", + "una instrucción \"for\" basada en intervalos no es estándar en este modo", + "'auto' como especificador de tipo no es estándar en este modo", + "no se pudo importar el %sq de archivo de módulo debido a que el archivo está dañado", + "IFC", + "tokens extraños insertados después de la declaración de miembro", + "ámbito de inserción incorrecto (%r)", + "se esperaba un valor de tipo std::string_view pero se obtuvo %t", + "tokens extraños insertados después de la instrucción", + "tokens extraños insertados después de la declaración", + "desbordamiento del valor de índice de tupla (%d)", + ">> salida de std::meta::__report_tokens", + ">> salida final de std::meta::__report_tokens", + "no está en un contexto con variables de parámetro", + "una secuencia de escape delimitada debe tener al menos un carácter", + "secuencia de escape delimitada sin terminar", + "la constante contiene la dirección de una variable local", + "un enlace estructurado no se puede declarar como \"consteval\"", + "%no entra en conflicto con la declaración importada %nd", + "el carácter no se puede representar en el tipo de carácter especificado", + "una anotación no puede aparecer en el contexto de un prefijo de atributo 'using'", + "el tipo %t de la anotación no es un tipo literal", + "el atributo \"ext_vector_type\" solo se aplica a tipos booleanos, enteros o de punto flotante", + "no se permiten varios designadores en la misma unión", + "mensaje de prueba", + "la versión de Microsoft que se emula debe ser al menos 1943 para usar \"--ms_c++23\"" ] diff --git a/Extension/bin/messages/fr/messages.json b/Extension/bin/messages/fr/messages.json index 62b13147e..6d2f9b052 100644 --- a/Extension/bin/messages/fr/messages.json +++ b/Extension/bin/messages/fr/messages.json @@ -3601,5 +3601,33 @@ "impossible de créer une unité d’en-tête pour l’unité de traduction actuelle", "l’unité de traduction actuelle utilise une ou plusieurs fonctionnalités qui ne peuvent actuellement pas être écrites dans une unité d’en-tête", "'explicit(bool)' est une fonctionnalité C++20", - "un nom de module doit être spécifié pour la carte de fichiers de module référençant le fichier %sq" + "un nom de module doit être spécifié pour la carte de fichiers de module référençant le fichier %sq", + "une valeur d’index null a été reçue alors qu’un nœud de la partition IFC %sq était attendu", + "%nd ne peut pas avoir le type %t", + "qualificateur ref non standard dans ce mode", + "une instruction 'for' basée sur une plage n’est pas standard dans ce mode", + "'auto' en tant que spécificateur de type n’est pas standard dans ce mode", + "impossible d’importer le fichier de module %sq en raison d’un fichier endommagé", + "IFC", + "jetons superflus injectés après la déclaration de membre", + "étendue d’injection incorrecte (%r)", + "valeur de type std ::string_view attendue, mais %t obtenu", + "jetons superflus injectés après l’instruction", + "jetons superflus injectés après la déclaration", + "dépassement de capacité de la valeur d’index de tuple (%d)", + ">> sortie de std::meta::__report_tokens", + ">> sortie de fin de std::meta::__report_tokens", + "pas dans un contexte avec des variables de paramètre", + "une séquence d’échappement délimitée doit comporter au moins un caractère", + "séquence d’échappement délimitée non inachevée", + "constante contient l’adresse d’une variable locale", + "une liaison structurée ne peut pas être déclarée 'consteval'", + "%no est en conflit avec la déclaration importée %nd", + "caractère ne peut pas être représenté dans le type de caractère spécifié", + "une annotation ne peut pas apparaître dans le contexte d’un préfixe d’attribut 'using'", + "le type %t de l’annotation n’est pas un type littéral", + "l'attribut 'ext_vector_type' s'applique uniquement aux types booléens, entiers ou à virgule flottante", + "plusieurs désignateurs dans la même union ne sont pas autorisés", + "message de test", + "la version émulée Microsoft doit être au moins la version 1943 pour permettre l'utilisation de « --ms_c++23 »" ] diff --git a/Extension/bin/messages/it/messages.json b/Extension/bin/messages/it/messages.json index a5363ac34..4920fe2bb 100644 --- a/Extension/bin/messages/it/messages.json +++ b/Extension/bin/messages/it/messages.json @@ -3601,5 +3601,33 @@ "Non è possibile creare un'unità di intestazione per l'unità di conversione corrente", "l'unità di conversione corrente utilizza una o più funzionalità che attualmente non possono essere scritte in un'unità di intestazione", "'explicit(bool)' è una funzionalità di C++20", - "è necessario specificare un nome modulo per la mappa dei file del modulo che fa riferimento al file %sq" + "è necessario specificare un nome modulo per la mappa dei file del modulo che fa riferimento al file %sq", + "è stato ricevuto un valore di indice Null in cui era previsto un nodo nella partizione IFC %sq", + "%nd non può avere il tipo %t", + "qualificatore di riferimento non conforme allo standard in questa modalità", + "un'istruzione 'for' basata su intervallo non è standard in questa modalità", + "'auto' come identificatore di tipo non è conforme allo standard in questa modalità", + "non è stato possibile importare il file del modulo %sq a causa di un danneggiamento del file", + "IFC", + "token estranei inseriti dopo la dichiarazione del membro", + "ambito di inserimento non valido (%r)", + "previsto un valore di tipo std::string_view ma ottenuto %t", + "token estranei inseriti dopo l'istruzione", + "token estranei inseriti dopo la dichiarazione", + "overflow del valore dell'indice di tupla (%d)", + ">> output di std::meta::__report_tokens", + ">> output finale di std::meta::__report_tokens", + "non in un contesto con variabili di parametro", + "una sequenza di escape delimitata deve contenere almeno un carattere", + "sequenza di escape delimitata senza terminazione", + "la costante contiene l'indirizzo di una variabile locale", + "un'associazione strutturata non può essere dichiarata 'consteval'", + "%no è in conflitto con la dichiarazione importata %nd", + "impossibile rappresentare il carattere nel tipo di carattere specificato", + "un'annotazione non può essere presente nel contesto di un prefisso di attributo 'using'", + "il tipo %t dell'annotazione non è un tipo letterale", + "l'attributo 'ext_vector_type' si applica solo ai tipi bool, integer o a virgola mobile", + "non sono consentiti più indicatori nella stessa unione", + "messaggio di test", + "la versione di Microsoft da emulare deve essere almeno 1943 per usare '--ms_c++23'" ] diff --git a/Extension/bin/messages/ja/messages.json b/Extension/bin/messages/ja/messages.json index ed0f35076..076f95c69 100644 --- a/Extension/bin/messages/ja/messages.json +++ b/Extension/bin/messages/ja/messages.json @@ -3601,5 +3601,33 @@ "現在の翻訳単位のヘッダー ユニットを作成できませんでした", "現在の翻訳単位は、現在ヘッダー ユニットに書き込むことができない 1 つ以上の機能を使用します", "'explicit(bool)' は C++20 機能です", - "ファイル %sq を参照するモジュール ファイル マップにモジュール名を指定する必要があります" + "ファイル %sq を参照するモジュール ファイル マップにモジュール名を指定する必要があります", + "IFC パーティション %sq のノードが必要な場所で null インデックス値を受け取りました", + "%nd に型 %t を指定することはできません", + "ref 修飾子はこのモードでは非標準です", + "範囲ベースの 'for' ステートメントは、このモードでは標準ではありません", + "型指定子としての 'auto' は、このモードでは非標準です", + "ファイルが破損しているため、モジュール ファイル %sq をインポートできませんでした", + "IFC", + "メンバー宣言の後に無関係なトークンが挿入されました", + "不適切な挿入スコープ (%r)", + "std::string_view 型の値が必要ですが、%t されました", + "ステートメントの後に挿入された無関係なトークン", + "宣言の後に挿入された無関係なトークン", + "タプル インデックス値 (%d) オーバーフロー", + ">> std::meta::__report_tokens からの出力", + ">> std::meta::__report_tokens からの出力を終了", + "パラメーター変数を持つコンテキスト内にありません", + "区切られたエスケープ シーケンスには少なくとも 1 文字が必要です", + "区切られたエスケープ シーケンスが終了しません", + "定数にローカル変数のアドレスが含まれています", + "構造化バインディングを 'consteval' と宣言することはできません", + "%no がインポートされた宣言 %nd と競合しています", + "指定された文字の種類では文字を表すことができません", + "注釈を 'using' 属性プレフィックスのコンテキストに含めることはできません", + "注釈の型 %t はリテラル型ではありません", + "'ext_vector_type' 属性は、整数型または浮動小数点型にのみ適用できます", + "複数の指定子を同じ共用体にすることはできません", + "テスト メッセージ", + "'--ms_c++23' を使用するには、エミュレートされている Microsoft のバージョンが 1943 以上である必要があります" ] diff --git a/Extension/bin/messages/ko/messages.json b/Extension/bin/messages/ko/messages.json index 594a08532..5f8895cb1 100644 --- a/Extension/bin/messages/ko/messages.json +++ b/Extension/bin/messages/ko/messages.json @@ -3601,5 +3601,33 @@ "현재 변환 단위에 대한 헤더 단위를 만들 수 없습니다.", "현재 변환 단위는 헤더 단위에 현재 쓸 수 없는 하나 이상의 기능을 사용합니다.", "'explicit(bool)'는 C++20 기능입니다.", - "%sq 파일을 참조하는 모듈 파일 맵에 대한 모듈 이름을 지정해야 합니다." + "%sq 파일을 참조하는 모듈 파일 맵에 대한 모듈 이름을 지정해야 합니다.", + "IFC 파티션 %sq 노드가 필요한 곳에 null 인덱스 값을 받았습니다.", + "%nd은(는) %t 형식을 가질 수 없습니다", + "ref-qualifier는 이 모드에서 표준이 아니므로", + "범위 기반 'for' 문은 이 모드에서 표준이 아닙니다", + "형식 지정자의 'auto'는 이 모드에서 표준이 아닙니다.", + "파일이 손상되었기 때문에 모듈 파일 %sq 가져올 수 없습니다.", + "IFC", + "멤버 선언 뒤에 삽입된 불필요한 토큰", + "잘못된 주입 scope(%r)", + "std::string_view 형식의 값이 필요한데 %t", + "문 뒤에 불필요한 토큰이 삽입되었습니다.", + "선언 후에 삽입된 불필요한 토큰", + "튜플 인덱스 값(%d) 오버플로", + ">> std::meta::__report_tokens의 출력", + ">> std::meta::__report_tokens의 출력 종료", + "매개 변수 변수가 있는 컨텍스트에 없음", + "구분된 이스케이프 시퀀스에는 문자가 하나 이상 있어야 합니다.", + "종결되지 않은 구분된 이스케이프 시퀀스", + "상수에 지역 변수의 주소가 포함되어 있습니다.", + "구조적 바인딩에서는 'consteval'을 선언할 수 없습니다", + "%no 가져온 선언 %nd 충돌합니다.", + "지정한 문자 형식으로 문자를 나타낼 수 없습니다.", + "주석은 'using' 특성 접두사 컨텍스트에 나타날 수 없습니다.", + "주석의 형식 %t 리터럴 형식이 아닙니다.", + "'ext_vector_type' 특성은 부울, 정수 또는 부동 소수점 형식에만 적용됩니다", + "동일한 공용 구조체에 여러 지정자를 사용할 수 없습니다.", + "테스트 메시지", + "에뮬레이트되는 Microsoft 버전이 1943 이상이어야 '--ms_c++23'을 사용할 수 있습니다." ] diff --git a/Extension/bin/messages/pl/messages.json b/Extension/bin/messages/pl/messages.json index 9f88ee2bd..c5e42b82b 100644 --- a/Extension/bin/messages/pl/messages.json +++ b/Extension/bin/messages/pl/messages.json @@ -3601,5 +3601,33 @@ "nie można utworzyć jednostki nagłówka dla bieżącej jednostki translacji", "bieżąca jednostka translacji używa co najmniej jednej funkcji, których obecnie nie można zapisać w jednostce nagłówka", "„explicit(bool)” jest funkcją języka C++20", - "nazwa modułu musi być określona dla mapy pliku modułu odwołującej się do pliku %sq" + "nazwa modułu musi być określona dla mapy pliku modułu odwołującej się do pliku %sq", + "odebrano wartość indeksu o wartości null, w której oczekiwano węzła w partycji IFC %sq", + "%nd nie może mieć typu %t", + "kwalifikator ref jest niestandardowy w tym trybie", + "instrukcja \"for\" oparta na zakresie jest niestandardowa w tym trybie", + "element \"auto\" jako specyfikator typu jest niestandardowy w tym trybie", + "nie można zaimportować %sq pliku modułu z powodu uszkodzenia pliku", + "IFC", + "nadmiarowe tokeny wstrzyknięte po deklaracji składowej", + "zły zakres iniekcji (%r)", + "oczekiwano wartości typu std::string_view, ale otrzymano %t", + "nadmiarowe tokeny wstrzyknięte po instrukcji", + "nadmiarowe tokeny wstrzyknięte po deklaracji", + "przepełnienie wartości indeksu krotki (%d)", + ">> dane wyjściowe z elementu std::meta::__report_tokens", + ">> końcowe dane wyjściowe z elementu std::meta::__report_tokens", + "nie jest w kontekście ze zmiennymi parametrów", + "rozdzielana sekwencja ucieczki musi zawierać co najmniej jeden znak", + "niezakończona rozdzielana sekwencja ucieczki", + "stała zawiera adres zmiennej lokalnej", + "powiązanie ze strukturą nie może być deklarowane jako „constexpr”", + "%no powoduje konflikt z zaimportowanym %nd deklaracji", + "znak nie może być reprezentowany w określonym typie znaku", + "adnotacja nie może występować w kontekście prefiksu atrybutu \"using\"", + "typ %t adnotacji nie jest typem literału", + "atrybut „ext_vector_type” ma zastosowanie tylko do typów będących wartością logiczną, liczbą całkowitą lub liczbą zmiennoprzecinkową", + "wielokrotne desygnatory znajdujące się w tej samej unii są niedozwolone", + "wiadomość testowa", + "emulowaną wersją Microsoft musi być co najmniej 1943, aby użyć polecenia „--ms_c++23”" ] diff --git a/Extension/bin/messages/pt-br/messages.json b/Extension/bin/messages/pt-br/messages.json index 2f1a4447f..bfc788f38 100644 --- a/Extension/bin/messages/pt-br/messages.json +++ b/Extension/bin/messages/pt-br/messages.json @@ -3601,5 +3601,33 @@ "não foi possível criar uma unidade de cabeçalho para a unidade de tradução atual", "a unidade de tradução atual usa um ou mais recursos que não podem ser gravados atualmente em uma unidade de cabeçalho", "'explicit(bool)' é um recurso do C++20", - "um nome de módulo deve ser especificado para o mapa do arquivo de módulo que faz referência ao arquivo %sq" + "um nome de módulo deve ser especificado para o mapa do arquivo de módulo que faz referência ao arquivo %sq", + "um valor de índice nulo foi recebido onde um nó na partição IFC %sq esperado", + "%nd não pode ter o tipo %t", + "um qualificador ref não é padrão neste modo", + "uma instrução 'for' baseada em intervalo não é padrão nesse modo", + "'auto' como um especificador de tipo não é padrão neste modo", + "não foi possível importar o arquivo de %sq devido à corrupção do arquivo", + "IFC", + "tokens incorretos injetados após declaração de membro", + "escopo de injeção incorreto (%r)", + "esperava-se um valor do tipo std::string_view mas foi %t", + "tokens incorretos injetados após a instrução", + "tokens incorretos injetados após a declaração", + "estouro de valor de índice de tupla (%d)", + ">> saída de std::meta::__report_tokens", + ">> fim da saída de std::meta::__report_tokens", + "não está em um contexto com variáveis de parâmetro", + "uma sequência de escape delimitada deve ter pelo menos um caractere", + "sequência de escape delimitada não finalizada", + "constante contém o endereço de uma variável local", + "uma associação estruturada não pode ser declarada 'consteval'", + "%no conflito com a declaração importada %nd", + "caractere não pode ser representado no tipo de caractere especificado", + "uma anotação não pode aparecer no contexto de um prefixo de atributo 'using'", + "tipo %t da anotação não é um tipo literal", + "o atributo 'ext_vector_type' se aplica somente a booleano, inteiro ou ponto flutuante", + "vários designadores na mesma união não são permitidos", + "mensagem de teste", + "a versão da Microsoft que está sendo emulada deve ser pelo menos 1943 para usar '--ms_c++23'" ] diff --git a/Extension/bin/messages/ru/messages.json b/Extension/bin/messages/ru/messages.json index 263a85452..d6ad8182f 100644 --- a/Extension/bin/messages/ru/messages.json +++ b/Extension/bin/messages/ru/messages.json @@ -3601,5 +3601,33 @@ "не удалось создать единицу заголовка для текущей единицы трансляции", "текущая единица трансляции использует одну или несколько функций, которые в данный момент невозможно записать в единицу заголовка", "\"explicit(bool)\" — это функция C++20", - "необходимо указать имя модуля для сопоставления файла модуля, ссылающегося на файл %sq" + "необходимо указать имя модуля для сопоставления файла модуля, ссылающегося на файл %sq", + "было получено значение NULL индекса, в котором ожидался узел в секции IFC%sq", + "%nd не может иметь тип %t", + "квалификатор ref не является нестандартным в этом режиме", + "утверждение \"for\" на основе диапазона является нестандартным в этом режиме", + "\"auto\" в качестве опечатщика типа является нестандартным в этом режиме", + "не удалось импортировать файл %sq из-за повреждения файла", + "IFC", + "лишние токены, внедренные после объявления члена", + "неправильное область (%r)", + "требуется значение типа std::string_view, но %t", + "лишние токены, внедренные после оператора", + "лишние токены, внедренные после объявления", + "переполнение значения индекса кортежа (%d)", + ">> выходных данных из std::meta::__report_tokens", + ">> конец выходных данных из std::meta::__report_tokens", + "не в контексте с переменными параметров", + "escape-последовательность с разделителями должна содержать по крайней мере один символ", + "незавершенная escape-последовательность с разделителями", + "константа содержит адрес локальной переменной", + "структурированная привязка не может быть объявлена как \"consteval\"", + "%no конфликтует с импортируемым объявлением %nd", + "символ не может быть представлен в указанном типе символов", + "заметка не может присутствовать в контексте префикса атрибута using", + "тип %t заметки не является типом литерала", + "атрибут ext_vector_type применяется только к типам bool, integer или float point", + "использование нескольких указателей в одном объединении не допускается", + "тестовое сообщение", + "для использования \"--ms_c++23\" эмулируемая версия Майкрософт должна быть не ниже 1943" ] diff --git a/Extension/bin/messages/tr/messages.json b/Extension/bin/messages/tr/messages.json index 8fd0f7a7f..b82139ea9 100644 --- a/Extension/bin/messages/tr/messages.json +++ b/Extension/bin/messages/tr/messages.json @@ -3601,5 +3601,33 @@ "geçerli çeviri birimi için bir başlık birimi oluşturulamadı", "mevcut çeviri birimi şu anda bir başlık birimine yazılamayan bir veya daha fazla özellik kullanıyorsa", "'explicit(bool)' bir C++20 özelliğidir", - "%sq dosyasına başvuran modül dosyası eşlemesi için bir modül adı belirtilmelidir" + "%sq dosyasına başvuran modül dosyası eşlemesi için bir modül adı belirtilmelidir", + "IFC bölümündeki bir düğümün beklenen %sq null dizin değeri alındı", + "%nd, %t türüne sahip olamaz", + "ref niteleyicisi bu modda standart dışı", + "Bu modda, aralık tabanlı 'for' deyimi standart dışıdır", + "tür belirticisi olarak 'auto' bu modda standart dışı", + "dosya bozulması nedeniyle modül %sq dosyası içeri aktarılamadı", + "IFC", + "üye bildiriminden sonra eklenen gereksiz belirteçler", + "hatalı ekleme kapsamı (%r)", + "std::string_view türünde bir değer bekleniyordu ancak %t", + "deyimden sonra eklenen gereksiz belirteçler", + "bildirimden sonra eklenen gereksiz belirteçler", + "demet dizin değeri (%d) taşması", + ">> output from std::meta::__report_tokens", + ">> end output from std::meta::__report_tokens", + "parametre değişkenleri olan bir bağlamda değil", + "sınırlandırılmış bir kaçış dizisi en az bir karakter içermelidir", + "sonlandırılmamış sınırlandırılmış kaçış dizisi", + "sabit, yerel bir değişkenin adresini içerir", + "yapılandırılmış bir bağlama, 'consteval' olarak bildirilemez", + "%no içeri aktarılan bildirimle çakışıyor %nd", + "karakter belirtilen karakter türünde gösterilemez", + "ek açıklama bir 'using' öznitelik öneki bağlamında bulunamaz", + "ek %t türü bir sabit değer türü değil", + "'ext_vector_type' özniteliği yalnızca bool, tamsayı veya kayan nokta türleri için geçerlidir", + "aynı birleşimde birden çok belirleyiciye izin verilmez", + "test iletisi", + "'--ms_c++23' kullanabilmek için öykünülen Microsoft sürümü en az 1943 olmalıdır" ] diff --git a/Extension/bin/messages/zh-cn/messages.json b/Extension/bin/messages/zh-cn/messages.json index b527f4e9f..ae52d271c 100644 --- a/Extension/bin/messages/zh-cn/messages.json +++ b/Extension/bin/messages/zh-cn/messages.json @@ -3601,5 +3601,33 @@ "无法为当前翻译单元创建标头单元", "当前翻译单元使用当前无法写入标头单元的一个或多个功能", "“explicit(bool)” 是 C++20 功能", - "必须为引用文件 %sq 的模块文件映射指定模块名称" + "必须为引用文件 %sq 的模块文件映射指定模块名称", + "收到 null 索引值,但应为 IFC 分区 %sq 中的节点", + "%nd 不能具有类型 %t", + "ref 限定符在此模式下是非标准的", + "在此模式下,基于范围的 \"for\" 语句是非标准语句", + "在此模式下,“auto” 作为类型说明符是非标准的", + "由于文件损坏,无法导入模块文件 %sq", + "IFC", + "在成员声明后注入的外来令牌", + "错误的注入作用域 (%r)", + "应为 std::string_view 类型的值,但获得 %t", + "在语句后注入的外来令牌", + "声明后注入的外来标记", + "元组索引值 (%d) 溢出", + ">> 来自 std::meta::__report_tokens 的输出", + ">> 结束来自 std::meta::__report_tokens 的输出", + "不在包含参数变量的上下文中", + "分隔转义序列必须至少有一个字符", + "未终止的分隔转义序列", + "常量包含局部变量的地址", + "结构化绑定无法声明为 \"consteval\"", + "%no 与导入的声明 %nd 冲突", + "字符不能在指定的字符类型中表示", + "批注不能出现在 “using” 属性前缀的上下文中", + "批注的类型 %t 不是文本类型", + "\"ext_vector_type\" 属性仅适用于布尔值、整数或浮点类型", + "不允许将多个指示符加入同一联合", + "测试消息", + "正在模拟的 Microsoft 版本必须至少为 1943 才能使用“--ms_c++23”" ] diff --git a/Extension/bin/messages/zh-tw/messages.json b/Extension/bin/messages/zh-tw/messages.json index aefdf6b3a..20f1012bd 100644 --- a/Extension/bin/messages/zh-tw/messages.json +++ b/Extension/bin/messages/zh-tw/messages.json @@ -3601,5 +3601,33 @@ "無法為目前的編譯單位建立標頭單位", "目前的編譯單位使用一或多個目前無法寫入標頭單位的功能", "'explicit(bool)' 是 C++20 功能", - "必須為參照檔案的模組檔案對應指定模組名稱 %sq" + "必須為參照檔案的模組檔案對應指定模組名稱 %sq", + "收到 Null 索引值,其中預期 IFC 分割區 %sq 中的節點", + "%nd 不能有類型 %t", + "ref-qualifier 在此模式中不是標準的", + "範圍架構 'for' 陳述式在此模式中不是標準用法", + "在此模式中,'auto' 作為型別規範不是標準的", + "無法匯入模組檔案 %sq,因為檔案損毀", + "IFC", + "在成員宣告後插入了無關的 Token", + "錯誤的插入範圍 (%r)", + "必須是 std::string_view 類型的值,但 %t", + "語句后插入了無關的 Token", + "宣告後插入了無關的 Token", + "元組索引值 (%d) 溢位", + ">> 輸出來自 std::meta::__report_tokens", + ">> 結束輸出自 std::meta::__report_tokens", + "不在具有參數變數的內容中", + "分隔的逸出序列必須至少有一個字元", + "未結束分隔的逸出序列", + "常數包含局部變數的位址", + "無法將結構化繫結宣告為 'consteval'", + "%no 與匯入的宣告 %nd 衝突", + "字元不能以指定的字元類型表示", + "註釋不能出現在 『using』 屬性前綴的內容中", + "批注的類型 %t 不是常值類型", + "'ext_vector_type' 屬性只適用於布林值、整數或浮點數類型", + "不允許多個指示者進入相同的聯集", + "測試訊息", + "模擬的 Microsoft 版本至少須為 1943,才能使用 '--ms_c++23'" ] diff --git a/Extension/bin/windows.msvc.arm.json b/Extension/bin/windows.msvc.arm.json index 2012577e0..7bf4b102b 100644 --- a/Extension/bin/windows.msvc.arm.json +++ b/Extension/bin/windows.msvc.arm.json @@ -4,11 +4,11 @@ "--microsoft", "--microsoft_bugs", "--microsoft_version", - "1941", + "1943", "--pack_alignment", "8", - "-D_MSC_VER=1941", - "-D_MSC_FULL_VER=194134120", + "-D_MSC_VER=1943", + "-D_MSC_FULL_VER=194334604", "-D_MSC_BUILD=0", "-D_M_ARM=7" ], diff --git a/Extension/bin/windows.msvc.arm64.json b/Extension/bin/windows.msvc.arm64.json index 1758319b5..a61ed0c00 100644 --- a/Extension/bin/windows.msvc.arm64.json +++ b/Extension/bin/windows.msvc.arm64.json @@ -4,12 +4,12 @@ "--microsoft", "--microsoft_bugs", "--microsoft_version", - "1941", + "1943", "--pack_alignment", "8", "-D_CPPUNWIND=1", - "-D_MSC_VER=1941", - "-D_MSC_FULL_VER=194134120", + "-D_MSC_VER=1943", + "-D_MSC_FULL_VER=194334604", "-D_MSC_BUILD=0", "-D_M_ARM64=1" ], diff --git a/Extension/bin/windows.msvc.x64.json b/Extension/bin/windows.msvc.x64.json index 580f51924..52aaa3a0e 100644 --- a/Extension/bin/windows.msvc.x64.json +++ b/Extension/bin/windows.msvc.x64.json @@ -4,12 +4,12 @@ "--microsoft", "--microsoft_bugs", "--microsoft_version", - "1941", + "1943", "--pack_alignment", "8", "-D_CPPUNWIND=1", - "-D_MSC_VER=1941", - "-D_MSC_FULL_VER=194134120", + "-D_MSC_VER=1943", + "-D_MSC_FULL_VER=194334604", "-D_MSC_BUILD=0", "-D_M_X64=100", "-D_M_AMD64=100" diff --git a/Extension/bin/windows.msvc.x86.json b/Extension/bin/windows.msvc.x86.json index d8fbe6325..36d6a55aa 100644 --- a/Extension/bin/windows.msvc.x86.json +++ b/Extension/bin/windows.msvc.x86.json @@ -4,11 +4,11 @@ "--microsoft", "--microsoft_bugs", "--microsoft_version", - "1941", + "1943", "--pack_alignment", "8", - "-D_MSC_VER=1941", - "-D_MSC_FULL_VER=194134120", + "-D_MSC_VER=1943", + "-D_MSC_FULL_VER=194334604", "-D_MSC_BUILD=0", "-D_M_IX86=600", "-D_M_IX86_FP=2" diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index a07d242f0..cd7e174d9 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -70,9 +70,20 @@ ] }, "compileCommands": { - "markdownDescription": "Full path to `compile_commands.json` file for the workspace.", - "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + ], + "markdownDescription": "Full path or a list of full paths to `compile_commands.json` files for the workspace.", + "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." }, "includePath": { "markdownDescription": "A list of paths for the IntelliSense engine to use while searching for included headers. Searching on these paths is not recursive. Specify `**` to indicate recursive search. For example, `${workspaceFolder}/**` will search through all subdirectories while `${workspaceFolder}` will not. Usually, this should not include system includes; instead, set `C_Cpp.default.compilerPath`.", @@ -239,7 +250,6 @@ }, "enableConfigurationSquiggles": { "type": "boolean", - "default": true, "markdownDescription": "Controls whether the extension will report errors detected in `c_cpp_properties.json`.", "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." } diff --git a/Extension/i18n/chs/package.i18n.json b/Extension/i18n/chs/package.i18n.json index c1c7f42e8..48b573e65 100644 --- a/Extension/i18n/chs/package.i18n.json +++ b/Extension/i18n/chs/package.i18n.json @@ -160,7 +160,7 @@ "c_cpp.configuration.vcFormat.space.removeBeforeSemicolon.description": "将移除每个分号前的空格。", "c_cpp.configuration.vcFormat.space.insertAfterSemicolon.description": "在每个分号后面插入一个空格。", "c_cpp.configuration.vcFormat.space.removeAroundUnaryOperator.description": "移除一元运算符和操作数之间的空格。", - "c_cpp.configuration.vcFormat.space.aroundBinaryOperator.description": "二进制运算符周围的空格。", + "c_cpp.configuration.vcFormat.space.aroundBinaryOperator.description": "二元运算符周围的空格。", "c_cpp.configuration.vcFormat.space.aroundAssignmentOperator.description": "赋值运算符周围的空格。", "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.description": "指针和引用运算符周围的空格。", "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.left.description": "指针和引用运算符左对齐。", @@ -449,4 +449,4 @@ "c_cpp.configuration.refactoring.includeHeader.never.description": "从不包含头文件。", "c_cpp.languageModelTools.configuration.displayName": "C/C++ 配置", "c_cpp.languageModelTools.configuration.userDescription": "活动 C 或 C++ 文件的配置,例如语言标准版本和目标平台。" -} \ No newline at end of file +} diff --git a/Extension/package.json b/Extension/package.json index f1f96ac3e..03facfe22 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2,7 +2,7 @@ "name": "cpptools", "displayName": "C/C++", "description": "C/C++ IntelliSense, debugging, and code browsing.", - "version": "1.23.2-main", + "version": "1.23.3-main", "publisher": "ms-vscode", "icon": "LanguageCCPP_color_128x.png", "readme": "README.md", @@ -693,7 +693,23 @@ "scope": "machine-overridable" }, "C_Cpp.default.compileCommands": { - "type": "string", + "oneOf": [ + { + "type": "string", + "default": "" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + ], + "default": [ + "" + ], "markdownDescription": "%c_cpp.configuration.default.compileCommands.markdownDescription%", "scope": "machine-overridable" }, @@ -3313,6 +3329,16 @@ "default": false, "markdownDescription": "%c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription%", "scope": "application" + }, + "C_Cpp.copilotHover": { + "type": "string", + "enum": [ + "default", + "disabled" + ], + "default": "default", + "markdownDescription": "%c_cpp.configuration.copilotHover.markdownDescription%", + "scope": "window" } } } diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 7f784f7c9..67a3bcb3d 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -173,7 +173,7 @@ ] }, "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { - "message": "The full path of the `clang-tidy` executable. If not specified, and `clang-tidy` is available in the environment path, that is used. If not found in the environment path, the `clang-tidy` bundled with the extension will be used.", + "message": "The full path of the `clang-tidy` executable. If not specified, and `clang-tidy` is available in the environment path, that is used unless the version bundled with the extension is newer. If not found in the environment path, the `clang-tidy` bundled with the extension will be used.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] @@ -410,7 +410,12 @@ "c_cpp.configuration.vcFormat.space.removeBeforeSemicolon.description": "Spaces are removed before every semicolon.", "c_cpp.configuration.vcFormat.space.insertAfterSemicolon.description": "A space is inserted after every semicolon.", "c_cpp.configuration.vcFormat.space.removeAroundUnaryOperator.description": "Spaces between unary operators and operands are removed.", - "c_cpp.configuration.vcFormat.space.aroundBinaryOperator.description": "Spaces around binary operators.", + "c_cpp.configuration.vcFormat.space.aroundBinaryOperator.description": { + "message": "Spaces around binary operators.", + "comment": [ + "The term \"binary operators\" refers to operators that takes two operands and not operators on binary numbers." + ] + }, "c_cpp.configuration.vcFormat.space.aroundAssignmentOperator.description": "Spaces around assignment operators.", "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.description": "Spaces around pointer and reference operators.", "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.left.description": "Pointer and reference operators are aligned to the left.", @@ -441,7 +446,7 @@ ] }, "c_cpp.configuration.clang_format_path.markdownDescription": { - "message": "The full path of the `clang-format` executable. If not specified, and `clang-format` is available in the environment path, that is used. If not found in the environment path, the `clang-format` bundled with the extension will be used.", + "message": "The full path of the `clang-format` executable. If not specified, and `clang-format` is available in the environment path, that is used unless the version bundled with the extension is newer. If not found in the environment path, the `clang-format` bundled with the extension will be used.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] @@ -561,7 +566,7 @@ "c_cpp.configuration.exclusionPolicy.checkFolders.description": "The exclusion filters will only be evaluated once per folder (individual files are not checked).", "c_cpp.configuration.exclusionPolicy.checkFilesAndFolders.description": "The exclusion filters will be evaluated against every file and folder encountered.", "c_cpp.configuration.preferredPathSeparator.markdownDescription": { - "message": "The character used as a path separator for `#include` auto-completion results.", + "message": "The character used as a path separator for generated user paths.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] @@ -768,6 +773,12 @@ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, + "c_cpp.configuration.copilotHover.markdownDescription": { + "message": "If `disabled`, no Copilot information will appear in Hover.", + "comment": [ + "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." + ] + }, "c_cpp.configuration.renameRequiresIdentifier.markdownDescription": { "message": "If `true`, 'Rename Symbol' will require a valid C/C++ identifier.", "comment": [ @@ -987,8 +998,18 @@ "c_cpp.walkthrough.create.cpp.file.title": "Create a C++ file", "c_cpp.walkthrough.create.cpp.file.description": "[Open](command:toSide:workbench.action.files.openFile) or [create](command:toSide:workbench.action.files.newUntitledFile?%7B%22languageId%22%3A%22cpp%22%7D) a C++ file. Be sure to save it with the \".cpp\" extension, such as \"helloworld.cpp\". \n[Create a C++ File](command:toSide:workbench.action.files.newUntitledFile?%7B%22languageId%22%3A%22cpp%22%7D)", "c_cpp.walkthrough.create.cpp.file.altText": "Open a C++ file or a folder with a C++ project.", - "c_cpp.walkthrough.command.prompt.title": "Launch from the developer command prompt", - "c_cpp.walkthrough.command.prompt.description": "When using the Microsoft Visual Studio C++ compiler, the C++ extension requires you to launch VS Code from the developer command prompt. Follow the instructions on the right to relaunch.\n[Reload Window](command:workbench.action.reloadWindow)", + "c_cpp.walkthrough.command.prompt.title": { + "message": "Launch from the Developer Command Prompt for VS", + "comment": [ + "Don't translate the product name \"Developer Command Prompt for VS\"." + ] + }, + "c_cpp.walkthrough.command.prompt.description": { + "message": "When using the Microsoft Visual Studio C++ compiler, the C++ extension requires you to launch VS Code from the Developer Command Prompt for VS. Follow the instructions on the right to relaunch.\n[Reload Window](command:workbench.action.reloadWindow)", + "comment": [ + "Don't translate the product name \"Developer Command Prompt for VS\"." + ] + }, "c_cpp.walkthrough.run.debug.title": "Run and debug your C++ file", "c_cpp.walkthrough.run.debug.mac.description": "Open your C++ file and click on the play button in the top right corner of the editor, or press F5 when on the file. Select \"clang++ - Build and debug active file\" to run with the debugger.", "c_cpp.walkthrough.run.debug.linux.description": "Open your C++ file and click on the play button in the top right corner of the editor, or press F5 when on the file. Select \"g++ - Build and debug active file\" to run with the debugger.", diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index 067983fea..f4f874501 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -584,7 +584,10 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv private showErrorIfClNotAvailable(_configurationLabel: string): boolean { if (!process.env.DevEnvDir || process.env.DevEnvDir.length === 0) { - void vscode.window.showErrorMessage(localize("cl.exe.not.available", "{0} build and debug is only usable when VS Code is run from the Developer Command Prompt for VS.", "cl.exe")); + void vscode.window.showErrorMessage(localize({ + key: "cl.exe.not.available", + comment: ["{0} is a command option in a menu. {1} is the product name \"Developer Command Prompt for VS\"."] + }, "{0} is only usable when VS Code is run from the {1}.", `cl.exe ${this.buildAndDebugActiveFileStr()}`, "Developer Command Prompt for VS")); return true; } return false; diff --git a/Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts b/Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts new file mode 100644 index 000000000..a6d052895 --- /dev/null +++ b/Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts @@ -0,0 +1,149 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All Rights Reserved. + * See 'LICENSE' in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +import * as vscode from 'vscode'; +import { Position, ResponseError } from 'vscode-languageclient'; +import * as nls from 'vscode-nls'; +import { DefaultClient, GetCopilotHoverInfoParams, GetCopilotHoverInfoRequest } from '../client'; +import { RequestCancelled, ServerCancelled } from '../protocolFilter'; +import { CppSettings } from '../settings'; + +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + +export class CopilotHoverProvider implements vscode.HoverProvider { + private client: DefaultClient; + private currentDocument: vscode.TextDocument | undefined; + private currentPosition: vscode.Position | undefined; + private currentCancellationToken: vscode.CancellationToken | undefined; + private waiting: boolean = false; + private ready: boolean = false; + private cancelled: boolean = false; + private cancelledDocument: vscode.TextDocument | undefined; + private cancelledPosition: vscode.Position | undefined; + private content: string | undefined; + constructor(client: DefaultClient) { + this.client = client; + } + + public async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise { + await this.client.ready; + + const settings: CppSettings = new CppSettings(vscode.workspace.getWorkspaceFolder(document.uri)?.uri); + if (settings.hover === "disabled") { + return undefined; + } + + const newHover = this.isNewHover(document, position); + if (newHover) { + this.reset(); + } + + // Wait for the main hover provider to finish and confirm it has content. + const hoverProvider = this.client.getHoverProvider(); + if (!await hoverProvider?.contentReady) { + return undefined; + } + + if (token.isCancellationRequested) { + throw new vscode.CancellationError(); + } + this.currentCancellationToken = token; + + if (!newHover) { + if (this.ready) { + const contentMarkdown = new vscode.MarkdownString(`$(sparkle) Copilot\n\n${this.content}`, true); + return new vscode.Hover(contentMarkdown); + } + if (this.waiting) { + const loadingMarkdown = new vscode.MarkdownString("$(sparkle) $(loading~spin)", true); + return new vscode.Hover(loadingMarkdown); + } + } + + this.currentDocument = document; + this.currentPosition = position; + const commandString = "$(sparkle) [" + localize("generate.copilot.description", "Generate Copilot summary") + "](command:C_Cpp.ShowCopilotHover \"" + localize("copilot.disclaimer", "AI-generated content may be incorrect.") + "\")"; + const commandMarkdown = new vscode.MarkdownString(commandString); + commandMarkdown.supportThemeIcons = true; + commandMarkdown.isTrusted = { enabledCommands: ["C_Cpp.ShowCopilotHover"] }; + return new vscode.Hover(commandMarkdown); + } + + public showWaiting(): void { + this.waiting = true; + } + + public showContent(content: string): void { + this.ready = true; + this.content = content; + } + + public getCurrentHoverDocument(): vscode.TextDocument | undefined { + return this.currentDocument; + } + + public getCurrentHoverPosition(): vscode.Position | undefined { + return this.currentPosition; + } + + public getCurrentHoverCancellationToken(): vscode.CancellationToken | undefined { + return this.currentCancellationToken; + } + + public async getRequestInfo(document: vscode.TextDocument, position: vscode.Position): Promise { + let requestInfo = ""; + const params: GetCopilotHoverInfoParams = { + textDocument: { uri: document.uri.toString() }, + position: Position.create(position.line, position.character) + }; + + await this.client.ready; + if (this.currentCancellationToken?.isCancellationRequested) { + throw new vscode.CancellationError(); + } + + try { + const response = await this.client.languageClient.sendRequest(GetCopilotHoverInfoRequest, params, this.currentCancellationToken); + requestInfo = response.content; + } catch (e: any) { + if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) { + throw new vscode.CancellationError(); + } + throw e; + } + + return requestInfo; + } + + public isCancelled(document: vscode.TextDocument, position: vscode.Position): boolean { + if (this.cancelled && this.cancelledDocument === document && this.cancelledPosition === position) { + // Cancellation is being acknowledged. + this.cancelled = false; + this.cancelledDocument = undefined; + this.cancelledPosition = undefined; + return true; + } + return false; + } + + public reset(): void { + // If there was a previous call, cancel it. + if (this.waiting) { + this.cancelled = true; + this.cancelledDocument = this.currentDocument; + this.cancelledPosition = this.currentPosition; + } + this.waiting = false; + this.ready = false; + this.content = undefined; + this.currentDocument = undefined; + this.currentPosition = undefined; + this.currentCancellationToken = undefined; + } + + public isNewHover(document: vscode.TextDocument, position: vscode.Position): boolean { + return !(this.currentDocument === document && this.currentPosition?.line === position.line && (this.currentPosition?.character === position.character || this.currentPosition?.character === position.character - 1)); + } +} diff --git a/Extension/src/LanguageServer/Providers/HoverProvider.ts b/Extension/src/LanguageServer/Providers/HoverProvider.ts index 0a4cd6eab..4bc8bae19 100644 --- a/Extension/src/LanguageServer/Providers/HoverProvider.ts +++ b/Extension/src/LanguageServer/Providers/HoverProvider.ts @@ -4,17 +4,30 @@ * ------------------------------------------------------------------------------------------ */ import * as vscode from 'vscode'; import { Position, ResponseError, TextDocumentPositionParams } from 'vscode-languageclient'; +import { ManualSignal } from '../../Utility/Async/manualSignal'; import { DefaultClient, HoverRequest } from '../client'; import { RequestCancelled, ServerCancelled } from '../protocolFilter'; import { CppSettings } from '../settings'; export class HoverProvider implements vscode.HoverProvider { private client: DefaultClient; + private lastContent: vscode.MarkdownString[] | undefined; + private readonly hasContent = new ManualSignal(true); constructor(client: DefaultClient) { this.client = client; } public async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise { + this.hasContent.reset(); + const copilotHoverProvider = this.client.getCopilotHoverProvider(); + if (copilotHoverProvider) { + // Check if this is a reinvocation from Copilot. + if (!copilotHoverProvider.isNewHover(document, position) && this.lastContent) { + this.hasContent.resolve(this.lastContent.length > 0); + return new vscode.Hover(this.lastContent); + } + } + const settings: CppSettings = new CppSettings(vscode.workspace.getWorkspaceFolder(document.uri)?.uri); if (settings.hover === "disabled") { return undefined; @@ -52,6 +65,12 @@ export class HoverProvider implements vscode.HoverProvider { hoverResult.range.end.line, hoverResult.range.end.character); } + this.hasContent.resolve(strings.length > 0); + this.lastContent = strings; return new vscode.Hover(strings, range); } + + get contentReady(): Promise { + return this.hasContent; + } } diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index d937cff04..ac7a53bac 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -43,6 +43,7 @@ import { localizedStringCount, lookupString } from '../nativeStrings'; import { SessionState } from '../sessionState'; import * as telemetry from '../telemetry'; import { TestHook, getTestHook } from '../testHook'; +import { CopilotHoverProvider } from './Providers/CopilotHoverProvider'; import { HoverProvider } from './Providers/HoverProvider'; import { CodeAnalysisDiagnosticIdentifiersAndUri, @@ -57,7 +58,7 @@ import { DataBinding } from './dataBinding'; import { cachedEditorConfigSettings, getEditorConfigSettings } from './editorConfig'; import { CppSourceStr, clients, configPrefix, updateLanguageConfigurations, usesCrashHandler, watchForCrashes } from './extension'; import { LocalizeStringParams, getLocaleId, getLocalizedString } from './localization'; -import { PersistentFolderState, PersistentWorkspaceState } from './persistentState'; +import { PersistentFolderState, PersistentState, PersistentWorkspaceState } from './persistentState'; import { RequestCancelled, ServerCancelled, createProtocolFilter } from './protocolFilter'; import * as refs from './references'; import { CppSettings, OtherSettings, SettingsParams, WorkspaceFolderSettingsParams } from './settings'; @@ -526,6 +527,7 @@ interface DidChangeActiveEditorParams { } interface GetIncludesParams { + fileUri: string; maxDepth: number; } @@ -533,6 +535,15 @@ export interface GetIncludesResult { includedFiles: string[]; } +export interface GetCopilotHoverInfoParams { + textDocument: TextDocumentIdentifier; + position: Position; +} + +interface GetCopilotHoverInfoResult { + content: string; +} + export interface ChatContextResult { language: string; standardVersion: string; @@ -554,6 +565,16 @@ export interface ProjectContextResult { fileContext: FileContextResult; } +interface FolderFilesEncodingChanged { + uri: string; + filesEncoding: string; +} + +interface FilesEncodingChanged { + workspaceFallbackEncoding?: string; + foldersFilesEncoding: FolderFilesEncodingChanged[]; +} + // Requests const PreInitializationRequest: RequestType = new RequestType('cpptools/preinitialize'); const InitializationRequest: RequestType = new RequestType('cpptools/initialize'); @@ -567,6 +588,7 @@ export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatRange'); export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); export const HoverRequest: RequestType = new RequestType('cpptools/hover'); +export const GetCopilotHoverInfoRequest: RequestType = new RequestType('cpptools/getCopilotHoverInfo'); const CreateDeclarationOrDefinitionRequest: RequestType = new RequestType('cpptools/createDeclDef'); const ExtractToFunctionRequest: RequestType = new RequestType('cpptools/extractToFunction'); const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); @@ -631,6 +653,7 @@ const ReportCodeAnalysisTotalNotification: NotificationType = new Notifi const DoxygenCommentGeneratedNotification: NotificationType = new NotificationType('cpptools/insertDoxygenComment'); const CanceledReferencesNotification: NotificationType = new NotificationType('cpptools/canceledReferences'); const IntelliSenseResultNotification: NotificationType = new NotificationType('cpptools/intelliSenseResult'); +const FilesEncodingChangedNotification: NotificationType = new NotificationType('cpptools/filesEncodingChanged'); let failureMessageShown: boolean = false; @@ -804,9 +827,11 @@ export interface Client { getShowConfigureIntelliSenseButton(): boolean; setShowConfigureIntelliSenseButton(show: boolean): void; addTrustedCompiler(path: string): Promise; - getIncludes(maxDepth: number): Promise; + getCopilotHoverProvider(): CopilotHoverProvider | undefined; + getIncludes(uri: vscode.Uri, maxDepth: number): Promise; getChatContext(uri: vscode.Uri, token: vscode.CancellationToken): Promise; getProjectContext(uri: vscode.Uri): Promise; + filesEncodingChanged(filesEncodingChanged: FilesEncodingChanged): void; } export function createClient(workspaceFolder?: vscode.WorkspaceFolder): Client { @@ -839,11 +864,14 @@ export class DefaultClient implements Client { private settingsTracker: SettingsTracker; private loggingLevel: number = 1; private configurationProvider?: string; + private hoverProvider: HoverProvider | undefined; + private copilotHoverProvider: CopilotHoverProvider | undefined; public lastCustomBrowseConfiguration: PersistentFolderState | undefined; public lastCustomBrowseConfigurationProviderId: PersistentFolderState | undefined; public lastCustomBrowseConfigurationProviderVersion: PersistentFolderState | undefined; public currentCaseSensitiveFileSupport: PersistentWorkspaceState | undefined; + public currentCopilotHoverEnabled: PersistentWorkspaceState | undefined; private registeredProviders: PersistentFolderState | undefined; private configStateReceived: ConfigStateReceived = { compilers: false, compileCommands: false, configProviders: undefined, timeout: false }; @@ -956,7 +984,8 @@ export class DefaultClient implements Client { private static readonly compileCommandsLabel: string = "compile_commands.json"; private static readonly compilersLabel: string = "compilers"; - public async showSelectIntelliSenseConfiguration(paths: string[], compilersOnly?: boolean): Promise { + public async showSelectIntelliSenseConfiguration(paths: string[], preferredPathSeparator: string, compilersOnly?: boolean): Promise { + paths = paths.map(p => p.replace(/[\\/]/g, preferredPathSeparator)); const options: vscode.QuickPickOptions = {}; options.placeHolder = compilersOnly || !vscode.workspace.workspaceFolders || !this.RootFolder ? localize("select.compiler", "Select a compiler to configure for IntelliSense") : @@ -1049,7 +1078,13 @@ export class DefaultClient implements Client { installShown = false; } paths.push(localize("noConfig.string", "Do not configure with a compiler (not recommended)")); - const index: number = await this.showSelectIntelliSenseConfiguration(paths, showCompilersOnly); + let preferredPathSeparator: string = settings.preferredPathSeparator; + if (preferredPathSeparator === "Forward Slash") { + preferredPathSeparator = "/"; + } else if (preferredPathSeparator === "Backslash") { + preferredPathSeparator = "\\"; + } + const index: number = await this.showSelectIntelliSenseConfiguration(paths, preferredPathSeparator, showCompilersOnly); let action: string = ""; let configurationSelected: boolean = false; const fromStatusBarButton: boolean = !showCompilersOnly; @@ -1100,7 +1135,9 @@ export class DefaultClient implements Client { } else { action = "select compiler"; const newCompiler: string = util.isCl(paths[index]) ? "cl.exe" : paths[index]; + settings.defaultCompilerPath = newCompiler; + settings.defaultCompilerPath = settings.defaultCompilerPath.replace(/[\\/]/g, preferredPathSeparator); await this.configuration.updateCompilerPathIfSet(newCompiler); void SessionState.trustedCompilerFound.set(true); } @@ -1273,8 +1310,16 @@ export class DefaultClient implements Client { this.registerFileWatcher(); initializedClientCount = 0; this.inlayHintsProvider = new InlayHintsProvider(); + this.hoverProvider = new HoverProvider(this); - this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, new HoverProvider(this))); + const settings: CppSettings = new CppSettings(); + this.currentCopilotHoverEnabled = new PersistentWorkspaceState("cpp.copilotHover", settings.copilotHover); + if (settings.copilotHover === "enabled" || + (settings.copilotHover === "default" && await telemetry.isFlightEnabled("CppCopilotHover"))) { + this.copilotHoverProvider = new CopilotHoverProvider(this); + this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, this.copilotHoverProvider)); + } + this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, this.hoverProvider)); this.disposables.push(vscode.languages.registerInlayHintsProvider(util.documentSelector, this.inlayHintsProvider)); this.disposables.push(vscode.languages.registerRenameProvider(util.documentSelector, new RenameProvider(this))); this.disposables.push(vscode.languages.registerReferenceProvider(util.documentSelector, new FindAllReferencesProvider(this))); @@ -1292,7 +1337,6 @@ export class DefaultClient implements Client { this.codeFoldingProvider = new FoldingRangeProvider(this); this.codeFoldingProviderDisposable = vscode.languages.registerFoldingRangeProvider(util.documentSelector, this.codeFoldingProvider); - const settings: CppSettings = new CppSettings(); if (settings.isEnhancedColorizationEnabled && semanticTokensLegend) { this.semanticTokensProvider = new SemanticTokensProvider(); this.semanticTokensProviderDisposable = vscode.languages.registerDocumentSemanticTokensProvider(util.documentSelector, this.semanticTokensProvider, semanticTokensLegend); @@ -1345,7 +1389,13 @@ export class DefaultClient implements Client { DefaultClient.isStarted.resolve(); } - private getWorkspaceFolderSettings(workspaceFolderUri: vscode.Uri | undefined, settings: CppSettings, otherSettings: OtherSettings): WorkspaceFolderSettingsParams { + private getWorkspaceFolderSettings(workspaceFolderUri: vscode.Uri | undefined, workspaceFolder: vscode.WorkspaceFolder | undefined, settings: CppSettings, otherSettings: OtherSettings): WorkspaceFolderSettingsParams { + const filesEncoding: string = otherSettings.filesEncoding; + let filesEncodingChanged: boolean = false; + if (workspaceFolder) { + const lastFilesEncoding: PersistentFolderState = new PersistentFolderState("CPP.lastFilesEncoding", filesEncoding, workspaceFolder); + filesEncodingChanged = lastFilesEncoding.Value !== filesEncoding; + } const result: WorkspaceFolderSettingsParams = { uri: workspaceFolderUri?.toString(), intelliSenseEngine: settings.intelliSenseEngine, @@ -1442,7 +1492,8 @@ export class DefaultClient implements Client { doxygenSectionTags: settings.doxygenSectionTags, filesExclude: otherSettings.filesExclude, filesAutoSaveAfterDelay: otherSettings.filesAutoSaveAfterDelay, - filesEncoding: otherSettings.filesEncoding, + filesEncoding: filesEncoding, + filesEncodingChanged: filesEncodingChanged, searchExclude: otherSettings.searchExclude, editorAutoClosingBrackets: otherSettings.editorAutoClosingBrackets, editorInlayHintsEnabled: otherSettings.editorInlayHintsEnabled, @@ -1458,10 +1509,10 @@ export class DefaultClient implements Client { const workspaceFolderSettingsParams: WorkspaceFolderSettingsParams[] = []; if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) { for (const workspaceFolder of vscode.workspace.workspaceFolders) { - workspaceFolderSettingsParams.push(this.getWorkspaceFolderSettings(workspaceFolder.uri, new CppSettings(workspaceFolder.uri), new OtherSettings(workspaceFolder.uri))); + workspaceFolderSettingsParams.push(this.getWorkspaceFolderSettings(workspaceFolder.uri, workspaceFolder, new CppSettings(workspaceFolder.uri), new OtherSettings(workspaceFolder.uri))); } } else { - workspaceFolderSettingsParams.push(this.getWorkspaceFolderSettings(this.RootUri, workspaceSettings, workspaceOtherSettings)); + workspaceFolderSettingsParams.push(this.getWorkspaceFolderSettings(this.RootUri, undefined, workspaceSettings, workspaceOtherSettings)); } return workspaceFolderSettingsParams; } @@ -1473,9 +1524,16 @@ export class DefaultClient implements Client { if (this.currentCaseSensitiveFileSupport && workspaceSettings.isCaseSensitiveFileSupportEnabled !== this.currentCaseSensitiveFileSupport.Value) { void util.promptForReloadWindowDueToSettingsChange(); } + if (this.currentCopilotHoverEnabled && workspaceSettings.copilotHover !== this.currentCopilotHoverEnabled.Value) { + void util.promptForReloadWindowDueToSettingsChange(); + } + const workspaceFallbackEncoding: string = workspaceOtherSettings.filesEncoding; + const lastWorkspaceFallbackEncoding: PersistentState = new PersistentState("CPP.lastWorkspaceFallbackEncoding", workspaceFallbackEncoding); + const workspaceFallbackEncodingChanged = lastWorkspaceFallbackEncoding.Value !== workspaceFallbackEncoding; return { filesAssociations: workspaceOtherSettings.filesAssociations, - workspaceFallbackEncoding: workspaceOtherSettings.filesEncoding, + workspaceFallbackEncoding: workspaceFallbackEncoding, + workspaceFallbackEncodingChanged: workspaceFallbackEncodingChanged, maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, maxCachedProcesses: workspaceSettings.maxCachedProcesses, maxMemory: workspaceSettings.maxMemory, @@ -1495,6 +1553,7 @@ export class DefaultClient implements Client { codeAnalysisMaxConcurrentThreads: workspaceSettings.codeAnalysisMaxConcurrentThreads, codeAnalysisMaxMemory: workspaceSettings.codeAnalysisMaxMemory, codeAnalysisUpdateDelay: workspaceSettings.codeAnalysisUpdateDelay, + copilotHover: workspaceSettings.copilotHover, workspaceFolderSettings: workspaceFolderSettingsParams }; } @@ -1605,6 +1664,12 @@ export class DefaultClient implements Client { // We manually restart the language server so tell the LanguageClient not to do it automatically for us. return { action: CloseAction.DoNotRestart, message }; } + }, + markdown: { + isTrusted: true + // TODO: support for icons in markdown is not yet in the released version of vscode-languageclient. + // Based on PR (https://github.com/microsoft/vscode-languageserver-node/pull/1504) + //supportThemeIcons: true } // TODO: should I set the output channel? Does this sort output between servers? @@ -1614,6 +1679,7 @@ export class DefaultClient implements Client { languageClient = new LanguageClient(`cpptools`, serverOptions, clientOptions); languageClient.onNotification(DebugProtocolNotification, logDebugProtocol); languageClient.onNotification(DebugLogNotification, logLocalized); + languageClient.onNotification(LogTelemetryNotification, (e) => this.logTelemetry(e)); languageClient.registerProposedFeatures(); await languageClient.start(); @@ -2236,8 +2302,8 @@ export class DefaultClient implements Client { * the UI results and always re-requests (no caching). */ - public async getIncludes(maxDepth: number): Promise { - const params: GetIncludesParams = { maxDepth: maxDepth }; + public async getIncludes(uri: vscode.Uri, maxDepth: number): Promise { + const params: GetIncludesParams = { fileUri: uri.toString(), maxDepth }; await this.ready; return this.languageClient.sendRequest(IncludesRequest, params); } @@ -2387,7 +2453,6 @@ export class DefaultClient implements Client { this.languageClient.onNotification(ReloadWindowNotification, () => void util.promptForReloadWindowDueToSettingsChange()); this.languageClient.onNotification(UpdateTrustedCompilersNotification, (e) => void this.addTrustedCompiler(e.compilerPath)); - this.languageClient.onNotification(LogTelemetryNotification, (e) => this.logTelemetry(e)); this.languageClient.onNotification(ReportStatusNotification, (e) => void this.updateStatus(e)); this.languageClient.onNotification(ReportTagParseStatusNotification, (e) => this.updateTagParseStatus(e)); this.languageClient.onNotification(CompileCommandsPathsNotification, (e) => void this.promptCompileCommands(e)); @@ -2406,6 +2471,7 @@ export class DefaultClient implements Client { this.languageClient.onNotification(ReportCodeAnalysisTotalNotification, (e) => this.updateCodeAnalysisTotal(e)); this.languageClient.onNotification(DoxygenCommentGeneratedNotification, (e) => void this.insertDoxygenComment(e)); this.languageClient.onNotification(CanceledReferencesNotification, this.serverCanceledReferences); + this.languageClient.onNotification(FilesEncodingChangedNotification, (e) => this.filesEncodingChanged(e)); } private handleIntelliSenseResult(intelliSenseResult: IntelliSenseResult): void { @@ -4045,6 +4111,28 @@ export class DefaultClient implements Client { compilerDefaults = await this.requestCompiler(path); DebugConfigurationProvider.ClearDetectedBuildTasks(); } + + public getHoverProvider(): HoverProvider | undefined { + return this.hoverProvider; + } + + public getCopilotHoverProvider(): CopilotHoverProvider | undefined { + return this.copilotHoverProvider; + } + + public filesEncodingChanged(filesEncodingChanged: FilesEncodingChanged): void { + if (filesEncodingChanged.workspaceFallbackEncoding !== undefined) { + const lastWorkspaceFallbackEncoding: PersistentState = new PersistentState("CPP.lastWorkspaceFallbackEncoding", ""); + lastWorkspaceFallbackEncoding.Value = filesEncodingChanged.workspaceFallbackEncoding; + } + for (const folderFilesEncoding of filesEncodingChanged.foldersFilesEncoding) { + const workspaceFolder: vscode.WorkspaceFolder | undefined = vscode.workspace.getWorkspaceFolder(vscode.Uri.parse(folderFilesEncoding.uri)); + if (workspaceFolder !== undefined) { + const lastFilesEncoding: PersistentFolderState = new PersistentFolderState("CPP.lastFilesEncoding", "", workspaceFolder); + lastFilesEncoding.Value = folderFilesEncoding.filesEncoding; + } + } + } } function getLanguageServerFileName(): string { @@ -4156,7 +4244,9 @@ class NullClient implements Client { getShowConfigureIntelliSenseButton(): boolean { return false; } setShowConfigureIntelliSenseButton(show: boolean): void { } addTrustedCompiler(path: string): Promise { return Promise.resolve(); } - getIncludes(maxDepth: number): Promise { return Promise.resolve({} as GetIncludesResult); } + getCopilotHoverProvider(): CopilotHoverProvider | undefined { return undefined; } + getIncludes(uri: vscode.Uri, maxDepth: number): Promise { return Promise.resolve({} as GetIncludesResult); } getChatContext(uri: vscode.Uri, token: vscode.CancellationToken): Promise { return Promise.resolve({} as ChatContextResult); } getProjectContext(uri: vscode.Uri): Promise { return Promise.resolve({} as ProjectContextResult); } + filesEncodingChanged(filesEncodingChanged: FilesEncodingChanged): void { } } diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 6f23eb347..62718852a 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -78,8 +78,8 @@ export interface Configuration { defines?: string[]; intelliSenseMode?: string; intelliSenseModeIsExplicit?: boolean; - compileCommandsInCppPropertiesJson?: string; - compileCommands?: string; + compileCommandsInCppPropertiesJson?: string[]; + compileCommands?: string[]; forcedInclude?: string[]; configurationProviderInCppPropertiesJson?: string; configurationProvider?: string; @@ -136,7 +136,7 @@ export class CppProperties { private currentConfigurationIndex: PersistentFolderState | undefined; private configFileWatcher: vscode.FileSystemWatcher | null = null; private configFileWatcherFallbackTime: Date = new Date(); // Used when file watching fails. - private compileCommandsFile: vscode.Uri | undefined | null = undefined; + private compileCommandsFiles: Set = new Set(); private compileCommandsFileWatchers: fs.FSWatcher[] = []; private compileCommandsFileWatcherFallbackTime: Map = new Map(); // Used when file watching fails. private defaultCompilerPath: string | null = null; @@ -389,7 +389,8 @@ export class CppProperties { configuration.windowsSdkVersion = this.defaultWindowsSdkVersion; } if (isUnset(settings.defaultCompilerPath) && this.defaultCompilerPath && - (isUnset(settings.defaultCompileCommands) || settings.defaultCompileCommands === "") && !configuration.compileCommands) { + (isUnset(settings.defaultCompileCommands) || settings.defaultCompileCommands?.length === 0) && + (isUnset(configuration.compileCommands) || configuration.compileCommands?.length === 0)) { // compile_commands.json already specifies a compiler. compilerPath overrides the compile_commands.json compiler so // don't set a default when compileCommands is in use. @@ -684,7 +685,7 @@ export class CppProperties { this.parsePropertiesFile(); // Clear out any modifications we may have made internally. const config: Configuration | undefined = this.CurrentConfiguration; if (config) { - config.compileCommands = path; + config.compileCommands = [path]; this.writeToJson(); } // Any time parsePropertiesFile is called, configurationJson gets @@ -938,7 +939,7 @@ export class CppProperties { configuration.macFrameworkPath = this.updateConfigurationStringArray(configuration.macFrameworkPath, settings.defaultMacFrameworkPath, env); configuration.windowsSdkVersion = this.updateConfigurationString(configuration.windowsSdkVersion, settings.defaultWindowsSdkVersion, env); configuration.forcedInclude = this.updateConfigurationPathsArray(configuration.forcedInclude, settings.defaultForcedInclude, env, false); - configuration.compileCommands = this.updateConfigurationString(configuration.compileCommands, settings.defaultCompileCommands, env); + configuration.compileCommands = this.updateConfigurationStringArray(configuration.compileCommands, settings.defaultCompileCommands, env); configuration.compilerArgs = this.updateConfigurationStringArray(configuration.compilerArgs, settings.defaultCompilerArgs, env); configuration.cStandard = this.updateConfigurationString(configuration.cStandard, settings.defaultCStandard, env); configuration.cppStandard = this.updateConfigurationString(configuration.cppStandard, settings.defaultCppStandard, env); @@ -1092,11 +1093,13 @@ export class CppProperties { } if (configuration.compileCommands) { - configuration.compileCommands = this.resolvePath(configuration.compileCommands); - if (!this.compileCommandsFileWatcherFallbackTime.has(configuration.compileCommands)) { - // Start tracking the fallback time for a new path. - this.compileCommandsFileWatcherFallbackTime.set(configuration.compileCommands, new Date()); - } + configuration.compileCommands = configuration.compileCommands.map((path: string) => this.resolvePath(path)); + configuration.compileCommands.forEach((path: string) => { + if (!this.compileCommandsFileWatcherFallbackTime.has(path)) { + // Start tracking the fallback time for a new path. + this.compileCommandsFileWatcherFallbackTime.set(path, new Date()); + } + }); } if (configuration.forcedInclude) { @@ -1120,10 +1123,12 @@ export class CppProperties { // Instead, we clear entries that are no longer relevant. const trackedCompileCommandsPaths: Set = new Set(); this.configurationJson?.configurations.forEach((config: Configuration) => { - const path = this.resolvePath(config.compileCommands); - if (path.length > 0) { - trackedCompileCommandsPaths.add(path); - } + config.compileCommands?.forEach((path: string) => { + const compileCommandsFile = this.resolvePath(path); + if (compileCommandsFile.length > 0) { + trackedCompileCommandsPaths.add(compileCommandsFile); + } + }); }); for (const path of this.compileCommandsFileWatcherFallbackTime.keys()) { @@ -1144,12 +1149,12 @@ export class CppProperties { this.compileCommandsFileWatchers = []; // reset it const filePaths: Set = new Set(); this.configurationJson.configurations.forEach(c => { - if (c.compileCommands) { - const fileSystemCompileCommandsPath: string = this.resolvePath(c.compileCommands); - if (fs.existsSync(fileSystemCompileCommandsPath)) { - filePaths.add(fileSystemCompileCommandsPath); + c.compileCommands?.forEach((path: string) => { + const compileCommandsFile: string = this.resolvePath(path); + if (fs.existsSync(compileCommandsFile)) { + filePaths.add(compileCommandsFile); } - } + }); }); try { filePaths.forEach((path: string) => { @@ -1412,6 +1417,18 @@ export class CppProperties { return; } + private forceCompileCommandsAsArray(compileCommandsInCppPropertiesJson: any): string[] | undefined { + if (util.isString(compileCommandsInCppPropertiesJson) && compileCommandsInCppPropertiesJson.length > 0) { + return [compileCommandsInCppPropertiesJson]; + } else if (util.isArrayOfString(compileCommandsInCppPropertiesJson)) { + const filteredArray: string[] = compileCommandsInCppPropertiesJson.filter(value => value.length > 0); + if (filteredArray.length > 0) { + return filteredArray; + } + } + return undefined; + } + private parsePropertiesFile(): boolean { if (!this.propertiesFile) { this.configurationJson = undefined; @@ -1441,6 +1458,13 @@ export class CppProperties { } } } + + // Configuration.compileCommands is allowed to be defined as a string in the schema, but we send an array to the language server. + // For having a predictable behavior, we convert it here to an array of strings. + for (let i: number = 0; i < newJson.configurations.length; i++) { + newJson.configurations[i].compileCommands = this.forceCompileCommandsAsArray(newJson.configurations[i].compileCommands); + } + this.configurationJson = newJson; if (this.CurrentConfigurationIndex < 0 || this.CurrentConfigurationIndex >= newJson.configurations.length) { const index: number | undefined = this.getConfigIndexForPlatform(newJson); @@ -1790,6 +1814,11 @@ export class CppProperties { const configurations: ConfigurationJson = jsonc.parse(configurationsText, undefined, true) as any; const currentConfiguration: Configuration = configurations.configurations[this.CurrentConfigurationIndex]; + // Configuration.compileCommands is allowed to be defined as a string in the schema, but we send an array to the language server. + // For having a predictable behavior, we convert it here to an array of strings. + // Squiggles are still handled for both cases. + currentConfiguration.compileCommands = this.forceCompileCommandsAsArray(currentConfiguration.compileCommands); + let curTextStartOffset: number = 0; if (!currentConfiguration.name) { return; @@ -1869,9 +1898,9 @@ export class CppProperties { curText = curText.substring(0, nextNameStart2); } if (this.prevSquiggleMetrics.get(currentConfiguration.name) === undefined) { - this.prevSquiggleMetrics.set(currentConfiguration.name, { PathNonExistent: 0, PathNotAFile: 0, PathNotADirectory: 0, CompilerPathMissingQuotes: 0, CompilerModeMismatch: 0, MultiplePathsNotAllowed: 0 }); + this.prevSquiggleMetrics.set(currentConfiguration.name, { PathNonExistent: 0, PathNotAFile: 0, PathNotADirectory: 0, CompilerPathMissingQuotes: 0, CompilerModeMismatch: 0, MultiplePathsNotAllowed: 0, MultiplePathsShouldBeSeparated: 0 }); } - const newSquiggleMetrics: { [key: string]: number } = { PathNonExistent: 0, PathNotAFile: 0, PathNotADirectory: 0, CompilerPathMissingQuotes: 0, CompilerModeMismatch: 0, MultiplePathsNotAllowed: 0 }; + const newSquiggleMetrics: { [key: string]: number } = { PathNonExistent: 0, PathNotAFile: 0, PathNotADirectory: 0, CompilerPathMissingQuotes: 0, CompilerModeMismatch: 0, MultiplePathsNotAllowed: 0, MultiplePathsShouldBeSeparated: 0 }; const isWindows: boolean = os.platform() === 'win32'; // TODO: Add other squiggles. @@ -1916,9 +1945,10 @@ export class CppProperties { } } } - if (currentConfiguration.compileCommands) { - paths.push(`${currentConfiguration.compileCommands}`); - } + + currentConfiguration.compileCommands?.forEach((file: string) => { + paths.push(`${file}`); + }); if (currentConfiguration.compilerPath) { // Unlike other cases, compilerPath may not start or end with " due to trimming of whitespace and the possibility of compiler args. @@ -1932,6 +1962,8 @@ export class CppProperties { const forcedeIncludeEnd: number = forcedIncludeStart === -1 ? -1 : curText.indexOf("]", forcedIncludeStart); const compileCommandsStart: number = curText.search(/\s*\"compileCommands\"\s*:\s*\"/); const compileCommandsEnd: number = compileCommandsStart === -1 ? -1 : curText.indexOf('"', curText.indexOf('"', curText.indexOf(":", compileCommandsStart)) + 1); + const compileCommandsArrayStart: number = curText.search(/\s*\"compileCommands\"\s*:\s*\[/); + const compileCommandsArrayEnd: number = compileCommandsArrayStart === -1 ? -1 : curText.indexOf("]", curText.indexOf("[", curText.indexOf(":", compileCommandsArrayStart)) + 1); const compilerPathStart: number = curText.search(/\s*\"compilerPath\"\s*:\s*\"/); const compilerPathValueStart: number = curText.indexOf('"', curText.indexOf(":", compilerPathStart)); const compilerPathEnd: number = compilerPathStart === -1 ? -1 : curText.indexOf('"', compilerPathValueStart + 1) + 1; @@ -2110,8 +2142,7 @@ export class CppProperties { newSquiggleMetrics.PathNonExistent++; } else { // Check for file versus path mismatches. - if ((curOffset >= forcedIncludeStart && curOffset <= forcedeIncludeEnd) || - (curOffset >= compileCommandsStart && curOffset <= compileCommandsEnd)) { + if (curOffset >= forcedIncludeStart && curOffset <= forcedeIncludeEnd) { if (expandedPaths.length > 1) { message = localize("multiple.paths.not.allowed", "Multiple paths are not allowed."); newSquiggleMetrics.MultiplePathsNotAllowed++; @@ -2121,6 +2152,20 @@ export class CppProperties { continue; } + message = localize("path.is.not.a.file", "Path is not a file: {0}", expandedPaths[0]); + newSquiggleMetrics.PathNotAFile++; + } + } else if ((curOffset >= compileCommandsStart && curOffset <= compileCommandsEnd) || + (curOffset >= compileCommandsArrayStart && curOffset <= compileCommandsArrayEnd)) { + if (expandedPaths.length > 1) { + message = localize("multiple.paths.should.be.separate.entries", "Multiple paths should be separate entries in an array."); + newSquiggleMetrics.MultiplePathsShouldBeSeparated++; + } else { + const resolvedPath = this.resolvePath(expandedPaths[0]); + if (util.checkFileExistsSync(resolvedPath)) { + continue; + } + message = localize("path.is.not.a.file", "Path is not a file: {0}", expandedPaths[0]); newSquiggleMetrics.PathNotAFile++; } @@ -2203,6 +2248,9 @@ export class CppProperties { if (newSquiggleMetrics.MultiplePathsNotAllowed !== this.prevSquiggleMetrics.get(currentConfiguration.name)?.MultiplePathsNotAllowed) { changedSquiggleMetrics.MultiplePathsNotAllowed = newSquiggleMetrics.MultiplePathsNotAllowed; } + if (newSquiggleMetrics.MultiplePathsShouldBeSeparated !== this.prevSquiggleMetrics.get(currentConfiguration.name)?.MultiplePathsShouldBeSeparated) { + changedSquiggleMetrics.MultiplePathsShouldBeSeparated = newSquiggleMetrics.MultiplePathsShouldBeSeparated; + } if (Object.keys(changedSquiggleMetrics).length > 0) { telemetry.logLanguageServerEvent("ConfigSquiggles", undefined, changedSquiggleMetrics); } @@ -2325,27 +2373,30 @@ export class CppProperties { public checkCompileCommands(): void { // Check for changes in case of file watcher failure. - const compileCommands: string | undefined = this.CurrentConfiguration?.compileCommands; + const compileCommands: string[] | undefined = this.CurrentConfiguration?.compileCommands; if (!compileCommands) { return; } - const compileCommandsFile: string | undefined = this.resolvePath(compileCommands); - fs.stat(compileCommandsFile, (err, stats) => { - if (err) { - if (err.code === "ENOENT" && this.compileCommandsFile) { - this.compileCommandsFileWatchers.forEach((watcher: fs.FSWatcher) => watcher.close()); - this.compileCommandsFileWatchers = []; // reset file watchers - this.onCompileCommandsChanged(compileCommandsFile); - this.compileCommandsFile = null; // File deleted - } - } else { - const compileCommandsLastChanged: Date | undefined = this.compileCommandsFileWatcherFallbackTime.get(compileCommandsFile); - if (compileCommandsLastChanged !== undefined && stats.mtime > compileCommandsLastChanged) { - this.compileCommandsFileWatcherFallbackTime.set(compileCommandsFile, new Date()); - this.onCompileCommandsChanged(compileCommandsFile); - this.compileCommandsFile = vscode.Uri.file(compileCommandsFile); // File created. + compileCommands.forEach((path: string) => { + const compileCommandsFile: string | undefined = this.resolvePath(path); + fs.stat(compileCommandsFile, (err, stats) => { + if (err) { + if (err.code === "ENOENT" && this.compileCommandsFiles.has(compileCommandsFile)) { + this.compileCommandsFileWatchers.forEach((watcher: fs.FSWatcher) => watcher.close()); + this.compileCommandsFileWatchers = []; // reset file watchers + this.onCompileCommandsChanged(compileCommandsFile); + this.compileCommandsFiles.delete(compileCommandsFile); // File deleted + } + } else { + const compileCommandsLastChanged: Date | undefined = this.compileCommandsFileWatcherFallbackTime.get(compileCommandsFile); + if (!this.compileCommandsFiles.has(compileCommandsFile) || + (compileCommandsLastChanged !== undefined && stats.mtime > compileCommandsLastChanged)) { + this.compileCommandsFileWatcherFallbackTime.set(compileCommandsFile, new Date()); + this.onCompileCommandsChanged(compileCommandsFile); + this.compileCommandsFiles.add(compileCommandsFile); // File created. + } } - } + }); }); } diff --git a/Extension/src/LanguageServer/copilotProviders.ts b/Extension/src/LanguageServer/copilotProviders.ts index a78fdfa5b..ce232865f 100644 --- a/Extension/src/LanguageServer/copilotProviders.ts +++ b/Extension/src/LanguageServer/copilotProviders.ts @@ -10,7 +10,7 @@ import * as util from '../common'; import * as logger from '../logger'; import * as telemetry from '../telemetry'; import { GetIncludesResult } from './client'; -import { getActiveClient } from './extension'; +import { getClients } from './extension'; import { getCompilerArgumentFilterMap, getProjectContext } from './lmTool'; nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); @@ -46,7 +46,7 @@ export async function registerRelatedFilesProvider(): Promise { const telemetryProperties: Record = {}; const telemetryMetrics: Record = {}; try { - const getIncludesHandler = async () => (await getIncludes(1))?.includedFiles.map(file => vscode.Uri.file(file)) ?? []; + const getIncludesHandler = async () => (await getIncludes(uri, 1))?.includedFiles.map(file => vscode.Uri.file(file)) ?? []; const getTraitsHandler = async () => { const projectContext = await getProjectContext(uri, context); @@ -157,10 +157,10 @@ export async function registerRelatedFilesProvider(): Promise { } } -async function getIncludes(maxDepth: number): Promise { - const activeClient = getActiveClient(); - const includes = await activeClient.getIncludes(maxDepth); - const wksFolder = activeClient.RootUri?.toString(); +async function getIncludes(uri: vscode.Uri, maxDepth: number): Promise { + const client = getClients().getClientFor(uri); + const includes = await client.getIncludes(uri, maxDepth); + const wksFolder = client.RootUri?.toString(); if (!wksFolder) { return includes; diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 8bc64f82f..642831c25 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -17,9 +17,11 @@ import { TargetPopulation } from 'vscode-tas-client'; import * as which from 'which'; import { logAndReturn } from '../Utility/Async/returns'; import * as util from '../common'; +import { modelSelector } from '../constants'; import { getCrashCallStacksChannel } from '../logger'; import { PlatformInformation } from '../platform'; import * as telemetry from '../telemetry'; +import { CopilotHoverProvider } from './Providers/CopilotHoverProvider'; import { Client, DefaultClient, DoxygenCodeActionCommandArguments, openFileVersions } from './client'; import { ClientCollection } from './clientCollection'; import { CodeActionDiagnosticInfo, CodeAnalysisDiagnosticIdentifiersAndUri, codeAnalysisAllFixes, codeAnalysisCodeToFixes, codeAnalysisFileToCodeActions } from './codeAnalysis'; @@ -28,6 +30,7 @@ import { CppBuildTaskProvider } from './cppBuildTaskProvider'; import { getCustomConfigProviders } from './customProviders'; import { getLanguageConfig } from './languageConfig'; import { CppConfigurationLanguageModelTool } from './lmTool'; +import { getLocaleId } from './localization'; import { PersistentState } from './persistentState'; import { NodeType, TreeNode } from './referencesModel'; import { CppSettings } from './settings'; @@ -423,6 +426,7 @@ export async function registerCommands(enabled: boolean): Promise { commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExtractToFreeFunction', enabled ? () => onExtractToFunction(true, false) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExtractToMemberFunction', enabled ? () => onExtractToFunction(false, true) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExpandSelection', enabled ? (r: Range) => onExpandSelection(r) : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCopilotHover', enabled ? () => onCopilotHover() : onDisabledCommand)); } function onDisabledCommand() { @@ -1387,3 +1391,135 @@ export async function preReleaseCheck(): Promise { } } } + +// This uses several workarounds for interacting with the hover feature. +// A proposal for dynamic hover content would help, such as the one here (https://github.com/microsoft/vscode/issues/195394) +async function onCopilotHover(): Promise { + telemetry.logLanguageServerEvent("CopilotHover"); + + // Check if the user has access to vscode language model. + const vscodelm = (vscode as any).lm; + if (!vscodelm) { + return; + } + + const copilotHoverProvider = clients.getDefaultClient().getCopilotHoverProvider(); + if (!copilotHoverProvider) { + return; + } + + const hoverDocument = copilotHoverProvider.getCurrentHoverDocument(); + const hoverPosition = copilotHoverProvider.getCurrentHoverPosition(); + if (!hoverDocument || !hoverPosition) { + return; + } + + // Prep hover with wait message. + copilotHoverProvider.showWaiting(); + + if (copilotHoverProvider.isCancelled(hoverDocument, hoverPosition)) { + return; + } + + // Move the cursor to the hover position, but don't focus the editor. + await vscode.window.showTextDocument(hoverDocument, { preserveFocus: true, selection: new vscode.Selection(hoverPosition, hoverPosition) }); + + if (!await showCopilotContent(copilotHoverProvider, hoverDocument, hoverPosition)) { + return; + } + + // Gather the content for the query from the client. + const requestInfo = await copilotHoverProvider.getRequestInfo(hoverDocument, hoverPosition); + if (requestInfo.length === 0) { + // Context is not available for this symbol. + telemetry.logLanguageServerEvent("CopilotHover", { "Message": "Copilot summary is not available for this symbol." }); + await showCopilotContent(copilotHoverProvider, hoverDocument, hoverPosition, localize("copilot.hover.unavailable", "Copilot summary is not available for this symbol.")); + return; + } + + const locale = getLocaleId(); + + const messages = [ + vscode.LanguageModelChatMessage + .User(requestInfo + locale)]; + + const [model] = await vscodelm.selectChatModels(modelSelector); + + let chatResponse: vscode.LanguageModelChatResponse | undefined; + try { + chatResponse = await model.sendRequest( + messages, + {}, + copilotHoverProvider.getCurrentHoverCancellationToken() + ); + } catch (err) { + if (err instanceof vscode.LanguageModelError) { + console.log(err.message, err.code, err.cause); + await reportCopilotFailure(copilotHoverProvider, hoverDocument, hoverPosition, err.message); + } else { + throw err; + } + return; + } + + // Ensure we have a valid response from Copilot. + if (!chatResponse) { + await reportCopilotFailure(copilotHoverProvider, hoverDocument, hoverPosition, "Invalid chat response from Copilot."); + return; + } + + let content: string = ''; + + try { + for await (const fragment of chatResponse.text) { + content += fragment; + } + } catch (err) { + if (err instanceof Error) { + console.log(err.message, err.cause); + await reportCopilotFailure(copilotHoverProvider, hoverDocument, hoverPosition, err.message); + } + return; + } + + if (content.length === 0) { + await reportCopilotFailure(copilotHoverProvider, hoverDocument, hoverPosition, "No content in response from Copilot."); + return; + } + + await showCopilotContent(copilotHoverProvider, hoverDocument, hoverPosition, content); +} + +async function reportCopilotFailure(copilotHoverProvider: CopilotHoverProvider, hoverDocument: vscode.TextDocument, hoverPosition: vscode.Position, errorMessage: string): Promise { + telemetry.logLanguageServerEvent("CopilotHoverError", { "ErrorMessage": errorMessage }); + // Display the localized default failure message in the hover. + await showCopilotContent(copilotHoverProvider, hoverDocument, hoverPosition, localize("copilot.hover.error", "An error occurred while generating Copilot summary.")); +} + +async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, hoverDocument: vscode.TextDocument, hoverPosition: vscode.Position, content?: string): Promise { + // Check if the cursor has been manually moved by the user. If so, exit. + const currentCursorPosition = vscode.window.activeTextEditor?.selection.active; + if (!currentCursorPosition?.isEqual(hoverPosition)) { + // Reset implies cancellation, but we need to ensure cancellation is acknowledged before returning. + copilotHoverProvider.reset(); + } + + if (copilotHoverProvider.isCancelled(hoverDocument, hoverPosition)) { + return false; + } + + await vscode.commands.executeCommand('cursorMove', { to: 'right' }); + await vscode.commands.executeCommand('editor.action.showHover', { focus: 'noAutoFocus' }); + + if (content) { + copilotHoverProvider.showContent(content); + } + + if (copilotHoverProvider.isCancelled(hoverDocument, hoverPosition)) { + return false; + } + await vscode.commands.executeCommand('cursorMove', { to: 'left' }); + await vscode.commands.executeCommand('editor.action.showHover', { focus: 'noAutoFocus' }); + + return true; +} diff --git a/Extension/src/LanguageServer/lmTool.ts b/Extension/src/LanguageServer/lmTool.ts index 50240fdd7..be03ca46e 100644 --- a/Extension/src/LanguageServer/lmTool.ts +++ b/Extension/src/LanguageServer/lmTool.ts @@ -38,7 +38,7 @@ const knownValues: { [Property in keyof ChatContextResult]?: { [id: string]: str 'c++17': 'C++17', 'c++20': 'C++20', 'c++23': 'C++23', - 'c90': "C90", + 'c89': "C89", 'c99': "C99", 'c11': "C11", 'c17': "C17", @@ -140,6 +140,8 @@ export async function getProjectContext(uri: vscode.Uri, context: { flags: Recor return undefined; } + const originalStandardVersion = projectContext.result.standardVersion; + formatChatContext(projectContext.result); const result: ProjectContext = { @@ -160,6 +162,11 @@ export async function getProjectContext(uri: vscode.Uri, context: { flags: Recor if (projectContext.result.standardVersion) { telemetryProperties["standardVersion"] = projectContext.result.standardVersion; } + else { + if (originalStandardVersion) { + telemetryProperties["originalStandardVersion"] = originalStandardVersion; + } + } if (projectContext.result.targetPlatform) { telemetryProperties["targetPlatform"] = projectContext.result.targetPlatform; } diff --git a/Extension/src/LanguageServer/persistentState.ts b/Extension/src/LanguageServer/persistentState.ts index e96be7a0e..7eb96ab5f 100644 --- a/Extension/src/LanguageServer/persistentState.ts +++ b/Extension/src/LanguageServer/persistentState.ts @@ -19,6 +19,11 @@ class PersistentStateBase { this.defaultvalue = defaultValue; this.state = state; this.curvalue = defaultValue; + + // Ensure the default is written to the state store. + if (this.state && this.state.get(this.key) === undefined) { + void this.state.update(this.key, this.defaultvalue); + } } public get Value(): T { diff --git a/Extension/src/LanguageServer/references.ts b/Extension/src/LanguageServer/references.ts index 0fc3d2fbb..e8e3567b7 100644 --- a/Extension/src/LanguageServer/references.ts +++ b/Extension/src/LanguageServer/references.ts @@ -13,6 +13,7 @@ import * as telemetry from '../telemetry'; import { DefaultClient } from './client'; import { PersistentState } from './persistentState'; import { FindAllRefsView } from './referencesView'; +import { CppSettings } from './settings'; nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @@ -469,19 +470,24 @@ export class ReferencesManager { } if (this.referencesStartedWhileTagParsing) { + const showLog: boolean = util.getNumericLoggingLevel(new CppSettings().loggingLevel) >= 3; const msg: string = localize("some.references.may.be.missing", "[Warning] Some references may be missing, because workspace parsing was incomplete when {0} was started.", referencesCommandModeToString(this.client.ReferencesCommandMode)); if (this.client.ReferencesCommandMode === ReferencesCommandMode.Peek) { if (this.referencesChannel) { this.referencesChannel.appendLine(msg); this.referencesChannel.appendLine(""); - this.referencesChannel.show(true); + if (showLog) { + this.referencesChannel.show(true); + } } } else if (this.client.ReferencesCommandMode === ReferencesCommandMode.Find) { const logChannel: vscode.OutputChannel = logger.getOutputChannel(); logChannel.appendLine(msg); logChannel.appendLine(""); - logChannel.show(true); + if (showLog) { + logChannel.show(true); + } } } diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 8e8d6c065..8b682f483 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -131,6 +131,7 @@ export interface WorkspaceFolderSettingsParams { filesExclude: Excludes; filesAutoSaveAfterDelay: boolean; filesEncoding: string; + filesEncodingChanged: boolean; searchExclude: Excludes; editorAutoClosingBrackets: string; editorInlayHintsEnabled: boolean; @@ -141,6 +142,7 @@ export interface WorkspaceFolderSettingsParams { export interface SettingsParams { filesAssociations: Associations; workspaceFallbackEncoding: string; + workspaceFallbackEncodingChanged: boolean; maxConcurrentThreads: number | null; maxCachedProcesses: number | null; maxMemory: number | null; @@ -161,6 +163,7 @@ export interface SettingsParams { codeAnalysisMaxMemory: number | null; codeAnalysisUpdateDelay: number; workspaceFolderSettings: WorkspaceFolderSettingsParams[]; + copilotHover: string; } function getTarget(): vscode.ConfigurationTarget { @@ -399,7 +402,17 @@ export class CppSettings extends Settings { public get defaultDotconfig(): string | undefined { return changeBlankStringToUndefined(this.getAsStringOrUndefined("default.dotConfig")); } public get defaultMacFrameworkPath(): string[] | undefined { return this.getArrayOfStringsWithUndefinedDefault("default.macFrameworkPath"); } public get defaultWindowsSdkVersion(): string | undefined { return changeBlankStringToUndefined(this.getAsStringOrUndefined("default.windowsSdkVersion")); } - public get defaultCompileCommands(): string | undefined { return changeBlankStringToUndefined(this.getAsStringOrUndefined("default.compileCommands")); } + public get defaultCompileCommands(): string[] | undefined { + const value: any = super.Section.get("default.compileCommands"); + if (isString(value)) { + return value.length > 0 ? [value] : undefined; + } + if (isArrayOfString(value)) { + const result = value.filter(x => x.length > 0); + return result.length > 0 ? result : undefined; + } + return undefined; + } public get defaultForcedInclude(): string[] | undefined { return this.getArrayOfStringsWithUndefinedDefault("default.forcedInclude"); } public get defaultIntelliSenseMode(): string | undefined { return this.getAsStringOrUndefined("default.intelliSenseMode"); } public get defaultCompilerPath(): string | null { return this.getAsString("default.compilerPath", true); } @@ -454,6 +467,17 @@ export class CppSettings extends Settings { && this.intelliSenseEngine.toLowerCase() === "default" && vscode.workspace.getConfiguration("workbench").get("colorTheme") !== "Default High Contrast"; } + public get copilotHover(): string { + if (!(vscode as any).lm) { + return "disabled"; + } + const val = super.Section.get("copilotHover"); + if (val === undefined) { + return "default"; + } + return val as string; + } + public get formattingEngine(): string { return this.getAsString("formatting"); } public get vcFormatIndentBraces(): boolean { return this.getAsBoolean("vcFormat.indent.braces"); } public get vcFormatIndentMultiLineRelativeTo(): string { return this.getAsString("vcFormat.indent.multiLineRelativeTo"); } @@ -638,7 +662,7 @@ export class CppSettings extends Settings { } if (isArrayOfString(value)) { - if (setting.items.enum && !allowUndefinedEnums) { + if (setting.items?.enum !== undefined && !allowUndefinedEnums) { if (!value.every(x => this.isValidEnum(setting.items.enum, x))) { return setting.default; } diff --git a/Extension/src/LanguageServer/settingsPanel.ts b/Extension/src/LanguageServer/settingsPanel.ts index 4522091d0..a13ef8109 100644 --- a/Extension/src/LanguageServer/settingsPanel.ts +++ b/Extension/src/LanguageServer/settingsPanel.ts @@ -337,7 +337,7 @@ export class SettingsPanel { this.configValues.macFrameworkPath = splitEntries(message.value); break; case elementId.compileCommands: - this.configValues.compileCommands = message.value || undefined; + this.configValues.compileCommands = splitEntries(message.value); break; case elementId.dotConfig: this.configValues.dotConfig = message.value || undefined; diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index 9cad273f5..fef9ae2fe 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -108,6 +108,11 @@ export class SettingsTracker { return ""; } return val; + } else if (curSetting["oneOf"]) { + // Currently only C_Cpp.default.compileCommands uses this case. + if (curSetting["oneOf"].some((x: any) => this.typeMatch(val, x.type))) { + return val; + } } else if (val === curSetting["default"]) { // C_Cpp.default.browse.path is a special case where the default value is null and doesn't match the type definition. return val; @@ -206,7 +211,7 @@ export class SettingsTracker { if (value && value.length > maxSettingLengthForTelemetry) { value = value.substring(0, maxSettingLengthForTelemetry) + "..."; } - return {key: key, value: value}; + return { key: key, value: value }; } return undefined; } diff --git a/Extension/src/constants.ts b/Extension/src/constants.ts index e38b513df..059bac203 100644 --- a/Extension/src/constants.ts +++ b/Extension/src/constants.ts @@ -13,3 +13,6 @@ export const isLinux = OperatingSystem === 'linux'; // if you want to see the output of verbose logging, set this to true. export const verboseEnabled = false; + +// Model selector for Copilot features +export const modelSelector = { vendor: 'copilot', family: 'gpt-4' }; diff --git a/Extension/src/main.ts b/Extension/src/main.ts index e15389dda..f8d5bcd33 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -221,6 +221,7 @@ function sendTelemetry(info: PlatformInformation): void { default: break; } + telemetryProperties['appName'] = vscode.env.appName; Telemetry.logDebuggerEvent("acquisition", telemetryProperties); logMachineIdMappings().catch(logAndReturn.undefined); } diff --git a/Extension/src/nativeStrings.json b/Extension/src/nativeStrings.json index 77ed4f4e0..2cbed668c 100644 --- a/Extension/src/nativeStrings.json +++ b/Extension/src/nativeStrings.json @@ -157,8 +157,8 @@ "fallback_to_64_bit_mode2": "Failed to query compiler. Falling back to 64-bit intelliSenseMode.", "fallback_to_no_bitness": "Failed to query compiler. Falling back to no bitness.", "intellisense_client_creation_aborted": "IntelliSense client creation aborted: {0}", - "include_errors_config_provider_intellisense_disabled ": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.", - "include_errors_config_provider_squiggles_disabled ": "#include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit ({0}).", + "include_errors_config_provider_intellisense_disabled": "#include errors detected based on information provided by the configurationProvider setting. IntelliSense features for this translation unit ({0}) will be provided by the Tag Parser.", + "include_errors_config_provider_squiggles_disabled": "#include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit ({0}).", "preprocessor_keyword": { "text": "preprocessor keyword", "hint": "Refers to C/C++ processor keywords" @@ -479,5 +479,6 @@ "refactor_extract_xborder_jump": "Jumps between the selected code and the surrounding code are present.", "refactor_extract_missing_return": "In the selected code, some control paths exit without setting the return value. This is supported only for scalar, numeric, and pointer return types.", "expand_selection": "Expand selection (to enable 'Extract to function')", - "file_not_found_in_path2": "\"{0}\" not found in compile_commands.json files. 'includePath' from c_cpp_properties.json in folder '{1}' will be used for this file instead." + "file_not_found_in_path2": "\"{0}\" not found in compile_commands.json files. 'includePath' from c_cpp_properties.json in folder '{1}' will be used for this file instead.", + "copilot_hover_link": "Generate Copilot summary" } diff --git a/Extension/src/telemetry.ts b/Extension/src/telemetry.ts index 7465de7df..7c8a00375 100644 --- a/Extension/src/telemetry.ts +++ b/Extension/src/telemetry.ts @@ -83,6 +83,10 @@ export async function isExperimentEnabled(experimentName: string): Promise { const experimentationService: IExperimentationService | undefined = await getExperimentationService(); const isEnabled: boolean | undefined = experimentationService?.getTreatmentVariable("vscode", experimentName); return isEnabled ?? false; diff --git a/Extension/test/scenarios/SingleRootProject/tests/copilotProviders.test.ts b/Extension/test/scenarios/SingleRootProject/tests/copilotProviders.test.ts index 626ed287c..31b7615a4 100644 --- a/Extension/test/scenarios/SingleRootProject/tests/copilotProviders.test.ts +++ b/Extension/test/scenarios/SingleRootProject/tests/copilotProviders.test.ts @@ -10,6 +10,7 @@ import * as sinon from 'sinon'; import * as vscode from 'vscode'; import * as util from '../../../../src/common'; import { DefaultClient, GetIncludesResult } from '../../../../src/LanguageServer/client'; +import { ClientCollection } from '../../../../src/LanguageServer/clientCollection'; import { CopilotApi, CopilotTrait } from '../../../../src/LanguageServer/copilotProviders'; import * as extension from '../../../../src/LanguageServer/extension'; import * as lmTool from '../../../../src/LanguageServer/lmTool'; @@ -19,18 +20,19 @@ import * as telemetry from '../../../../src/telemetry'; describe('copilotProviders Tests', () => { let moduleUnderTest: any; let mockCopilotApi: sinon.SinonStubbedInstance; - let getActiveClientStub: sinon.SinonStub; + let getClientsStub: sinon.SinonStub; let activeClientStub: sinon.SinonStubbedInstance; let vscodeGetExtensionsStub: sinon.SinonStub; let callbackPromise: Promise<{ entries: vscode.Uri[]; traits?: CopilotTrait[] }> | undefined; let vscodeExtension: vscode.Extension; let telemetryStub: sinon.SinonStub; - const includedFiles = process.platform === 'win32' ? + const includedFiles: string[] = process.platform === 'win32' ? ['c:\\system\\include\\vector', 'c:\\system\\include\\string', 'C:\\src\\my_project\\foo.h'] : ['/system/include/vector', '/system/include/string', '/home/src/my_project/foo.h']; - const rootUri = vscode.Uri.file(process.platform === 'win32' ? 'C:\\src\\my_project' : '/home/src/my_project'); - const expectedInclude = process.platform === 'win32' ? 'file:///c%3A/src/my_project/foo.h' : 'file:///home/src/my_project/foo.h'; + const rootUri: vscode.Uri = vscode.Uri.file(process.platform === 'win32' ? 'C:\\src\\my_project' : '/home/src/my_project'); + const expectedInclude: string = process.platform === 'win32' ? 'file:///c%3A/src/my_project/foo.h' : 'file:///home/src/my_project/foo.h'; + const sourceFileUri: vscode.Uri = vscode.Uri.file(process.platform === 'win32' ? 'file:///c%3A/src/my_project/foo.cpp' : 'file:///home/src/my_project/foo.cpp'); beforeEach(() => { proxyquire.noPreserveCache(); // Tells proxyquire to not fetch the module from cache @@ -70,7 +72,9 @@ describe('copilotProviders Tests', () => { }; activeClientStub = sinon.createStubInstance(DefaultClient); - getActiveClientStub = sinon.stub(extension, 'getActiveClient').returns(activeClientStub); + const clientsStub = sinon.createStubInstance(ClientCollection); + getClientsStub = sinon.stub(extension, 'getClients').returns(clientsStub); + clientsStub.getClientFor.returns(activeClientStub); activeClientStub.getIncludes.resolves({ includedFiles: [] }); telemetryStub = sinon.stub(telemetry, 'logCopilotEvent').returns(); }); @@ -90,7 +94,7 @@ describe('copilotProviders Tests', () => { if (_providerId.languageId === 'cpp') { const tokenSource = new vscode.CancellationTokenSource(); try { - callbackPromise = callback(vscode.Uri.parse('file:///test-extension-path'), { flags: flags ?? {} }, tokenSource.token); + callbackPromise = callback(sourceFileUri, { flags: flags ?? {} }, tokenSource.token); } finally { tokenSource.dispose(); } @@ -129,7 +133,7 @@ describe('copilotProviders Tests', () => { ok(vscodeGetExtensionsStub.calledOnce, 'vscode.extensions.getExtension should be called once'); ok(mockCopilotApi.registerRelatedFilesProvider.calledWithMatch(sinon.match({ extensionId: 'test-extension-id', languageId: sinon.match.in(['c', 'cpp', 'cuda-cpp']) })), 'registerRelatedFilesProvider should be called with the correct providerId and languageId'); - ok(getActiveClientStub.callCount !== 0, 'getActiveClient should be called'); + ok(getClientsStub.callCount !== 0, 'getClients should be called'); ok(callbackPromise, 'callbackPromise should be defined'); ok(result, 'result should be defined'); ok(result.entries.length === 1, 'result.entries should have 1 included file'); diff --git a/Extension/test/scenarios/SingleRootProject/tests/lmTool.test.ts b/Extension/test/scenarios/SingleRootProject/tests/lmTool.test.ts index afcf90366..a5cc0825f 100644 --- a/Extension/test/scenarios/SingleRootProject/tests/lmTool.test.ts +++ b/Extension/test/scenarios/SingleRootProject/tests/lmTool.test.ts @@ -376,6 +376,7 @@ describe('CppConfigurationLanguageModelTool Tests', () => { property['language'] === undefined && property['compiler'] === undefined && property['standardVersion'] === undefined && + property['originalStandardVersion'] === 'gnu++17' && property['targetPlatform'] === undefined))); ok(result, 'result should not be undefined'); ok(result.language === ''); diff --git a/Extension/ui/settings.html b/Extension/ui/settings.html index 01ea0d9e8..8abe8ef48 100644 --- a/Extension/ui/settings.html +++ b/Extension/ui/settings.html @@ -672,11 +672,12 @@
Compile commands
- The full path to the compile_commands.json file for the workspace. The include paths and defines discovered in this file will be used instead of the values set for includePath and defines settings. If the compile commands database does not contain an entry for the translation unit that corresponds to the file you opened in the editor, then a warning message will appear and the extension will use the includePath and defines settings instead. + A list of paths to compile_commands.json files for the workspace. The include paths and defines discovered in these files will be used instead of the values set for includePath and defines settings. If the compile commands database does not contain an entry for the translation unit that corresponds to the file you opened in the editor, then a warning message will appear and the extension will use the includePath and defines settings instead.
- -
+
One compile commands path per line.
+ +
diff --git a/Extension/ui/settings.ts b/Extension/ui/settings.ts index e70516b27..fc75f4cbd 100644 --- a/Extension/ui/settings.ts +++ b/Extension/ui/settings.ts @@ -295,7 +295,7 @@ class SettingsApp { // Advanced settings (document.getElementById(elementId.windowsSdkVersion)).value = config.windowsSdkVersion ? config.windowsSdkVersion : ""; (document.getElementById(elementId.macFrameworkPath)).value = joinEntries(config.macFrameworkPath); - (document.getElementById(elementId.compileCommands)).value = config.compileCommands ? config.compileCommands : ""; + (document.getElementById(elementId.compileCommands)).value = joinEntries(config.compileCommands); (document.getElementById(elementId.mergeConfigurations)).checked = config.mergeConfigurations; (document.getElementById(elementId.configurationProvider)).value = config.configurationProvider ? config.configurationProvider : ""; (document.getElementById(elementId.forcedInclude)).value = joinEntries(config.forcedInclude); diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index 38bc6fd20..8c79c8320 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -1,7 +1,7 @@ -

Relaunch using the developer command prompt

-

You are using a windows machine with the MSVC compiler, so you need to start VS Code from the developer command prompt for all environment variables to be set correctly. To relaunch using the developer command prompt:

+

Relaunch using the Developer Command Prompt for VS

+

You are using a windows machine with the MSVC compiler, so you need to start VS Code from the Developer Command Prompt for VS for all environment variables to be set correctly. To relaunch using the Developer Command Prompt for VS:

    -
  1. Open the Developer Command Prompt for VS by typing "developer" in the Windows Start menu. Select the Developer Command Prompt for VS, which will automatically navigate to your current open folder.

    +
  2. Open the Developer Command Prompt for VS by typing "developer" in the Windows Start menu. Select the Developer Command Prompt for VS, which will automatically navigate to your current open folder.

  3. -
  4. Type "code" into the command prompt and hit enter. This should relaunch VS Code and take you back to this walkthrough.

    +
  5. Type "code" into the command prompt and hit enter. This should relaunch VS Code and take you back to this walkthrough.

  6. diff --git a/Extension/walkthrough/installcompiler/install-compiler-windows.md b/Extension/walkthrough/installcompiler/install-compiler-windows.md index 7abf671dd..81cdda541 100644 --- a/Extension/walkthrough/installcompiler/install-compiler-windows.md +++ b/Extension/walkthrough/installcompiler/install-compiler-windows.md @@ -8,11 +8,11 @@

    Note: You can use the C++ toolset from Visual Studio Build Tools along with Visual Studio Code to compile, build, and verify any C++ codebase as long as you also have a valid Visual Studio license (either Community, Pro, or Enterprise) that you are actively using to develop that C++ codebase.

    -
  7. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

    +
  8. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

  9. -
  10. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    +
  11. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    -

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

    +

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

\ No newline at end of file diff --git a/Extension/walkthrough/installcompiler/install-compiler-windows10.md b/Extension/walkthrough/installcompiler/install-compiler-windows10.md index 999b9ed46..1bcae2d9a 100644 --- a/Extension/walkthrough/installcompiler/install-compiler-windows10.md +++ b/Extension/walkthrough/installcompiler/install-compiler-windows10.md @@ -11,11 +11,11 @@

Verifying the compiler installation

    -
  1. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

    +
  2. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

  3. -
  4. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    +
  5. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    -

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

    +

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

diff --git a/Extension/walkthrough/installcompiler/install-compiler-windows11.md b/Extension/walkthrough/installcompiler/install-compiler-windows11.md index 1d21f4596..d711b8d9e 100644 --- a/Extension/walkthrough/installcompiler/install-compiler-windows11.md +++ b/Extension/walkthrough/installcompiler/install-compiler-windows11.md @@ -11,11 +11,11 @@

Verifying the compiler installation

    -
  1. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

    +
  2. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

  3. -
  4. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    +
  5. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    -

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

    +

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

diff --git a/Extension/yarn.lock b/Extension/yarn.lock index c4ee00c3d..3c5fdaa19 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -3355,9 +3355,9 @@ mute-stdout@^2.0.0: integrity sha1-xqm0thhdO39w0//Lc0y/yLDzh2E= nanoid@^3.3.7: - version "3.3.7" - resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" - integrity sha1-0MMBppG8jVTvoKIibM8/4v1la9g= + version "3.3.8" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha1-sb4wML7jaq/xi6yzdeXM5SFoS68= natural-compare@^1.4.0: version "1.4.0"