|
44 | 44 | "views": { |
45 | 45 | "codacy-main": [ |
46 | 46 | { |
47 | | - "id": "codacy:login", |
48 | | - "name": "Connect to Codacy", |
49 | | - "icon": "resources/icons/codacy-logo.svg", |
50 | | - "when": "Codacy:RepositoryManagerStateContext == NeedsAuthentication" |
| 47 | + "id": "codacy:statuses", |
| 48 | + "name": "Status", |
| 49 | + "icon": "$(library)", |
| 50 | + "when": "!codacy:hasProject || Codacy:RepositoryManagerStateContext == NeedsAuthentication ||Codacy:RepositoryManagerStateContext == NoRepository || Codacy:RepositoryManagerStateContext == NoRemote || Codacy:RepositoryManagerStateContext == Initializing || (Codacy:RepositoryManagerStateContext == Loaded && Codacy:PullRequestStateContext == NoPullRequest)", |
| 51 | + "initialSize": 1, |
| 52 | + "collapsed": false |
51 | 53 | }, |
52 | 54 | { |
53 | 55 | "id": "codacy:cli", |
54 | 56 | "name": "Codacy CLI", |
55 | | - "when": "!codacy:cliInstalled && codacy:canInstallCLI", |
| 57 | + "when": "codacy:hasProject && !codacy:cliInstalled && codacy:canInstallCLI", |
| 58 | + "icon": "$(gear)", |
| 59 | + "initialSize": 2 |
| 60 | + }, |
| 61 | + { |
| 62 | + "id": "codacy:mcp", |
| 63 | + "name": "Codacy MCP Server", |
| 64 | + "when": "codacy:hasProject && codacy:supportsMCP", |
56 | 65 | "icon": "$(gear)", |
57 | 66 | "initialSize": 2 |
58 | 67 | }, |
59 | 68 | { |
60 | 69 | "id": "codacy:prSummary", |
61 | 70 | "name": "Pull request", |
62 | | - "when": "Codacy:RepositoryManagerStateContext == Loaded && Codacy:PullRequestStateContext == Loaded", |
| 71 | + "when": "codacy:hasProject && codacy:isGitRepository && Codacy:RepositoryManagerStateContext == Loaded && Codacy:PullRequestStateContext == Loaded", |
63 | 72 | "icon": "$(git-pull-request)", |
64 | 73 | "initialSize": 3 |
65 | 74 | }, |
66 | 75 | { |
67 | 76 | "id": "codacy:pullRequests", |
68 | 77 | "name": "Open pull requests", |
69 | | - "when": "Codacy:RepositoryManagerStateContext == Loaded", |
| 78 | + "when": "codacy:hasProject && codacy:isGitRepository && Codacy:RepositoryManagerStateContext == Loaded", |
70 | 79 | "icon": "$(git-pull-request)", |
71 | 80 | "initialSize": 3 |
72 | 81 | }, |
73 | 82 | { |
74 | 83 | "id": "codacy:branchIssues", |
75 | 84 | "name": "Issue Browser", |
76 | | - "when": "Codacy:RepositoryManagerStateContext == Loaded && Codacy:BranchStateContext == OnAnalysedBranch", |
| 85 | + "when": "codacy:hasProject && codacy:isGitRepository && Codacy:RepositoryManagerStateContext == Loaded && Codacy:BranchStateContext == OnAnalysedBranch", |
77 | 86 | "icon": "$(bug)", |
78 | 87 | "initialSize": 3 |
79 | | - }, |
80 | | - { |
81 | | - "id": "codacy:statuses", |
82 | | - "name": "Status", |
83 | | - "icon": "$(library)", |
84 | | - "when": "Codacy:RepositoryManagerStateContext == NoRepository || Codacy:RepositoryManagerStateContext == NoRemote || Codacy:RepositoryManagerStateContext == Initializing || (Codacy:RepositoryManagerStateContext == Loaded && Codacy:PullRequestStateContext == NoPullRequest)", |
85 | | - "initialSize": 1 |
86 | | - }, |
87 | | - { |
88 | | - "id": "codacy:mcp", |
89 | | - "name": "Codacy MCP Server", |
90 | | - "when": "codacy:supportsMCP", |
91 | | - "icon": "$(gear)", |
92 | | - "initialSize": 2 |
93 | 88 | } |
94 | 89 | ] |
95 | 90 | }, |
96 | 91 | "viewsWelcome": [ |
97 | 92 | { |
98 | | - "view": "codacy:login", |
99 | | - "contents": "You have not yet signed in with Codacy\n[Connect to Codacy](command:codacy.signIn)", |
100 | | - "when": "Codacy:RepositoryManagerStateContext == NeedsAuthentication" |
| 93 | + "view": "codacy:statuses", |
| 94 | + "contents": "You are not connected to Codacy.\n[Connect to Codacy](command:codacy.signIn)", |
| 95 | + "when": "codacy:hasProject && Codacy:RepositoryManagerStateContext == NeedsAuthentication" |
101 | 96 | }, |
102 | 97 | { |
103 | | - "view": "codacy:cli", |
104 | | - "contents": "Install Codacy CLI to analyze your code locally\n[Install Codacy CLI](command:codacy.installCLI)", |
105 | | - "when": "!codacy:cliInstalled && codacy:canInstallCLI && !codacy:cliInstalling" |
| 98 | + "view": "codacy:statuses", |
| 99 | + "contents": "There is no project opened. Open a project to use Codacy extension.", |
| 100 | + "when": "!codacy:hasProject" |
106 | 101 | }, |
107 | 102 | { |
108 | | - "view": "codacy:cli", |
109 | | - "contents": "$(loading~spin) Installing Codacy CLI...", |
110 | | - "when": "!codacy:cliInstalled && codacy:canInstallCLI && codacy:cliInstalling" |
| 103 | + "view": "codacy:statuses", |
| 104 | + "contents": "This project isn't a Git repository. To connect it to Codacy, initialize a Git repository first.", |
| 105 | + "when": "!codacy:isGitRepository && codacy:hasProject" |
111 | 106 | }, |
112 | 107 | { |
113 | 108 | "view": "codacy:statuses", |
114 | | - "contents": "No repositories open.", |
115 | | - "when": "Codacy:RepositoryManagerStateContext == NoRepository" |
| 109 | + "contents": "Failed to find repository in Codacy.", |
| 110 | + "when": "codacy:hasProject && codacy:isGitRepository && Codacy:RepositoryManagerStateContext == NoRepository" |
116 | 111 | }, |
117 | 112 | { |
118 | 113 | "view": "codacy:statuses", |
119 | 114 | "contents": "No remote repositories configured.", |
120 | | - "when": "Codacy:RepositoryManagerStateContext == NoRemote" |
| 115 | + "when": "codacy:hasProject && codacy:isGitRepository && Codacy:RepositoryManagerStateContext == NoRemote" |
121 | 116 | }, |
122 | 117 | { |
123 | 118 | "view": "codacy:statuses", |
124 | 119 | "contents": "Codacy is initializing...", |
125 | | - "when": "Codacy:RepositoryManagerStateContext == Initializing" |
| 120 | + "when": "codacy:hasProject && codacy:isGitRepository && Codacy:RepositoryManagerStateContext == Initializing" |
126 | 121 | }, |
127 | 122 | { |
128 | 123 | "view": "codacy:statuses", |
129 | 124 | "contents": "No open pull request found.\n[Try again](command:codacy.pr.load)", |
130 | | - "when": "Codacy:RepositoryManagerStateContext == Loaded && Codacy:PullRequestStateContext == NoPullRequest" |
| 125 | + "when": "codacy:hasProject && codacy:isGitRepository && Codacy:RepositoryManagerStateContext == Loaded && Codacy:PullRequestStateContext == NoPullRequest" |
| 126 | + }, |
| 127 | + { |
| 128 | + "view": "codacy:cli", |
| 129 | + "contents": "Install Codacy CLI to analyze your code locally\n[Install Codacy CLI](command:codacy.installCLI)", |
| 130 | + "when": "!codacy:cliInstalled && codacy:canInstallCLI && !codacy:cliInstalling" |
| 131 | + }, |
| 132 | + { |
| 133 | + "view": "codacy:cli", |
| 134 | + "contents": "$(loading~spin) Installing Codacy CLI...", |
| 135 | + "when": "!codacy:cliInstalled && codacy:canInstallCLI && codacy:cliInstalling" |
131 | 136 | }, |
132 | 137 | { |
133 | 138 | "view": "codacy:mcp", |
|
0 commit comments