Skip to content

Commit d762c75

Browse files
Fix regex and use spread operator in EditorConfigDiagnosticsProvider
Agent-Logs-Url: https://github.com/editorconfig/editorconfig-vscode/sessions/3abe6736-ac54-4860-9162-9ef9f3c0af05 Co-authored-by: SunsetTechuila <115353812+SunsetTechuila@users.noreply.github.com>
1 parent c4d66b5 commit d762c75

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/EditorConfigDiagnosticsProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import {
1111

1212
/**
1313
* Matches an inline comment: any line that contains non-whitespace content
14-
* followed by an unquoted `#` or `;` (with optional preceding whitespace).
14+
* 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.
1717
*/
18-
const INLINE_COMMENT_RE = /\S.*?[ \t]*([#;].*)$/
18+
const INLINE_COMMENT_RE = /\S.*[ \t]+([#;].*)$/
1919

2020
export default class EditorConfigDiagnosticsProvider {
2121
private collection: DiagnosticCollection
@@ -43,7 +43,7 @@ export default class EditorConfigDiagnosticsProvider {
4343
),
4444
)
4545

46-
this.disposable = Disposable.from.apply(this, subscriptions)
46+
this.disposable = Disposable.from(...subscriptions)
4747
}
4848

4949
private analyze(doc: TextDocument) {

0 commit comments

Comments
 (0)