Skip to content

Commit 9efd460

Browse files
Document why regex is needed instead of grammar scope in diagnostics provider
Agent-Logs-Url: https://github.com/editorconfig/editorconfig-vscode/sessions/4832367c-d136-4899-946a-39e1d7d3fa6c Co-authored-by: SunsetTechuila <115353812+SunsetTechuila@users.noreply.github.com>
1 parent d762c75 commit 9efd460

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/EditorConfigDiagnosticsProvider.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ import {
1414
* followed by required whitespace and then an unquoted `#` or `;`.
1515
* Lines where `#` or `;` is the first non-whitespace character are proper
1616
* standalone comments and are excluded before this regex is applied.
17+
*
18+
* This mirrors the `inlineComment` rule in syntaxes/editorconfig.tmLanguage.json
19+
* (`invalid.illegal.inline-comment.editorconfig`). Unfortunately VS Code's
20+
* extension API does not expose TextMate token scopes at runtime, so the
21+
* detection must be re-implemented here in TypeScript.
1722
*/
1823
const INLINE_COMMENT_RE = /\S.*[ \t]+([#;].*)$/
1924

0 commit comments

Comments
 (0)