Skip to content

Commit

Permalink
chore: Fixed hasLockFile icon behavior. (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
kadirkaang authored Sep 6, 2024
1 parent dc86674 commit 9207d78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vscode/src/core/Language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ function setLanguageConfig(language: Language, config: string, filename: string,
CurrentEnvironment = OCVenv;
if (env.isTelemetryEnabled)
sendTelemetry({FileName: filename})
if (isLockFileEnabled !== undefined)
if (isLockFileEnabled !== undefined) {
commands.executeCommand("setContext", "dependi.hasLockFile", false);
commands.executeCommand("setContext", "dependi.isEnableLockParsing", isLockFileEnabled);
}
return language;
}
2 changes: 2 additions & 0 deletions vscode/src/core/parsers/JsonParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export class JsonParser {
const LockFileParser = this.lockParser;
item = LockFileParser.parse(fileContent, item);
commands.executeCommand("setContext", "dependi.hasLockFile", true);
} else {
commands.executeCommand("setContext", "dependi.hasLockFile", false);
}
} catch (err) {
console.error(err);
Expand Down
2 changes: 2 additions & 0 deletions vscode/src/core/parsers/TomlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ function parseLockFile(item: Item[]): Item[] {
const LockFileParser = new TomlLockFileParser();
item = LockFileParser.parse(fileContent, item);
commands.executeCommand("setContext", "dependi.hasLockFile", true);
} else {
commands.executeCommand("setContext", "dependi.hasLockFile", false);
}
} catch (err) {
console.error(err);
Expand Down

0 comments on commit 9207d78

Please sign in to comment.