Skip to content

Commit

Permalink
Remove some useless safe navigators
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeChab committed Oct 31, 2023
1 parent 80a91c7 commit f58d3b8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions server/src/Providers/DiagnosticsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class DiagnoticsProvider extends Provider {

if (!this.server.configLoaded || !document) {
if (!this.server.documentsWaitingForPublish.includes(uri)) {
this.server.documentsWaitingForPublish?.push(uri);
this.server.documentsWaitingForPublish.push(uri);
}
return resolve(true);
}
Expand All @@ -88,7 +88,7 @@ export default class DiagnoticsProvider extends Provider {
const files: FilesDiagnostics = { [document.uri]: [] };
const uris: string[] = [];
children.forEach((child) => {
const fileUri = this.server.documentsCollection?.get(child)?.uri;
const fileUri = this.server.documentsCollection.get(child)?.uri;
if (fileUri) {
files[fileUri] = [];
uris.push(fileUri);
Expand Down Expand Up @@ -168,13 +168,9 @@ export default class DiagnoticsProvider extends Provider {

if (line.includes("Could not locate")) {
if (Boolean(nwnHome) || Boolean(nwnInstallation)) {
return this.server.logger.error(
"Unable to resolve provided Neverwinter Nights home and/or installation directories. Ensure the paths are valid in the extension settings.",
);
return this.server.logger.error("Unable to resolve provided Neverwinter Nights home and/or installation directories. Ensure the paths are valid in the extension settings.");
} else {
return this.server.logger.error(
"Unable to automatically resolve Neverwinter Nights home and/or installation directories.",
);
return this.server.logger.error("Unable to automatically resolve Neverwinter Nights home and/or installation directories.");
}
}
});
Expand Down

0 comments on commit f58d3b8

Please sign in to comment.