Skip to content

Commit 9fece83

Browse files
committed
WIP
1 parent 8091770 commit 9fece83

15 files changed

Lines changed: 116 additions & 338 deletions

package-lock.json

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"deepcode.uploadApproved": {
6262
"type": "boolean",
6363
"default": false,
64-
"markdownDescription": "User consent for code upload to `#deepcode.url#`",
64+
"markdownDescription": "User consent for code upload to `#deepcode.url#` in agreement with our [terms and conditions](https://www.deepcode.ai/tc?utm_source=vsc)",
6565
"scope": "window"
6666
},
6767
"deepcode.yesCrashReport": {
@@ -131,7 +131,7 @@
131131
},
132132
{
133133
"view": "deepcode.views.error",
134-
"contents": "DeepCode has encountered a problem. Please restart the extension: \n[Restart](command:deepcode.start 'Restart DeepCode')\nIf the error persists, please check your [settings](command:deepcode.settings) and [contact us](https://www.deepcode.ai/feedback?select=2)!",
134+
"contents": "DeepCode has encountered a problem. Please restart the extension: \n[Restart](command:deepcode.start 'Restart DeepCode')\nIf the error persists, please check your [settings](command:deepcode.settings) and [contact us](https://www.deepcode.ai/feedback?select=2?utm_source=vsc)!",
135135
"when": "deepcode:error != 'transient'"
136136
},
137137
{
@@ -140,24 +140,18 @@
140140
},
141141
{
142142
"view": "deepcode.views.tc",
143-
"contents": "Thanks for connecting with DeepCode. ✅\n 👉 You are almost set 🤗, let's confirm and start the remote analysis - feel free to check out our [terms and conditions](https://www.deepcode.ai/tc?utm_source=vsc) if you are into this.\n[Accept code upload](command:deepcode.approveUpload 'Upload code to DeepCode')\nYou can always change it later in the [settings](command:deepcode.settings)!"
143+
"contents": "Thanks for connecting with DeepCode. ✅\n 👉 You are almost set 🤗. DeepCode's proprietary AI model is analysing the code remotely on DeepCode's servers. Let's confirm you know this and start the remote analysis of this workspace - feel free to check out our [terms](https://www.deepcode.ai/tc?utm_source=vsc).\n[Accept and start analysing](command:deepcode.approve 'Upload code to DeepCode')\nYou can always change this later in the [configuration panel](command:deepcode.settings)."
144144
},
145145
{
146146
"view": "deepcode.views.progress",
147147
"contents": "Analysis in progress"
148148
},
149149
{
150150
"view": "deepcode.views.analysis",
151-
"contents": "DeepCode analyzed your code and found no issue!"
151+
"contents": "DeepCode analyzed your code and found no issue! 🎉"
152152
}
153153
],
154154
"menus": {
155-
"commandPalette": [
156-
{
157-
"command": "deepcode.start",
158-
"when": "deepcode:loggedIn"
159-
}
160-
],
161155
"view/title": [
162156
{
163157
"command": "deepcode.settings",
@@ -169,6 +163,16 @@
169163
"when": "view == deepcode.views.analysis",
170164
"group": "navigation"
171165
}
166+
],
167+
"commandPalette": [
168+
{
169+
"command": "deepcode.approve",
170+
"when": "false"
171+
},
172+
{
173+
"command": "deepcode.login",
174+
"when": "!deepcode:loggedIn"
175+
}
172176
]
173177
},
174178
"commands": [
@@ -188,7 +192,7 @@
188192
},
189193
{
190194
"command": "deepcode.approve",
191-
"title": "DeepCode approve upload and remote analysis"
195+
"title": "DeepCode approve upload and start analysis"
192196
}
193197
]
194198
},
@@ -218,10 +222,12 @@
218222
"nock": "^12.0.3"
219223
},
220224
"dependencies": {
225+
"@deepcode/tsc": "^1.3.0",
226+
"@types/lodash": "^4.14.159",
221227
"@types/mz": "^2.7.1",
222228
"ignore": "^5.1.8",
229+
"lodash": "^4.17.19",
223230
"mz": "^2.7.0",
224-
"open": "^7.0.4",
225-
"@deepcode/tsc": "^1.3.0"
231+
"open": "^7.0.4"
226232
}
227233
}

src/deepcode/constants/commands.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// vscode commands used in extension work
2-
export const VSCODE_GO_TO_SETTINGS_COMMAND = "_extensions.manage";
2+
// old "_extensions.manage" is deprecated;
3+
export const VSCODE_GO_TO_SETTINGS_COMMAND = "workbench.action.openSettings";
34
export const VSCODE_ADD_COMMENT_COMMAND = "editor.action.addCommentLine";
45

56
// custom depcode commands

src/deepcode/constants/general.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Changing this requires changing display name in package.json.
22
export const DEEPCODE_NAME = "DeepCode";
3+
export const DEEPCODE_EXTENSION_NAME = "deepcode";
34
export const ALLOWED_PAYLOAD_SIZE = 1024 * 1024 * 4; // max payload size of 4MB in bytes
45
export const MAX_CONNECTION_RETRIES = 5; // max number of automatic retries before showing an error
56
export const IDE_NAME = "vscode";

src/deepcode/lib/analyzer/DeepCodeAnalyzer.ts

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
import { DEEPCODE_NAME } from "../../constants/general";
1313
import { TELEMETRY_EVENTS } from "../../constants/telemetry";
1414
import { ISSUES_MARKERS_DECORATION_TYPE } from "../../constants/analysis";
15-
import { deepCodeMessages } from "../../messages/deepCodeMessages";
1615
import { errorsLogs } from "../../messages/errorsServerLogMessages";
1716

1817
import { DisposableCodeActionsProvider } from "../deepCodeProviders/codeActionsProvider/DeepCodeIssuesActionsProvider";
@@ -23,17 +22,14 @@ class DeepCodeAnalyzer implements DeepCode.AnalyzerInterface {
2322
[key: number]: { name: vscode.DiagnosticSeverity; show: boolean };
2423
};
2524
private extension: DeepCode.ExtensionInterface | undefined;
26-
private analysisProgressValue: number = 1; // default value for progress to make it visible from start
27-
private progress = vscode.window.withProgress;
28-
private analysisInProgress: boolean = false;
2925
private issueHoverProvider: vscode.Disposable | undefined;
3026
private ignoreActionsProvider: vscode.Disposable | undefined;
31-
private analysisQueueCount: number = 0;
3227
private issuesMarkersdecorationType:
3328
| vscode.TextEditorDecorationType
3429
| undefined;
3530
public deepcodeReview: vscode.DiagnosticCollection | undefined;
3631
public analysisResultsCollection: DeepCode.AnalysisResultsCollectionInterface;
32+
3733
public constructor() {
3834
this.SEVERITIES = createDeepCodeSeveritiesMap();
3935
this.deepcodeReview = vscode.languages.createDiagnosticCollection(DEEPCODE_NAME);
@@ -233,39 +229,6 @@ class DeepCodeAnalyzer implements DeepCode.AnalyzerInterface {
233229
}
234230
}
235231

236-
// private async processFailedReviewCodeResults(
237-
// extension: DeepCode.ExtensionInterface,
238-
// path: string
239-
// ): Promise<void> {
240-
// const { bundleId } = extension.remoteBundles[path];
241-
// extension.processError(new Error(), {
242-
// message: errorsLogs.failedStatusOfAnalysis,
243-
// bundleId
244-
// });
245-
// const workspace = vscode.workspace.workspaceFolders
246-
// ? vscode.workspace.workspaceFolders.find(folder => {
247-
// return folder.uri.fsPath === path;
248-
// })
249-
// : { name: "" };
250-
// const workspaceName = workspace ? workspace.name : "";
251-
// const {
252-
// msg: analysisErrorMsg,
253-
// button: analysisErrorBtn
254-
// } = deepCodeMessages.codeReviewFailed;
255-
// const analysisErrorButton:
256-
// | string
257-
// | undefined = await vscode.window.showErrorMessage(
258-
// analysisErrorMsg(workspaceName),
259-
// analysisErrorBtn
260-
// );
261-
// if (analysisErrorButton === analysisErrorBtn) {
262-
// // if analysis status === FAILED,
263-
// // we create new bundle, send it, check it and trigger new review
264-
// await extension.updateHashesBundles(path);
265-
// await extension.performBundlesActions(path);
266-
// }
267-
// }
268-
269232
public async removeReviewResults(workspacePath: string): Promise<void> {
270233
await delete this.analysisResultsCollection[workspacePath];
271234
await this.createReviewResults();

src/deepcode/lib/errorHandler/DeepCodeErrorHandler.ts

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)