change cism hint text
This commit is contained in:
parent
9f7de31dae
commit
9df6d4aa13
|
@ -92,14 +92,19 @@ class SkillLanguageServer(LanguageServer):
|
||||||
if fullmatch("\\w", line[col - 1]) and char == "(":
|
if fullmatch("\\w", line[col - 1]) and char == "(":
|
||||||
if m := re.match(r"([a-zA-Z_][a-zA-Z_0-9]*)$", line[:col]):
|
if m := re.match(r"([a-zA-Z_][a-zA-Z_0-9]*)$", line[:col]):
|
||||||
tok = m.group(1)
|
tok = m.group(1)
|
||||||
else:
|
r = Range(
|
||||||
tok = line[col - 1]
|
|
||||||
yield Diagnostic(
|
|
||||||
Range(
|
|
||||||
Position(row, col - len(tok)),
|
Position(row, col - len(tok)),
|
||||||
Position(row, col + 1),
|
Position(row, col + 1),
|
||||||
),
|
)
|
||||||
f"c-ism detected: change to `( {tok}`",
|
else:
|
||||||
|
tok = "<token>"
|
||||||
|
r = Range(
|
||||||
|
Position(row, col - 1),
|
||||||
|
Position(row, col + 1),
|
||||||
|
)
|
||||||
|
yield Diagnostic(
|
||||||
|
r,
|
||||||
|
f"change `{tok}(` to `( {tok}` [cism]",
|
||||||
DiagnosticSeverity.Hint,
|
DiagnosticSeverity.Hint,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue