Skip to content

Commit

Permalink
overhaul internal class structure (#191)
Browse files Browse the repository at this point in the history
* Refactoring
- class structure
- file structure
  • Loading branch information
fr43nk authored Dec 9, 2024
1 parent 9ac3cc0 commit 5e0682f
Show file tree
Hide file tree
Showing 32 changed files with 761 additions and 974 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
{
"command": "extension.ccVersionTree",
"group": "navigation@108",
"when": "editorTextFocus && !inOutput && vscode-clearcase:enabled && resourcePath not in vscode-clearcase:ViewPrivateObjects && vscode-clearcase:editor == true"
"when": "vscode-clearcase:enabled && resourcePath not in vscode-clearcase:ViewPrivateObjects && vscode-clearcase:editor == true"
}
],
"editor/context": [
Expand Down Expand Up @@ -454,7 +454,7 @@
},
{
"command": "extension.ccOpenResource",
"when": "scmProvider == cc && vscode-clearcase:enabled",
"when": "scmProvider == cc && vscode-clearcase:enabled && resourcePath not in vscode-clearcase:ViewPrivateObjects",
"group": "cc_file"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
TextEditorDecorationType,
window,
} from "vscode";
import { CCConfigHandler } from "./ccConfigHandler";
import { CCConfiguration } from "./ccConfiguration";
import { IDisposable } from "./model";
import { IDisposable } from "../model";
import { Configuration } from "../configuration/configuration";
import { ConfigurationHandler } from "../configuration/configuration-handler";

export class CCAnnotationController implements IDisposable {
export class AnnotationController implements IDisposable {
private mDecorationType: TextEditorDecorationType;
private mIsActive = false;
private mConfiguration: CCConfiguration;
private mConfiguration: Configuration;
private mDisposables: IDisposable[] = [];

constructor(private editor: TextEditor, private configHandler: CCConfigHandler) {
constructor(private editor: TextEditor, private configHandler: ConfigurationHandler) {
this.mDisposables.push(window.onDidChangeActiveTextEditor((editor) => this.onActiveEditorChange(editor)));
this.mDisposables.push(this.configHandler.onDidChangeConfiguration(() => this.onConfigurationChanged()));
const ro: DecorationRenderOptions = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CodeLens, Range, TextDocument } from "vscode";

export class CCAnnotateLens extends CodeLens {
export class AnnotationLens extends CodeLens {
constructor(public document: TextDocument, range: Range) {
super(range);
}
Expand Down
104 changes: 0 additions & 104 deletions src/ccIgnoreHandler.ts

This file was deleted.

4 changes: 4 additions & 0 deletions src/clearcase/clearcase-cleartool-if.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ClearcaseCleartoolIf {
executable(val?: string | undefined): string;
credentials(): string[];
}
34 changes: 34 additions & 0 deletions src/clearcase/clearcase-cleartool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { ClearcaseCleartoolIf } from "./clearcase-cleartool-if";

export class ClearcaseCleartool implements ClearcaseCleartoolIf {
private mUsername: string;
private mPassword: string;
private mAddress: string;
private mExecutable: string;

constructor(u = "", p = "", a = "", e = "") {
this.mAddress = a;
this.mPassword = p;
this.mUsername = u;
this.mExecutable = "";
if (e !== "") {
this.executable(e);
} else {
this.executable("cleartool");
}
}

executable(val?: string | undefined): string {
if (val !== undefined) {
this.mExecutable = val;
}
return this.mExecutable;
}

credentials(): string[] {
if (this.mAddress !== "") {
return ["-lname", this.mUsername, "-password", this.mPassword, "-server", this.mAddress];
}
return [];
}
}
Loading

0 comments on commit 5e0682f

Please sign in to comment.