Skip to content

Commit

Permalink
Better handle broken configuration (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam committed Oct 26, 2023
1 parent ded0197 commit 2709653
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions extension/client/src/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export default function buildRequestHandlers(client: LanguageClient) {
const instance = getInstance();
if (instance && instance.getConnection()) {
const config = instance.getConfig();
return config.homeDirectory;
if (config) {
return config.homeDirectory;
}
}
})

Expand Down Expand Up @@ -103,13 +105,15 @@ export default function buildRequestHandlers(client: LanguageClient) {
const content = instance?.getContent();
const config = instance?.getConfig()!;

if (includePaths.length === 0) {
includePaths.push(config.homeDirectory);
}
if (instance && content && config) {
if (includePaths.length === 0) {
includePaths.push(config.homeDirectory);
}

const resolvedPath = await content?.streamfileResolve(bases, includePaths);
const resolvedPath = await content?.streamfileResolve(bases, includePaths);

return resolvedPath;
return resolvedPath;
}
});

/**
Expand Down

0 comments on commit 2709653

Please sign in to comment.