From 9df6d4aa1359389261666958cd393ad5967b9492 Mon Sep 17 00:00:00 2001 From: AcerecA Date: Mon, 20 Jan 2025 15:27:57 +0100 Subject: [PATCH] change cism hint text --- skillls/main.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/skillls/main.py b/skillls/main.py index 12c5fef..19be7b9 100644 --- a/skillls/main.py +++ b/skillls/main.py @@ -92,14 +92,19 @@ class SkillLanguageServer(LanguageServer): if fullmatch("\\w", line[col - 1]) and char == "(": if m := re.match(r"([a-zA-Z_][a-zA-Z_0-9]*)$", line[:col]): tok = m.group(1) - else: - tok = line[col - 1] - yield Diagnostic( - Range( + r = Range( Position(row, col - len(tok)), Position(row, col + 1), - ), - f"c-ism detected: change to `( {tok}`", + ) + else: + tok = "" + r = Range( + Position(row, col - 1), + Position(row, col + 1), + ) + yield Diagnostic( + r, + f"change `{tok}(` to `( {tok}` [cism]", DiagnosticSeverity.Hint, )