In validateTextDocument, the settings are read with const effective = config || defaultSettings; followed by const limit = effective.limit; at src/server.ts:168. The config value is the resolved result of getDocumentSettings, which already guarantees a real settings object on every path: the no-configuration branch returns settings at src/server.ts:143, and the configuration branch falls back to defaultSettings inside its own .then at src/server.ts:150. By the time line 168 runs, config can never be null or undefined.
That makes the outer || defaultSettings a fallback that can never fire, and the effective variable just an alias for config. The two lines are equivalent to const limit = config.limit;.
The fix is to drop effective and read config.limit directly. The genuine default handling already lives inside getDocumentSettings, so it should stay there and not be removed.
In
validateTextDocument, the settings are read withconst effective = config || defaultSettings;followed byconst limit = effective.limit;atsrc/server.ts:168. Theconfigvalue is the resolved result ofgetDocumentSettings, which already guarantees a real settings object on every path: the no-configuration branch returnssettingsatsrc/server.ts:143, and the configuration branch falls back todefaultSettingsinside its own.thenatsrc/server.ts:150. By the time line 168 runs,configcan never be null or undefined.That makes the outer
|| defaultSettingsa fallback that can never fire, and theeffectivevariable just an alias forconfig. The two lines are equivalent toconst limit = config.limit;.The fix is to drop
effectiveand readconfig.limitdirectly. The genuine default handling already lives insidegetDocumentSettings, so it should stay there and not be removed.