Skip to content

Commit

Permalink
removed hack for semantic error, fixed after rebasing and assignment …
Browse files Browse the repository at this point in the history
…of global settings
  • Loading branch information
diyaayay committed Mar 18, 2024
1 parent e101e78 commit d6b9d03
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions language-server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ connection.onDidChangeConfiguration((change) => {
if (hasConfigurationCapability) {
documentSettings.clear();
} else {
globalSettings = change.settings.jsonSchemaLanguageServer || globalSettings;
globalSettings = change.settings.jsonSchemaLanguageServer ?? globalSettings;
}

validateWorkspace();
Expand Down Expand Up @@ -303,13 +303,7 @@ const getTokenBuilder = (uri) => {
const buildTokens = (builder, document, settings) => {
const instance = JsoncInstance.fromTextDocument(document);
const $schema = instance.get("#/$schema");
let dialectUri;
try {
dialectUri = $schema?.value() ?? settings.defaultDialect;
} catch (error) {
// SKIP
}

const dialectUri = $schema.value ?? settings.defaultDialect;
const schemaResources = decomposeSchemaDocument(instance, dialectUri);
for (const { keywordInstance, tokenType, tokenModifier } of getSemanticTokens(schemaResources)) {
const startPosition = keywordInstance.startPosition();
Expand Down

0 comments on commit d6b9d03

Please sign in to comment.