@@ -180,6 +180,50 @@ with:
180180 $ symfony-lsp check --list-codes
181181 $ symfony-lsp check --format=json --list-codes
182182
183+ Suppressing Intentional Diagnostics
184+ -----------------------------------
185+
186+ When source code intentionally triggers a diagnostic, add a code-qualified
187+ suppression in a native PHP, Twig, YAML or XML comment. The editor and
188+ ``symfony-lsp check `` apply the same suppressions:
189+
190+ .. code-block :: php
191+
192+ /* @symfony-lsp-ignore template.not_found (intentional missing template) */
193+ $this->render('test/does_not_exist.html.twig');
194+
195+ .. code-block :: twig
196+
197+ {# @symfony-lsp-ignore template.not_found (intentional missing template) #}
198+ {{ include('test/does_not_exist.html.twig') }}
199+
200+ .. code-block :: yaml
201+
202+ # @symfony-lsp-ignore config.unknown_key (compatibility fixture)
203+ framework :
204+ unsupported_option : true
205+
206+ .. code-block :: xml
207+
208+ <!-- @symfony-lsp-ignore config.unknown_key (compatibility fixture) -->
209+ <framework : unsupported-option >true</framework : unsupported-option >
210+
211+ A standalone comment targets diagnostics whose ranges start on the next
212+ physical line. A comment that shares a line with source code targets that line.
213+ Blank lines aren't skipped.
214+
215+ The directive accepts a comma-separated list of exact diagnostic codes. Each
216+ listed code suppresses one occurrence, so repeat a code to suppress several
217+ matching diagnostics on the same line. An optional parenthesized reason can
218+ follow the codes. Bare directives, malformed directives and unknown codes
219+ produce a ``suppression.invalid `` warning instead of suppressing diagnostics.
220+
221+ Only native comments are recognized. Directive-shaped text in strings, Twig
222+ verbatim content, YAML block scalars and XML CDATA sections has no effect.
223+ Suppressed diagnostics are omitted from editor publications and checker
224+ reports, and they aren't written to new baselines. A matching entry in an
225+ existing baseline becomes stale.
226+
183227Using a Baseline
184228----------------
185229
0 commit comments