Skip to content

Commit

Permalink
[Task IAC-805] Fixed code coverage issues
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Kantchev <[email protected]>
  • Loading branch information
akantchev committed Feb 5, 2024
1 parent eb6090a commit 9b5fee7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/node/vro-language-server/src/server/core/HintLookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class HintLookup implements Disposable {

dispose(): void {
this.logger.debug("Disposing HintLookup")
this.subscriptions.forEach(s => s?.dispose())
this.subscriptions.forEach(s => s && s.dispose())
}

getGlobalActionsPack() {
Expand Down Expand Up @@ -167,10 +167,6 @@ export class HintLookup implements Disposable {
this.load()
}

refreshForWorkspace(workspaceFolder: WorkspaceFolder): void {
this.load(workspaceFolder)
}

private onDidChangeConfiguration(): void {
this.logger.debug("HintLookup.onDidChangeConfiguration()")
this.load()
Expand All @@ -183,6 +179,10 @@ export class HintLookup implements Disposable {
}
}

refreshForWorkspace(workspaceFolder: WorkspaceFolder): void {
this.load(workspaceFolder)
}

//
// Load proto files
//
Expand All @@ -203,15 +203,17 @@ export class HintLookup implements Disposable {
)
}
}

const configsFile = this.environment.resolveHintFile("configs.pb", workspaceFolder)
if (configsFile) {
this.loadProtoInScope([configsFile], workspaceFolder, this.configs, vmw.pscoe.hints.ConfigurationsPack)
}

if (!workspaceFolder) {
// plugins aren't located in workspace folder
const coreApiFile = this.environment.resolveHintFile("core-api.pb", undefined)
const coreApiFile = this.environment.resolveHintFile("core-api.pb")

Check warning on line 214 in packages/node/vro-language-server/src/server/core/HintLookup.ts

View check run for this annotation

Codecov / codecov/patch

packages/node/vro-language-server/src/server/core/HintLookup.ts#L214

Added line #L214 was not covered by tests
const pluginFiles = this.environment.resolvePluginHintFiles()

if (coreApiFile) {
pluginFiles.push(coreApiFile)
}
Expand All @@ -237,6 +239,7 @@ export class HintLookup implements Disposable {
result.push(hintPack)
}
})

if (!scope) {
target.global = result
} else {
Expand Down

0 comments on commit 9b5fee7

Please sign in to comment.