Skip to content

Commit

Permalink
applying a default before adding it to map
Browse files Browse the repository at this point in the history
  • Loading branch information
diyaayay committed Mar 18, 2024
1 parent 3ff7856 commit e101e78
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions language-server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,15 @@ async function getDocumentSettings(resource) {
return globalSettings;
}

let result = documentSettings.get(resource);
if (!result) {
result = await connection.workspace.getConfiguration({
if (!documentSettings.has(resource)) {
const result = await connection.workspace.getConfiguration({
scopeUri: resource,
section: "jsonSchemaLanguageServer"
});
if (result !== null) {
documentSettings.set(resource, result);
}
documentSettings.set(resource, result ?? globalSettings);
}

return result ?? {};
return documentSettings.get(resource);
}

connection.onDidChangeConfiguration((change) => {
Expand Down

0 comments on commit e101e78

Please sign in to comment.