summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CodeParserController.ts5
-rw-r--r--src/Config.ts12
-rw-r--r--src/Lang/Python/PythonDocGen.ts8
-rw-r--r--src/Lang/Python/PythonParser.ts17
4 files changed, 42 insertions, 0 deletions
diff --git a/src/CodeParserController.ts b/src/CodeParserController.ts
index 8be7034..1dfc5c4 100644
--- a/src/CodeParserController.ts
+++ b/src/CodeParserController.ts
@@ -11,6 +11,8 @@ import {
import CodeParser from "./Common/ICodeParser";
import { Config } from "./Config";
import CppParser from "./Lang/Cpp/CppParser";
+import PythonParser from "./Lang/Python/PythonParser";
+
/**
*
* Checks if the event matches the specified guidelines and if a parser exists for this language
@@ -116,6 +118,9 @@ export default class CodeParserController {
case "cpp":
parser = new CppParser(this.cfg);
break;
+ case "python":
+ parser = new PythonParser(this.cfg);
+ break;
default:
// tslint:disable-next-line:no-console
console.log("No comments can be generated for language: " + lang);
diff --git a/src/Config.ts b/src/Config.ts
index b33aff2..55a22b5 100644
--- a/src/Config.ts
+++ b/src/Config.ts
@@ -26,6 +26,14 @@ class Cpp {
public dtorText: string = "Destroy the {name} object";
}
+class Python {
+ public static getConfiguration() {
+ return workspace.getConfiguration("doxdocgen.python");
+ }
+
+ public triggerSequence: string = '"""';
+}
+
class File {
public static getConfiguration() {
return workspace.getConfiguration("doxdocgen.file");
@@ -75,6 +83,8 @@ export class Config {
values.Cpp.ctorText = Cpp.getConfiguration().get<string>("ctorText", values.Cpp.ctorText);
values.Cpp.dtorText = Cpp.getConfiguration().get<string>("dtorText", values.Cpp.dtorText);
+ values.Python.triggerSequence = Python.getConfiguration().get<string>("triggerSequence", values.Python.triggerSequence);
+
values.File.fileTemplate = File.getConfiguration().get<string>("fileTemplate", values.File.fileTemplate);
values.File.versionTag = File.getConfiguration().get<string>("versionTag", values.File.versionTag);
values.File.copyrightTag = File.getConfiguration().get<string[]>("copyrightTag", values.File.copyrightTag);
@@ -110,12 +120,14 @@ export class Config {
public C: C;
public Cpp: Cpp;
+ public Python: Python;
public File: File;
public Generic: Generic;
constructor() {
this.C = new C();
this.Cpp = new Cpp();
+ this.Python = new Python();
this.File = new File();
this.Generic = new Generic();
}
diff --git a/src/Lang/Python/PythonDocGen.ts b/src/Lang/Python/PythonDocGen.ts
new file mode 100644
index 0000000..4b90f86
--- /dev/null
+++ b/src/Lang/Python/PythonDocGen.ts
@@ -0,0 +1,8 @@
+import { Range } from "vscode";
+import { IDocGen } from "../../Common/IDocGen";
+
+export class PythonDocGen implements IDocGen {
+ public GenerateDoc(rangeToReplace: Range) {
+ throw new Error("Method not implemented.");
+ }
+}
diff --git a/src/Lang/Python/PythonParser.ts b/src/Lang/Python/PythonParser.ts
new file mode 100644
index 0000000..2d26ed8
--- /dev/null
+++ b/src/Lang/Python/PythonParser.ts
@@ -0,0 +1,17 @@
+import { TextEditor } from "vscode";
+import ICodeParser from "../../Common/ICodeParser";
+import { IDocGen } from "../../Common/IDocGen";
+import { Config } from "../../Config";
+
+export default class CppParser implements ICodeParser {
+
+ protected readonly cfg: Config;
+
+ constructor(cfg: Config) {
+ this.cfg = cfg;
+ }
+
+ public Parse(activeEditor: TextEditor): IDocGen {
+ throw new Error("Method not implemented.");
+ }
+}