diff options
| -rw-r--r-- | src/CodeParser/CParser/CParser.ts | 44 | ||||
| -rw-r--r-- | src/CodeParser/CParser/Token.ts | 2 | ||||
| -rw-r--r-- | src/test/Attributes.test.ts | 49 | ||||
| -rw-r--r-- | src/test/FunctionPointer.test.ts (renamed from src/test/functionPointer.test.ts) | 16 | ||||
| -rw-r--r-- | src/test/Operators.test.ts | 38 | ||||
| -rw-r--r-- | src/test/ReturnTypes.test.ts | 99 | ||||
| -rw-r--r-- | src/test/Templates.test.ts | 44 | ||||
| -rw-r--r-- | src/test/TrailingReturns.test.ts | 39 | ||||
| -rw-r--r-- | src/test/Variadic.test.ts | 38 | ||||
| -rw-r--r-- | src/test/simpleReturn.test.ts | 79 | ||||
| -rw-r--r-- | src/test/tools/MockDocument.ts (renamed from src/test/MockDocument.ts) | 0 | ||||
| -rw-r--r-- | src/test/tools/MockEditor.ts (renamed from src/test/MockEditor.ts) | 0 | ||||
| -rw-r--r-- | src/test/tools/MockLine.ts (renamed from src/test/MockLine.ts) | 0 | ||||
| -rw-r--r-- | src/test/tools/MockPosition.ts (renamed from src/test/MockPosition.ts) | 0 | ||||
| -rw-r--r-- | src/test/tools/MockSelection.ts (renamed from src/test/MockSelection.ts) | 0 | ||||
| -rw-r--r-- | src/test/tools/MockTextEditorEdit.ts (renamed from src/test/MockTextEditorEdit.ts) | 0 | ||||
| -rw-r--r-- | src/test/tools/TestSetup.ts (renamed from src/test/TestSetup.ts) | 12 |
17 files changed, 347 insertions, 113 deletions
diff --git a/src/CodeParser/CParser/CParser.ts b/src/CodeParser/CParser/CParser.ts index 3203b40..34ffba4 100644 --- a/src/CodeParser/CParser/CParser.ts +++ b/src/CodeParser/CParser/CParser.ts @@ -22,7 +22,7 @@ export default class CParser implements ICodeParser { private typeKeywords: string[]; private stripKeywords: string[]; private keywords: string[]; - private noexcepts: string[]; + private specifiers: string[]; private lexerVocabulary; constructor() { @@ -33,6 +33,7 @@ export default class CParser implements ICodeParser { ]; this.stripKeywords = [ + "final", "static", "inline", "friend", @@ -44,9 +45,10 @@ export default class CParser implements ICodeParser { "typename", ]; - this.noexcepts = [ + this.specifiers = [ "noexcept", "throw", + "alignas", ]; // Non type keywords will be stripped from the final return type. @@ -85,36 +87,36 @@ export default class CParser implements ICodeParser { return startEndOffset[1] === 0 ? undefined : x.slice(0, startEndOffset[1]); }, Ellipsis: (x: string): string => (x.match("^\\.\\.\\.") || [])[0], - Noexcept: (x: string): string => { - const foundIndex: number = this.noexcepts + OpenParenthesis: (x: string): string => (x.match("^\\(") || [])[0], + Pointer: (x: string): string => (x.match("^\\*") || [])[0], + Reference: (x: string): string => (x.match("^&") || [])[0], + Specifier: (x: string): string => { + const foundIndex: number = this.specifiers .findIndex((n: string) => x.startsWith(n) === true); if (foundIndex === -1) { return undefined; } - if (x.slice(this.noexcepts[foundIndex].length).trim().startsWith("(") === false) { - return x.slice(0, this.noexcepts[foundIndex].length); + if (x.slice(this.specifiers[foundIndex].length).trim().startsWith("(") === false) { + return x.slice(0, this.specifiers[foundIndex].length); } const startEndOffset: number[] = this.GetSubExprStartEnd(x, 0, "(", ")"); return startEndOffset[1] === 0 ? undefined : x.slice(0, startEndOffset[1]); }, - OpenParenthesis: (x: string): string => (x.match("^\\(") || [])[0], - Pointer: (x: string): string => (x.match("^\\*") || [])[0], - Reference: (x: string): string => (x.match("^&") || [])[0], Symbol: (x: string): string => { // Handle access specifiers since they aren't really symbols. if (x.startsWith("public:") || x.startsWith("protected:") || x.startsWith("private:")) { return undefined; } - // Handle noexcept and throw since they aren't normal symbols. - const noExceptFound: number = this.noexcepts + // Handle specifiers + const specifierFound: number = this.specifiers .findIndex((n: string) => x.startsWith(n) === true); - if (noExceptFound !== -1) { + if (specifierFound !== -1) { return undefined; } @@ -156,10 +158,10 @@ export default class CParser implements ICodeParser { break; } - symbol += reMatch.trim(); + symbol += reMatch; } - return symbol.trim(); + return symbol.replace(/\s+$/, ""); }, }; } @@ -348,11 +350,15 @@ export default class CParser implements ICodeParser { tree.nodes = tree.nodes.slice(0, assignmentIndex); } - // Noexcept isn't needed so slice everything after it. - const noexcept = tree.nodes - .findIndex((n) => n instanceof Token && n.Type === TokenType.Noexcept); - if (noexcept !== -1) { - tree.nodes = tree.nodes.slice(0, noexcept); + // Specifiers aren't needed so remove them. + while (true) { + const specifierIndex = tree.nodes + .findIndex((n) => n instanceof Token && n.Type === TokenType.Specifier); + if (specifierIndex !== -1) { + tree.nodes.splice(specifierIndex, 1); + } else { + break; + } } return tree; diff --git a/src/CodeParser/CParser/Token.ts b/src/CodeParser/CParser/Token.ts index c9d3065..0cbd412 100644 --- a/src/CodeParser/CParser/Token.ts +++ b/src/CodeParser/CParser/Token.ts @@ -13,7 +13,7 @@ export enum TokenType { CommentLine, Ellipsis, Attribute, - Noexcept, + Specifier, } export class Token { diff --git a/src/test/Attributes.test.ts b/src/test/Attributes.test.ts new file mode 100644 index 0000000..680694a --- /dev/null +++ b/src/test/Attributes.test.ts @@ -0,0 +1,49 @@ +// +// Note: This example test is leveraging the Mocha test framework. +// Please refer to their documentation on https://mochajs.org/ for help. +// + +// The module 'assert' provides assertion methods from node +import * as assert from "assert"; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from "vscode"; +import TestSetup from "./tools/TestSetup"; + +// Defines a Mocha test suite to group tests of similar kind together +suite("Attributes Tests", () => { + const testSetup: TestSetup = new TestSetup("void foo();"); + + // Tests + test("Attributes on parameter", () => { + const result = testSetup.SetLine("int foo([[maybe_unused]] int a, [[maybe_unused]]double& b);").GetResult(); + assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n * @return int \n */", result); + }); + + test("Attributes on function", () => { + const result = testSetup.SetLine("[[nodiscard]] int foo(int a, double& b);").GetResult(); + assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n * @return int \n */", result); + }); + + test("Multiple attributes on parameter", () => { + const result = testSetup.SetLine("int foo([[maybe_unused]] [[carries_dependency]]" + + " int a, double& b);").GetResult(); + assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n * @return int \n */", result); + }); + + test("Multiple attributes on function", () => { + const result = testSetup.SetLine("[[nodiscard]][[deprecated(\"old\")]] int foo(int a, double& b);").GetResult(); + assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n * @return int \n */", result); + }); + + test("Specifier and attribute on class", () => { + const result = testSetup.SetLine("class [[nodiscard]] alignas(8) Matrix {").GetResult(); + assert.equal("/**\n * @brief \n * \n */", result); + }); + + test("Specifier and attribute on struct", () => { + const result = testSetup.SetLine("struct [[nodiscard]] alignas(8) Matrix {").GetResult(); + assert.equal("/**\n * @brief \n * \n */", result); + }); +}); diff --git a/src/test/functionPointer.test.ts b/src/test/FunctionPointer.test.ts index 3b6b857..dd1ead0 100644 --- a/src/test/functionPointer.test.ts +++ b/src/test/FunctionPointer.test.ts @@ -9,34 +9,34 @@ import * as assert from "assert"; // You can import and use all API from the 'vscode' module // as well as import your extension to test it import * as vscode from "vscode"; -import TestSetup from "./TestSetup"; +import TestSetup from "./tools/TestSetup"; // Defines a Mocha test suite to group tests of similar kind together -suite("Function pointer tests", () => { +suite("Function pointer Tests", () => { const testSetup: TestSetup = new TestSetup("void foo();"); // Tests test("function pointer return", () => { - const result = testSetup.SetMethod("int (*idputs(int a, int b))(char *);").GetResult(); + const result = testSetup.SetLine("int (*idputs(int a, int b))(char *);").GetResult(); assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n * @return int(*)(char*) \n */", result); }); test("nested function pointer return", () => { - const result = testSetup.SetMethod("int (*(*(*foo(int a, int b))(int))(double))(float);").GetResult(); + const result = testSetup.SetLine("int (*(*(*foo(int a, int b))(int))(double))(float);").GetResult(); assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n" + " * @return int(*(*(*)(int))(double))(float) \n */", result); }); test("function pointer parameter", () => { - const result = testSetup.SetMethod("int foo(int (*puts)(const char *));").GetResult(); + const result = testSetup.SetLine("int foo(int (*puts)(const char *));").GetResult(); assert.equal("/**\n * @brief \n * \n * @param puts \n * @return int \n */", result); }); - test("struct function pointer return with struct FP parameter", () => { - const result = testSetup.SetMethod("struct foo (*idputs(int (*puts)(const char *), const" + test("struct function pointer return with struct FP parameters and keywords", () => { + const result = testSetup.SetLine("const struct foo (*idputs(int (*puts)(const char *), const" + " struct test(*str)(int *, const struct test(*str2))))(const char *);").GetResult(); assert.equal("/**\n * @brief \n * \n * @param puts \n * @param str " - + "\n * @return struct foo(*)(const char*) \n */", result); + + "\n * @return const struct foo(*)(const char*) \n */", result); }); }); diff --git a/src/test/Operators.test.ts b/src/test/Operators.test.ts new file mode 100644 index 0000000..86c04b2 --- /dev/null +++ b/src/test/Operators.test.ts @@ -0,0 +1,38 @@ +// +// Note: This example test is leveraging the Mocha test framework. +// Please refer to their documentation on https://mochajs.org/ for help. +// + +// The module 'assert' provides assertion methods from node +import * as assert from "assert"; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from "vscode"; +import TestSetup from "./tools/TestSetup"; + +// Defines a Mocha test suite to group tests of similar kind together +suite("Operators Tests", () => { + const testSetup: TestSetup = new TestSetup("void foo();"); + + // Tests + test("", () => { + const result = testSetup.SetLine("").GetResult(); + assert.equal("", result); + }); + + test("", () => { + const result = testSetup.SetLine("").GetResult(); + assert.equal("", result); + }); + + test("", () => { + const result = testSetup.SetLine("").GetResult(); + assert.equal("", result); + }); + + test("", () => { + const result = testSetup.SetLine("").GetResult(); + assert.equal("", result); + }); +}); diff --git a/src/test/ReturnTypes.test.ts b/src/test/ReturnTypes.test.ts new file mode 100644 index 0000000..f38fb1f --- /dev/null +++ b/src/test/ReturnTypes.test.ts @@ -0,0 +1,99 @@ +// +// Note: This example test is leveraging the Mocha test framework. +// Please refer to their documentation on https://mochajs.org/ for help. +// + +// The module 'assert' provides assertion methods from node +import * as assert from "assert"; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from "vscode"; +import TestSetup from "./tools/TestSetup"; + +// Defines a Mocha test suite to group tests of similar kind together +suite("Return type Tests", () => { + + const testSetup: TestSetup = new TestSetup("void foo();"); + + // Tests + test("void return", () => { + const result = testSetup.SetLine("void foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n */", result); + }); + + test("void pointer return", () => { + const result = testSetup.SetLine("void* foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return void* \n */", result); + }); + + test("Reference return", () => { + const result = testSetup.SetLine("int& foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return int& \n */", result); + }); + + test("simple type return", () => { + const result = testSetup.SetLine("int foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return int \n */", result); + }); + + test("bool return type", () => { + const result = testSetup.SetLine("bool foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return true \n * @return false \n */", result); + }); + + test("pointer return type", () => { + const result = testSetup.SetLine("int* foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return int* \n */", result); + }); + + test("bool pointer return type", () => { + const result = testSetup.SetLine("bool* foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return true \n * @return false \n * @return null \n */", result); + }); + + test("Struct pointer return type", () => { + const result = testSetup.SetLine("struct foo* foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return struct foo* \n */", result); + }); + + test("Struct return type", () => { + const result = testSetup.SetLine("struct Bar* foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return struct Bar* \n */", result); + }); + + test("Return type with keywords and noexcept", () => { + const result = testSetup.SetLine("static constexpr inline struct Bar* foo() " + + "const noexcept(false);").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return constexpr struct Bar* \n */", result); + }); + + test("Fundamental return type with modifiers", () => { + let result = testSetup.SetLine("unsigned int foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return unsigned int \n */", result); + + result = testSetup.SetLine("unsigned short int foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return unsigned short int \n */", result); + + result = testSetup.SetLine("signed short foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return signed short \n */", result); + + result = testSetup.SetLine("long foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return long \n */", result); + + result = testSetup.SetLine("unsigned long long int foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return unsigned long long int \n */", result); + + result = testSetup.SetLine("signed foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return signed \n */", result); + + result = testSetup.SetLine("unsigned foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return unsigned \n */", result); + + result = testSetup.SetLine("unsigned char foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return unsigned char \n */", result); + + result = testSetup.SetLine("long double foo();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return long double \n */", result); + }); +}); diff --git a/src/test/Templates.test.ts b/src/test/Templates.test.ts new file mode 100644 index 0000000..d4c0fe6 --- /dev/null +++ b/src/test/Templates.test.ts @@ -0,0 +1,44 @@ +// +// Note: This example test is leveraging the Mocha test framework. +// Please refer to their documentation on https://mochajs.org/ for help. +// + +// The module 'assert' provides assertion methods from node +import * as assert from "assert"; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from "vscode"; +import TestSetup from "./tools/TestSetup"; + +// Defines a Mocha test suite to group tests of similar kind together +suite("Template tests", () => { + const testSetup: TestSetup = new TestSetup("void foo();"); + + // Tests + test("template class", () => { + const result = testSetup.SetLine("template<typename T, std::size_t M, std::size_t N," + + "typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>" + + "class matrix {").GetResult(); + assert.equal("/**\n * @brief \n * \n * @tparam T \n * @tparam M \n * @tparam N \n * " + + "@tparam std::enable_if<std::is_arithmetic<T>::value, T>::type \n */", result); + }); + + test("template function", () => { + const result = testSetup.SetLine("template<typename T, typename S>\nT f(T a, S b);").GetResult(); + assert.equal("/**\n * @brief \n * \n * @tparam T \n * @tparam S \n * @param a \n * " + + "@param b \n * @return T \n */", result); + }); + + test("double template", () => { + const result = testSetup.SetLine("template<typename T>\ntemplate<typename S>\nT f(T a, S b);").GetResult(); + assert.equal("/**\n * @brief \n * \n * @tparam T \n * @tparam S \n * @param a \n * " + + "@param b \n * @return T \n */", result); + }); + + test("template struct", () => { + const result = testSetup.SetLine("template<typename T, std::size_t m, std::size_t n>\n" + + "struct myStruct {").GetResult(); + assert.equal("/**\n * @brief \n * \n * @tparam T \n * @tparam m \n * @tparam n \n */", result); + }); +}); diff --git a/src/test/TrailingReturns.test.ts b/src/test/TrailingReturns.test.ts new file mode 100644 index 0000000..6c182f9 --- /dev/null +++ b/src/test/TrailingReturns.test.ts @@ -0,0 +1,39 @@ +// +// Note: This example test is leveraging the Mocha test framework. +// Please refer to their documentation on https://mochajs.org/ for help. +// + +// The module 'assert' provides assertion methods from node +import * as assert from "assert"; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from "vscode"; +import TestSetup from "./tools/TestSetup"; + +// Defines a Mocha test suite to group tests of similar kind together +suite("Trailing returns tests", () => { + const testSetup: TestSetup = new TestSetup("void foo();"); + + // tests + test("Trailing return", () => { + const result = testSetup.SetLine("auto foo() -> int;").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return int \n */", result); + }); + + test("Trailing return with decltype", () => { + const result = testSetup.SetLine("auto foo(int a, double b) -> decltype(a + b);").GetResult(); + assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n * @return decltype(a + b) \n */", result); + }); + + test("Multiple trailing returns", () => { + const result = testSetup.SetLine("auto foo() -> auto(*)() -> tmp<int>(*)();").GetResult(); + assert.equal("/**\n * @brief \n * \n * @return auto(*)() -> tmp<int>(*)() \n */", result); + }); + + test("Trailing return with keywords", () => { + const result = testSetup.SetLine("auto foo(const int& a, const double* b) const noexcept -> const double&;") + .GetResult(); + assert.equal("/**\n * @brief \n * \n * @param a \n * @param b \n * @return const double& \n */", result); + }); +}); diff --git a/src/test/Variadic.test.ts b/src/test/Variadic.test.ts new file mode 100644 index 0000000..2ded458 --- /dev/null +++ b/src/test/Variadic.test.ts @@ -0,0 +1,38 @@ +// +// Note: This example test is leveraging the Mocha test framework. +// Please refer to their documentation on https://mochajs.org/ for help. +// + +// The module 'assert' provides assertion methods from node +import * as assert from "assert"; + +// You can import and use all API from the 'vscode' module +// as well as import your extension to test it +import * as vscode from "vscode"; +import TestSetup from "./tools/TestSetup"; + +// Defines a Mocha test suite to group tests of similar kind together +suite("Variadic tests", () => { + const testSetup: TestSetup = new TestSetup("void foo();"); + + // Tests + test("", () => { + const result = testSetup.SetLine("").GetResult(); + assert.equal("", result); + }); + + test("", () => { + const result = testSetup.SetLine("").GetResult(); + assert.equal("", result); + }); + + test("", () => { + const result = testSetup.SetLine("").GetResult(); + assert.equal("", result); + }); + + test("", () => { + const result = testSetup.SetLine("").GetResult(); + assert.equal("", result); + }); +}); diff --git a/src/test/simpleReturn.test.ts b/src/test/simpleReturn.test.ts deleted file mode 100644 index 8f3e5d1..0000000 --- a/src/test/simpleReturn.test.ts +++ /dev/null @@ -1,79 +0,0 @@ -// -// Note: This example test is leveraging the Mocha test framework. -// Please refer to their documentation on https://mochajs.org/ for help. -// - -// The module 'assert' provides assertion methods from node -import * as assert from "assert"; - -// You can import and use all API from the 'vscode' module -// as well as import your extension to test it -import * as vscode from "vscode"; -import TestSetup from "./TestSetup"; - -// Defines a Mocha test suite to group tests of similar kind together -suite("Arguments tests", () => { - - const testSetup: TestSetup = new TestSetup("void foo();"); - - // Tests - test("void return", () => { - const result = testSetup.SetMethod("void foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n */", result); - }); - - test("simple type return", () => { - const result = testSetup.SetMethod("int foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return int \n */", result); - }); - - test("bool return type", () => { - const result = testSetup.SetMethod("bool foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return true \n * @return false \n */", result); - }); - - test("pointer return type", () => { - const result = testSetup.SetMethod("int* foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return int* \n */", result); - }); - - test("bool pointer return type", () => { - const result = testSetup.SetMethod("bool* foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return true \n * @return false \n * @return null \n */", result); - }); - - test("Fundamental return type with modifiers", () => { - let result = testSetup.SetMethod("unsigned int foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return unsigned int \n */", result); - - result = testSetup.SetMethod("unsigned short int foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return unsigned short int \n */", result); - - result = testSetup.SetMethod("signed short foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return signed short \n */", result); - - result = testSetup.SetMethod("long foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return long \n */", result); - - result = testSetup.SetMethod("unsigned long long int foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return unsigned long long int \n */", result); - - result = testSetup.SetMethod("signed foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return signed \n */", result); - - result = testSetup.SetMethod("unsigned foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return unsigned \n */", result); - - result = testSetup.SetMethod("unsigned char foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return unsigned char \n */", result); - - result = testSetup.SetMethod("long double foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return long double \n */", result); - }); - - test("struct return type", () => { - const result = testSetup.SetMethod("struct my_struct foo();").GetResult(); - assert.equal("/**\n * @brief \n * \n * @return struct my_struct \n */", result); - }); - -}); diff --git a/src/test/MockDocument.ts b/src/test/tools/MockDocument.ts index cb6bbfe..cb6bbfe 100644 --- a/src/test/MockDocument.ts +++ b/src/test/tools/MockDocument.ts diff --git a/src/test/MockEditor.ts b/src/test/tools/MockEditor.ts index 5368fb8..5368fb8 100644 --- a/src/test/MockEditor.ts +++ b/src/test/tools/MockEditor.ts diff --git a/src/test/MockLine.ts b/src/test/tools/MockLine.ts index 7196a38..7196a38 100644 --- a/src/test/MockLine.ts +++ b/src/test/tools/MockLine.ts diff --git a/src/test/MockPosition.ts b/src/test/tools/MockPosition.ts index 0753670..0753670 100644 --- a/src/test/MockPosition.ts +++ b/src/test/tools/MockPosition.ts diff --git a/src/test/MockSelection.ts b/src/test/tools/MockSelection.ts index e72ff8b..e72ff8b 100644 --- a/src/test/MockSelection.ts +++ b/src/test/tools/MockSelection.ts diff --git a/src/test/MockTextEditorEdit.ts b/src/test/tools/MockTextEditorEdit.ts index e751182..e751182 100644 --- a/src/test/MockTextEditorEdit.ts +++ b/src/test/tools/MockTextEditorEdit.ts diff --git a/src/test/TestSetup.ts b/src/test/tools/TestSetup.ts index 2f4f64a..1270616 100644 --- a/src/test/TestSetup.ts +++ b/src/test/tools/TestSetup.ts @@ -1,8 +1,8 @@ import * as vscode from "vscode"; -import CodeParser from "../CodeParser/CodeParser"; -import CParser from "../CodeParser/CParser/CParser"; -import { IDocGen } from "../DocGen/DocGen"; -import * as myExtension from "../extension"; +import CodeParser from "../../CodeParser/CodeParser"; +import CParser from "../../CodeParser/CParser/CParser"; +import { IDocGen } from "../../DocGen/DocGen"; +import * as myExtension from "../../extension"; import MockDocument from "./MockDocument"; import MockEditor from "./MockEditor"; import MockLine from "./MockLine"; @@ -13,10 +13,10 @@ export default class TestSetup { private editor: MockEditor; constructor(method: string) { - this.SetMethod(method); + this.SetLine(method); } - public SetMethod(method: string): TestSetup { + public SetLine(method: string): TestSetup { let position: MockPosition; position = new MockPosition(0, 0); |