diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d7384..a8477bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Fix issue [#319](https://github.com/intersystems/language-server/issues/319): Outline shows routine labels that don't appear in the first column - Fix issue [#320](https://github.com/intersystems/language-server/issues/320): Turn routine existence diagnostics on by default - Fix issue [#321](https://github.com/intersystems/language-server/issues/321): Show detailed descriptions for syntax errors +- Fix issue [#322](https://github.com/intersystems/language-server/issues/322): Add setting to disable undefined variable warning diagnostics - Parser changes: - DP-430347: Track variables in routine procedure blocks - DP-430473: Fix variable tracking with embedded SQL in routine procedure blocks diff --git a/README.md b/README.md index 94fd697..9f5fd56 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This is a [LSP](https://microsoft.github.io/language-server-protocol/) compliant - Expand short class names to include packages (off by default) - Code linting for ObjectScript and UDL that checks for the following: - Syntax errors, including for embedded languages. - - References to local variables that are undefined. + - References to local variables that may be undefined. - Classes and routines that don't exist in the database. - Invalid UDL Parameter types. - Mismatches between declared UDL Parameter types and the assigned value. diff --git a/package.json b/package.json index bdb1644..0518c35 100644 --- a/package.json +++ b/package.json @@ -229,6 +229,12 @@ "type": "boolean", "default": true, "markdownDescription": "Controls whether diagnostics are provided when a [SQL reserved word](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_reservedwords) is used in a class or property name of a persistent class." + }, + "intersystems.language-server.diagnostics.undefinedVariables": { + "scope": "resource", + "type": "boolean", + "default": true, + "description": "Controls whether diagnostics are provided when a local variable may be undefined." } } }, diff --git a/server/src/providers/diagnostic.ts b/server/src/providers/diagnostic.ts index d9167a1..78e583b 100644 --- a/server/src/providers/diagnostic.ts +++ b/server/src/providers/diagnostic.ts @@ -276,7 +276,11 @@ export async function onDiagnostics(params: DocumentDiagnosticParams): Promise