Compare commits
No commits in common. "82d6ce586b8ee0c89d654504a34799f56730aba9" and "ac9a69265b4afffb03cedd51bc5177bbba2d6b32" have entirely different histories.
82d6ce586b
...
ac9a69265b
|
@ -165,7 +165,7 @@ class SkillLanguageServer(LanguageServer):
|
||||||
def _diagnose_cisms(self, doc: TextDocument) -> Generator[Diagnostic, None, None]:
|
def _diagnose_cisms(self, doc: TextDocument) -> Generator[Diagnostic, None, None]:
|
||||||
for row, line in enumerate(doc.lines):
|
for row, line in enumerate(doc.lines):
|
||||||
for m in finditer(
|
for m in finditer(
|
||||||
r"(?P<proc>procedure\s+|;.*)?([a-zA-Z_][a-zA-Z_0-9]+)\(", line
|
r"(?P<proc>procedure\s+)?([a-zA-Z_][a-zA-Z_0-9]+)\(", line
|
||||||
):
|
):
|
||||||
if not m.group("proc"):
|
if not m.group("proc"):
|
||||||
yield Diagnostic(
|
yield Diagnostic(
|
||||||
|
@ -173,6 +173,28 @@ class SkillLanguageServer(LanguageServer):
|
||||||
f"change `{m.group(2)}(` to `( {m.group(2)}`",
|
f"change `{m.group(2)}(` to `( {m.group(2)}`",
|
||||||
DiagnosticSeverity.Hint,
|
DiagnosticSeverity.Hint,
|
||||||
)
|
)
|
||||||
|
# for col, char in enumerate(line):
|
||||||
|
# if col > 0:
|
||||||
|
# if fullmatch(r"\w", line[col - 1]) and char == "(":
|
||||||
|
# if m := rematch(r"([a-zA-Z_][a-zA-Z_0-9]*)$", line[:col]):
|
||||||
|
# tok = m.group(1)
|
||||||
|
# r = Range(
|
||||||
|
# Position(row, col - len(tok)),
|
||||||
|
# Position(row, col + 1),
|
||||||
|
# )
|
||||||
|
# else:
|
||||||
|
# tok = "<token>"
|
||||||
|
# r = Range(
|
||||||
|
# Position(row, col - 1),
|
||||||
|
# Position(row, col + 1),
|
||||||
|
# )
|
||||||
|
# yield Diagnostic(
|
||||||
|
# r,
|
||||||
|
# f"change `{tok}(` to `( {tok}` [cism]",
|
||||||
|
# DiagnosticSeverity.Hint,
|
||||||
|
# )
|
||||||
|
|
||||||
|
# def _diagnose_vars(self, doc: TextDocument) -> Generator[Diagnostic, None, None]:
|
||||||
|
|
||||||
def diagnose(self, doc: TextDocument) -> None:
|
def diagnose(self, doc: TextDocument) -> None:
|
||||||
diags: list[Diagnostic] = []
|
diags: list[Diagnostic] = []
|
||||||
|
|
Loading…
Reference in New Issue