@@ -51,136 +51,33 @@ Improvements to clangd
51
51
Inlay hints
52
52
^^^^^^^^^^^
53
53
54
- - This feature provides texutal hints interleaved with the code,
55
- like parameter names, deduced types and designated initializers.
56
-
57
- - The `clangd/inlayHints <https://clangd.llvm.org/extensions#inlay-hints >`_
58
- LSP extension is now documented, and both position and range.
59
-
60
- - Inlay hints are now on-by-default in clangd, if the client supports and
61
- exposes them. (`vscode-clangd
62
- <https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd> `_
63
- does so). The ``-inlay-hints `` flag has been removed.
64
-
65
- - Inlay hints can be `disabled or configured
66
- <https://clangd.llvm.org/config#inlayhints> `_ in the config file.
67
-
68
54
Diagnostics
69
55
^^^^^^^^^^^
70
56
71
- - `Unused #include
72
- <https://clangd.llvm.org/design/include-cleaner> `_ diagnostics are available.
73
- These are off by default, and can be turned on through the
74
- `Diagnostics.UnusedIncludes <https://clangd.llvm.org/config#unusedincludes >`_
75
- config option.
76
-
77
- - ``Deprecated `` and ``Unnecessary `` tags from LSP 3.15 are set on
78
- ``-Wdeprecated `` and ``-Wunused `` diagnostics. Clients may display these
79
- in a specialized way.
80
-
81
- - clangd suggests inserting includes to fix problems in more cases:
82
-
83
- - calling unknown functions in C, even when an implicit declaration is
84
- inferred.
85
- - incomplete types (some additional cases).
86
- - various diagnostics that specify "include <foo.h>" in their text.
87
-
88
- - The "populate switch" action is more reliably offered as a fix for
89
- ``-Wswitch `` warnings, and works with C enums.
90
-
91
- - Warnings specified by ``ExtraArgs: -W... `` flags in ``.clang-tidy `` config
92
- files are now produced.
93
-
94
57
Semantic Highlighting
95
58
^^^^^^^^^^^^^^^^^^^^^
96
59
97
- - ``virtual `` modifier for method names
98
- - ``usedAsMutableReference `` modifier for function parameters
99
- - Lambda captures now marked as local variables.
100
-
101
60
Compile flags
102
61
^^^^^^^^^^^^^
103
62
104
- - Compile flags like ``-xc++-header `` that must precede input file names are now
105
- added correctly by the
106
- `CompileFlags.Add <https://clangd.llvm.org/config#add >`_ config option.
107
-
108
- - If multiple architectures are specified (e.g. when targeting Apple M1+Intel),
109
- clangd will now use the host architecture instead of failing to parse.
110
-
111
- - Added `CompileFlags.Compiler <https://clangd.llvm.org/config#compiler >`_
112
- option to override executable name in compile flags.
113
-
114
- - Copying ``compile_commands.json `` entries from one file to another (and simply
115
- adjusting ``file ``) should now work correctly.
116
-
117
63
Hover
118
64
^^^^^
119
65
120
- - Hovering on many attributes (e.g. ``[[nodiscard]] ``) will show documentation.
121
- - Hovering on include directives shows the resolved header path.
122
- - Hovering on character literals shows their numeric value.
123
- - Code snippets are marked with the appropriate language instead of always C++.
124
- This may improve clients' syntax highlighting.
125
- - Include desugared types in hover, like in diagnostics.
126
- Off by default, controlled with `Hover.ShowAKA
127
- <https://clangd.llvm.org/config#showaka> `_ config option.
128
-
129
66
Code completion
130
67
^^^^^^^^^^^^^^^
131
68
132
- - Completion of attributes (e.g. ``[[gsl::Owner(Foo)]] ``)
133
- - Completion of ``/*ParameterName=*/ `` comments.
134
- - Documentation of items with ``annotate `` attributes now includes the
135
- annotation.
136
- - Improved handling of results with 1-3 character names.
137
- - Completion of members in constructor init lists (``Foo() : member_() {} ``) is
138
- much more reliable.
139
- - C++ Standard library completions should be less noisy: parameter names are
140
- deuglified (``vector<_Tp> `` is now ``vector<Tp> ``) and many
141
- ``__implementation_details `` are hidden altogether.
142
-
143
69
Signature help
144
70
^^^^^^^^^^^^^^
145
71
146
- - Signatures for template argument lists
147
- - Signatures for braced constructor calls
148
- - Signatures for aggregate initializers
149
- - Signatures for members in constructor init lists are much more reliable.
150
- - Variadic functions correctly show signature help when typing the variadic
151
- arguments.
152
- - Signature help is retriggered on closing brackets ``) ``, ``} ``, ``> ``.
153
- This means signature help should be correct after nested function calls.
154
-
155
72
Cross-references
156
73
^^^^^^^^^^^^^^^^
157
74
158
- - Support for ``textDocument/typeDefinition `` LSP request.
159
- - Improved handling of symbols introduced via using declarations.
160
- - Searching for references to an overriding method also returns references to
161
- the base class method. (Typically calls that may invoke the override).
162
- - All references from the current file are always returned, even if there are
163
- enough to exceed our usual limit.
164
-
165
75
Objective-C
166
76
^^^^^^^^^^^
167
77
168
- - ``#pragma mark `` directives now form groups in the document outline.
169
- - ``id `` and ``instancetype `` are treated as keywords rather than typedefs
170
-
171
78
Miscellaneous
172
79
^^^^^^^^^^^^^
173
80
174
- - Include request context on crashes when possible.
175
- - Many stability, performance and correctness improvements.
176
- - ``-use-dirty-headers `` command line flag to use dirty buffer contents when
177
- parsing headers, rather than the saved on-disk contents.
178
- - ``clangd --check=/path/to/file.cpp `` now reads config files in ancestor
179
- directories, in addition to user config file.
180
- - Improved compile flags handling in ``clangd-indexer ``.
181
- - The index file format changed in this release, indexes need to be rebuilt.
182
- This should happen transparently in standard cases (the background index).
183
-
184
81
Improvements to clang-doc
185
82
-------------------------
186
83
@@ -199,159 +96,15 @@ The improvements are...
199
96
Improvements to clang-tidy
200
97
--------------------------
201
98
202
- - Ignore warnings from macros defined in system headers, if not using the
203
- `-system-headers ` flag.
204
-
205
- - Added support for globbing in `NOLINT* ` expressions, to simplify suppressing
206
- multiple warnings in the same line.
207
-
208
- - Added support for `NOLINTBEGIN ` ... `NOLINTEND ` comments to suppress
209
- Clang-Tidy warnings over multiple lines.
210
-
211
- - Added support for external plugin checks with `-load `.
212
-
213
99
New checks
214
100
^^^^^^^^^^
215
101
216
- - New :doc: `abseil-cleanup-ctad
217
- <clang-tidy/checks/abseil-cleanup-ctad>` check.
218
-
219
- Suggests switching the initialization pattern of ``absl::Cleanup ``
220
- instances from the factory function to class template argument
221
- deduction (CTAD), in C++17 and higher.
222
-
223
- - New :doc: `bugprone-stringview-nullptr
224
- <clang-tidy/checks/bugprone-stringview-nullptr>` check.
225
-
226
- Checks for various ways that the ``const CharT* `` constructor of
227
- ``std::basic_string_view `` can be passed a null argument.
228
-
229
- - New :doc: `bugprone-suspicious-memory-comparison
230
- <clang-tidy/checks/bugprone-suspicious-memory-comparison>` check.
231
-
232
- Finds potentially incorrect calls to ``memcmp() `` based on properties of the
233
- arguments.
234
-
235
- - New :doc: `cppcoreguidelines-virtual-class-destructor
236
- <clang-tidy/checks/cppcoreguidelines-virtual-class-destructor>` check.
237
-
238
- Finds virtual classes whose destructor is neither public and virtual nor
239
- protected and non-virtual.
240
-
241
- - New :doc: `misc-misleading-bidirectional <clang-tidy/checks/misc-misleading-bidirectional >` check.
242
-
243
- Inspects string literal and comments for unterminated bidirectional Unicode
244
- characters.
245
-
246
- - New :doc: `misc-misleading-identifier <clang-tidy/checks/misc-misleading-identifier >` check.
247
-
248
- Reports identifier with unicode right-to-left characters.
249
-
250
- - New :doc: `readability-container-contains
251
- <clang-tidy/checks/readability-container-contains>` check.
252
-
253
- Finds usages of ``container.count() `` and ``container.find() == container.end() `` which should
254
- be replaced by a call to the ``container.contains() `` method introduced in C++20.
255
-
256
- - New :doc: `readability-container-data-pointer
257
- <clang-tidy/checks/readability-container-data-pointer>` check.
258
-
259
- Finds cases where code could use ``data() `` rather than the address of the
260
- element at index 0 in a container.
261
-
262
- - New :doc: `readability-duplicate-include
263
- <clang-tidy/checks/readability-duplicate-include>` check.
264
-
265
- Looks for duplicate includes and removes them.
266
-
267
- - New :doc: `readability-identifier-length
268
- <clang-tidy/checks/readability-identifier-length>` check.
269
-
270
- Reports identifiers whose names are too short. Currently checks local
271
- variables and function parameters only.
272
-
273
102
New check aliases
274
103
^^^^^^^^^^^^^^^^^
275
104
276
- - New alias :doc: `cert-err33-c
277
- <clang-tidy/checks/cert-err33-c>` to
278
- :doc: `bugprone-unused-return-value
279
- <clang-tidy/checks/bugprone-unused-return-value>` was added.
280
-
281
- - New alias :doc: `cert-exp42-c
282
- <clang-tidy/checks/cert-exp42-c>` to
283
- :doc: `bugprone-suspicious-memory-comparison
284
- <clang-tidy/checks/bugprone-suspicious-memory-comparison>` was added.
285
-
286
- - New alias :doc: `cert-flp37-c
287
- <clang-tidy/checks/cert-flp37-c>` to
288
- :doc: `bugprone-suspicious-memory-comparison
289
- <clang-tidy/checks/bugprone-suspicious-memory-comparison>` was added.
290
-
291
105
Changes in existing checks
292
106
^^^^^^^^^^^^^^^^^^^^^^^^^^
293
107
294
- - :doc: `bugprone-assert-side-effect
295
- <clang-tidy/checks/bugprone-assert-side-effect>` check now supports an
296
- ``IgnoredFunctions `` option to explicitly consider the specified
297
- semicolon-separated functions list as not having any side-effects.
298
- Regular expressions for the list items are also accepted.
299
-
300
- - Fixed a false positive in :doc: `bugprone-throw-keyword-missing
301
- <clang-tidy/checks/bugprone-throw-keyword-missing>` when creating an
302
- exception object using placement new.
303
-
304
- - Removed default setting ``cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors = "true" ``,
305
- from :doc: `cppcoreguidelines-explicit-virtual-functions
306
- <clang-tidy/checks/cppcoreguidelines-explicit-virtual-functions>`
307
- to match the current state of the C++ Core Guidelines.
308
-
309
- - Eliminated false positives for :doc: `cppcoreguidelines-macro-usage
310
- <clang-tidy/checks/cppcoreguidelines-macro-usage>` by restricting
311
- the warning about using constants to only macros that expand to literals.
312
-
313
- - :doc: `cppcoreguidelines-narrowing-conversions
314
- <clang-tidy/checks/cppcoreguidelines-narrowing-conversions>`
315
- check now supports a ``WarnOnIntegerToFloatingPointNarrowingConversion ``
316
- option to control whether to warn on narrowing integer to floating-point
317
- conversions.
318
-
319
- - Make the :doc: `cppcoreguidelines-pro-bounds-array-to-pointer-decay
320
- <clang-tidy/checks/cppcoreguidelines-pro-bounds-array-to-pointer-decay>`
321
- check accept string literal to pointer decay in conditional operator even
322
- if operands are of the same length.
323
-
324
- - Removed suggestion ``use gsl::at `` from warning message in the
325
- :doc: `cppcoreguidelines-pro-bounds-constant-array-index
326
- <clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index>`
327
- check, since that is not a requirement from the C++ Core Guidelines.
328
- This allows people to choose their own safe indexing strategy. The
329
- fix-it is kept for those who want to use the GSL library.
330
-
331
- - Fixed a false positive in :doc: `fuchsia-trailing-return
332
- <clang-tidy/checks/fuchsia-trailing-return>` for C++17 deduction guides.
333
-
334
- - Updated :doc: `google-readability-casting
335
- <clang-tidy/checks/google-readability-casting>` to diagnose and fix
336
- functional casts, to achieve feature parity with the corresponding
337
- ``cpplint.py `` check.
338
-
339
- - Generalized the :doc: `modernize-use-default-member-init
340
- <clang-tidy/checks/modernize-use-default-member-init>` check to handle
341
- non-default constructors.
342
-
343
- - Improved :doc: `performance-move-const-arg
344
- <clang-tidy/checks/performance-move-const-arg>` check.
345
-
346
- Removed a wrong FixIt for trivially copyable objects wrapped by
347
- ``std::move() `` and passed to an rvalue reference parameter. Removal of
348
- ``std::move() `` would break the code.
349
-
350
- - :doc: `readability-simplify-boolean-expr
351
- <clang-tidy/checks/readability-simplify-boolean-expr>` now simplifies
352
- return statements associated with ``case ``, ``default `` and labeled
353
- statements.
354
-
355
108
Removed checks
356
109
^^^^^^^^^^^^^^
357
110
0 commit comments