feat(editor): mark syntax errors in files no language server checks (#1087)

Without a running language server (none configured for the language, or not installed, stopped or crashed), the editor showed no syntax errors at all, though the built-in parser already finds them. The editor now reports the parser's errors for such files, checked again after edits and when a language server starts or stops; while a server runs for the language it reports syntax errors itself. SQL is left to the database support. The check is the built-in Syntax errors inspection.

Fixes #824
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-04 03:02:32 +08:00
1 джерело 0dffad814a
коміт 2ba07341c2
5 files changed
+208 -1

No files matched your search

+12
Переглянути файл
@@ -223,6 +223,9 @@ export interface BuiltinInspection {
export const SPELLING_PRODUCER = "spelling";
export const SPELLING_INSPECTION = "builtin:spelling";
/** Syntax errors of the built-in parser, for files no language server checks. */
export const SYNTAX_ERRORS_PRODUCER = "syntax";
export const DEPENDENCY_PRODUCER = "dependency-versions";
export const DEPENDENCY_INSPECTION = "builtin:dependency-versions";
@@ -256,6 +259,15 @@ export const BUILTIN_INSPECTIONS: readonly BuiltinInspection[] = [
description: "Reports newer crate versions that Cargo.toml requirements do not already allow.",
defaultLevel: "weakWarning",
},
{
id: "builtin:syntax",
producer: SYNTAX_ERRORS_PRODUCER,
name: "Syntax errors",
group: "General",
description:
"Reports code the built-in parser cannot read, in files no language server checks (none is configured for the language, or it is not installed, stopped or crashed). A running language server reports syntax errors itself.",
defaultLevel: "error",
},
{
id: "builtin:file-references",
producer: "file-references",
+6 -1
Переглянути файл
@@ -5779,5 +5779,10 @@
"File icon theme": "文件图标主题",
"Plugin not enabled": "插件未启用",
"Problems the {plugin} plugin reports. Severity \"As reported\" keeps the level the plugin assigns; a code below can override it.": "{plugin} 插件报告的问题。严重性“按报告”保留插件分配的级别;下方的代码可以覆盖它。",
"The plugin system is a preview: its API and the plugins may still change.": "插件系统目前是预览版:API 和插件都可能还会变化。"
"The plugin system is a preview: its API and the plugins may still change.": "插件系统目前是预览版:API 和插件都可能还会变化。",
"'{expected}' expected": "缺少 '{expected}'",
"Unexpected token": "意外的标记",
"Syntax": "语法",
"Syntax errors": "语法错误",
"Reports code the built-in parser cannot read, in files no language server checks (none is configured for the language, or it is not installed, stopped or crashed). A running language server reports syntax errors itself.": "报告内置解析器无法解析的代码,仅针对没有语言服务器检查的文件(该语言未配置语言服务器,或未安装、已停止、已崩溃)。语言服务器运行时由它自己报告语法错误。"
}