@ai-dev-tools/csharp-copilot-core 0.0.29 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReadMe.md +1 -1
- package/package.json +1 -1
- package/out/analyze/cecil.d.ts +0 -1
- package/out/analyze/cecil.js +0 -42
- package/out/analyze/cecil.js.map +0 -1
- package/out/analyze/checkCodeSyntax.d.ts +0 -7
- package/out/analyze/checkCodeSyntax.js +0 -67
- package/out/analyze/checkCodeSyntax.js.map +0 -1
- package/out/analyze/generateCodeDependency.d.ts +0 -6
- package/out/analyze/generateCodeDependency.js +0 -126
- package/out/analyze/generateCodeDependency.js.map +0 -1
- package/out/analyze/installAnalyzerTool.d.ts +0 -1
- package/out/analyze/installAnalyzerTool.js +0 -82
- package/out/analyze/installAnalyzerTool.js.map +0 -1
- package/out/batch/generateCodeTests.d.ts +0 -6
- package/out/batch/generateCodeTests.js +0 -147
- package/out/batch/generateCodeTests.js.map +0 -1
- package/out/batch/getFolderCodeFile.d.ts +0 -1
- package/out/batch/getFolderCodeFile.js +0 -19
- package/out/batch/getFolderCodeFile.js.map +0 -1
- package/out/batch/getProjectCodeFile.d.ts +0 -4
- package/out/batch/getProjectCodeFile.js +0 -86
- package/out/batch/getProjectCodeFile.js.map +0 -1
- package/out/batch/getSolutionCodeFile.d.ts +0 -8
- package/out/batch/getSolutionCodeFile.js +0 -70
- package/out/batch/getSolutionCodeFile.js.map +0 -1
- package/out/benchmark/formatToMarkdown.d.ts +0 -2
- package/out/benchmark/formatToMarkdown.js +0 -101
- package/out/benchmark/formatToMarkdown.js.map +0 -1
- package/out/benchmark/generateBenchmarkReport.d.ts +0 -1
- package/out/benchmark/generateBenchmarkReport.js +0 -82
- package/out/benchmark/generateBenchmarkReport.js.map +0 -1
- package/out/codeCoverage/codeCoverage.d.ts +0 -6
- package/out/codeCoverage/codeCoverage.js +0 -39
- package/out/codeCoverage/codeCoverage.js.map +0 -1
- package/out/codeCoverage/codeCoverageReport.d.ts +0 -6
- package/out/codeCoverage/codeCoverageReport.js +0 -76
- package/out/codeCoverage/codeCoverageReport.js.map +0 -1
- package/out/codeCoverage/extractCodeCoverageInfo.d.ts +0 -2
- package/out/codeCoverage/extractCodeCoverageInfo.js +0 -80
- package/out/codeCoverage/extractCodeCoverageInfo.js.map +0 -1
- package/out/codeCoverage/extractCoverageReportPath.d.ts +0 -1
- package/out/codeCoverage/extractCoverageReportPath.js +0 -24
- package/out/codeCoverage/extractCoverageReportPath.js.map +0 -1
- package/out/codeCoverage/generateCodeCoverageReport.d.ts +0 -1
- package/out/codeCoverage/generateCodeCoverageReport.js +0 -30
- package/out/codeCoverage/generateCodeCoverageReport.js.map +0 -1
- package/out/codeCoverage/getCodeCoverageSetting.d.ts +0 -1
- package/out/codeCoverage/getCodeCoverageSetting.js +0 -58
- package/out/codeCoverage/getCodeCoverageSetting.js.map +0 -1
- package/out/codeCoverage/reportTool.d.ts +0 -2
- package/out/codeCoverage/reportTool.js +0 -22
- package/out/codeCoverage/reportTool.js.map +0 -1
- package/out/codeCoverage/simplifyCoverageXml.d.ts +0 -2
- package/out/codeCoverage/simplifyCoverageXml.js +0 -117
- package/out/codeCoverage/simplifyCoverageXml.js.map +0 -1
- package/out/codebk/250804prompt/buildAfGuidelines.liquid +0 -15
- package/out/codebk/250804prompt/general/generalBuildAutofixGuidelines.liquid +0 -13
- package/out/codebk/250804prompt/general/generalUtGuidelines.liquid +0 -18
- package/out/codebk/250804prompt/generateUtAutoFix.liquid +0 -19
- package/out/codebk/250804prompt/generateUtGuidelines.liquid +0 -13
- package/out/codebk/250804prompt/generateUtSystem.liquid +0 -5
- package/out/codebk/250804prompt/generateUtUserInput.liquid +0 -27
- package/out/codebk/250804prompt/testAfGuidelines.liquid +0 -6
- package/out/codebk/250804prompt/xap/xapBuildAutofixGuidelines.liquid +0 -13
- package/out/codebk/250804prompt/xap/xapCodeCodeDependency.liquid +0 -0
- package/out/codebk/250804prompt/xap/xapCodeSample.liquid +0 -38
- package/out/codebk/250804prompt/xap/xapUtGuideline-240804.liquid +0 -36
- package/out/codebk/250804prompt/xap/xapUtGuideline.liquid +0 -36
- package/out/codebk/childProcessManager.d.ts +0 -1
- package/out/codebk/childProcessManager.js +0 -50
- package/out/codebk/childProcessManager.js.map +0 -1
- package/out/codebk/msBuidSpawn.d.ts +0 -1
- package/out/codebk/msBuidSpawn.js +0 -58
- package/out/codebk/msBuidSpawn.js.map +0 -1
- package/out/codebk/msBuild.d.ts +0 -1
- package/out/codebk/msBuild.js +0 -123
- package/out/codebk/msBuild.js.map +0 -1
- package/out/codebk/old/generateXapTestAutoFix.liquid +0 -12
- package/out/codebk/old/generateXapTestGuidelines-fm.liquid +0 -68
- package/out/codebk/old/generateXapTestGuidelines.liquid +0 -28
- package/out/codebk/old/xapGuideline-fm.liquid +0 -149
- package/out/codebk/old/xapGuideline.liquid +0 -37
- package/out/codebk/oldExec/checkCodeSyntax.d.ts +0 -1
- package/out/codebk/oldExec/checkCodeSyntax.js +0 -81
- package/out/codebk/oldExec/checkCodeSyntax.js.map +0 -1
- package/out/codebk/oldExec/codeCoverage.d.ts +0 -1
- package/out/codebk/oldExec/codeCoverage.js +0 -54
- package/out/codebk/oldExec/codeCoverage.js.map +0 -1
- package/out/codebk/oldExec/codeCoverageReport.d.ts +0 -1
- package/out/codebk/oldExec/codeCoverageReport.js +0 -64
- package/out/codebk/oldExec/codeCoverageReport.js.map +0 -1
- package/out/codebk/oldExec/containsMethods.d.ts +0 -1
- package/out/codebk/oldExec/containsMethods.js +0 -74
- package/out/codebk/oldExec/containsMethods.js.map +0 -1
- package/out/codebk/oldExec/generateCodeDependency.d.ts +0 -1
- package/out/codebk/oldExec/generateCodeDependency.js +0 -95
- package/out/codebk/oldExec/generateCodeDependency.js.map +0 -1
- package/out/codebk/oldExec/msBuild.d.ts +0 -1
- package/out/codebk/oldExec/msBuild.js +0 -53
- package/out/codebk/oldExec/msBuild.js.map +0 -1
- package/out/codebk/oldExec/vsTest.d.ts +0 -1
- package/out/codebk/oldExec/vsTest.js +0 -71
- package/out/codebk/oldExec/vsTest.js.map +0 -1
- package/out/codebk/prompts/general/generalUnitTestGuidelines-20250702.liquid +0 -56
- package/out/codebk/prompts/generateXapTestGuidelines-20250704.liquid +0 -21
- package/out/codebk/prompts/generateXapTestGuidelines-o.liquid +0 -29
- package/out/codebk/prompts/xap/xapGuideline-o.liquid +0 -45
- package/out/codebk/testbuildkill.d.ts +0 -1
- package/out/codebk/testbuildkill.js +0 -37
- package/out/codebk/testbuildkill.js.map +0 -1
- package/out/command/index.d.ts +0 -2
- package/out/command/index.js +0 -94
- package/out/command/index.js.map +0 -1
- package/out/command/utGenWrapper.d.ts +0 -4
- package/out/command/utGenWrapper.js +0 -46
- package/out/command/utGenWrapper.js.map +0 -1
- package/out/exit/childProcessManager.d.ts +0 -2
- package/out/exit/childProcessManager.js +0 -43
- package/out/exit/childProcessManager.js.map +0 -1
- package/out/exit/setupProcessSignalHandler.d.ts +0 -1
- package/out/exit/setupProcessSignalHandler.js +0 -18
- package/out/exit/setupProcessSignalHandler.js.map +0 -1
- package/out/gen/autoFix.d.ts +0 -4
- package/out/gen/autoFix.js +0 -125
- package/out/gen/autoFix.js.map +0 -1
- package/out/gen/csharpUtGen.d.ts +0 -2
- package/out/gen/csharpUtGen.js +0 -125
- package/out/gen/csharpUtGen.js.map +0 -1
- package/out/gen/ensureValidLLMResponse.d.ts +0 -1
- package/out/gen/ensureValidLLMResponse.js +0 -19
- package/out/gen/ensureValidLLMResponse.js.map +0 -1
- package/out/gen/postGen/extractCodeFromResponse.d.ts +0 -1
- package/out/gen/postGen/extractCodeFromResponse.js +0 -37
- package/out/gen/postGen/extractCodeFromResponse.js.map +0 -1
- package/out/gen/postGen/postGenProcess.d.ts +0 -1
- package/out/gen/postGen/postGenProcess.js +0 -37
- package/out/gen/postGen/postGenProcess.js.map +0 -1
- package/out/gen/postGen/removeComments.d.ts +0 -1
- package/out/gen/postGen/removeComments.js +0 -92
- package/out/gen/postGen/removeComments.js.map +0 -1
- package/out/gen/postGen/removeSingleLines.d.ts +0 -1
- package/out/gen/postGen/removeSingleLines.js +0 -28
- package/out/gen/postGen/removeSingleLines.js.map +0 -1
- package/out/gen/postGen/repairRequiredNameSpaces.d.ts +0 -2
- package/out/gen/postGen/repairRequiredNameSpaces.js +0 -141
- package/out/gen/postGen/repairRequiredNameSpaces.js.map +0 -1
- package/out/gen/postGen/validateTestCode.d.ts +0 -1
- package/out/gen/postGen/validateTestCode.js +0 -14
- package/out/gen/postGen/validateTestCode.js.map +0 -1
- package/out/gen/preGen/excludeFileName.d.ts +0 -1
- package/out/gen/preGen/excludeFileName.js +0 -49
- package/out/gen/preGen/excludeFileName.js.map +0 -1
- package/out/gen/preGen/excludeSpecificTag.d.ts +0 -1
- package/out/gen/preGen/excludeSpecificTag.js +0 -18
- package/out/gen/preGen/excludeSpecificTag.js.map +0 -1
- package/out/gen/preGen/preGenProcess.d.ts +0 -1
- package/out/gen/preGen/preGenProcess.js +0 -22
- package/out/gen/preGen/preGenProcess.js.map +0 -1
- package/out/gen/preGen/validateCode.d.ts +0 -3
- package/out/gen/preGen/validateCode.js +0 -62
- package/out/gen/preGen/validateCode.js.map +0 -1
- package/out/index.d.ts +0 -3
- package/out/index.js +0 -10
- package/out/index.js.map +0 -1
- package/out/llm/model/Gpt.d.ts +0 -1
- package/out/llm/model/Gpt.js +0 -93
- package/out/llm/model/Gpt.js.map +0 -1
- package/out/llm/preparePrompt.d.ts +0 -2
- package/out/llm/preparePrompt.js +0 -135
- package/out/llm/preparePrompt.js.map +0 -1
- package/out/llm/prompt/buildAfGuidelines.liquid +0 -15
- package/out/llm/prompt/general/generalBuildAutofixGuidelines.liquid +0 -13
- package/out/llm/prompt/general/generalUtGuidelines.liquid +0 -16
- package/out/llm/prompt/generateUtAutoFix.liquid +0 -23
- package/out/llm/prompt/generateUtDependency.liquid +0 -3
- package/out/llm/prompt/generateUtSystem.liquid +0 -5
- package/out/llm/prompt/generateUtTemplate.liquid +0 -32
- package/out/llm/prompt/generateUtUserInput.liquid +0 -4
- package/out/llm/prompt/xap/xapBuildAutofixGuidelines.liquid +0 -13
- package/out/llm/prompt/xap/xapCodeCodeDependency.liquid +0 -0
- package/out/llm/prompt/xap/xapCodeSample.liquid +0 -38
- package/out/llm/prompt/xap/xapUtGuideline.liquid +0 -37
- package/out/llm/sendRequestToLLM.d.ts +0 -4
- package/out/llm/sendRequestToLLM.js +0 -9
- package/out/llm/sendRequestToLLM.js.map +0 -1
- package/out/llm/sendRequestToSelfHostLLM.d.ts +0 -4
- package/out/llm/sendRequestToSelfHostLLM.js +0 -41
- package/out/llm/sendRequestToSelfHostLLM.js.map +0 -1
- package/out/metrics/appInsightTelemetry.d.ts +0 -6
- package/out/metrics/appInsightTelemetry.js +0 -77
- package/out/metrics/appInsightTelemetry.js.map +0 -1
- package/out/metrics/machineId.d.ts +0 -11
- package/out/metrics/machineId.js +0 -85
- package/out/metrics/machineId.js.map +0 -1
- package/out/setup/setup.d.ts +0 -1
- package/out/setup/setup.js +0 -10
- package/out/setup/setup.js.map +0 -1
- package/out/setup/setupConsole.d.ts +0 -1
- package/out/setup/setupConsole.js +0 -23
- package/out/setup/setupConsole.js.map +0 -1
- package/out/setup/setupLLMRequest.d.ts +0 -2
- package/out/setup/setupLLMRequest.js +0 -10
- package/out/setup/setupLLMRequest.js.map +0 -1
- package/out/tools/devenvcom.cmd +0 -13
- package/out/tools/devenvexe.cmd +0 -13
- package/out/tools/msbuildexe.cmd +0 -13
- package/out/tools/vstestexe.cmd +0 -13
- package/out/types/benchmark.d.ts +0 -11
- package/out/types/benchmark.js +0 -3
- package/out/types/benchmark.js.map +0 -1
- package/out/types/buildResult.d.ts +0 -8
- package/out/types/buildResult.js +0 -3
- package/out/types/buildResult.js.map +0 -1
- package/out/types/constants.d.ts +0 -6
- package/out/types/constants.js +0 -10
- package/out/types/constants.js.map +0 -1
- package/out/types/genResult.d.ts +0 -10
- package/out/types/genResult.js +0 -3
- package/out/types/genResult.js.map +0 -1
- package/out/types/testResult.d.ts +0 -12
- package/out/types/testResult.js +0 -3
- package/out/types/testResult.js.map +0 -1
- package/out/types/verifyResult.d.ts +0 -8
- package/out/types/verifyResult.js +0 -3
- package/out/types/verifyResult.js.map +0 -1
- package/out/utils/checkTestProject.d.ts +0 -2
- package/out/utils/checkTestProject.js +0 -79
- package/out/utils/checkTestProject.js.map +0 -1
- package/out/utils/checkXapCode.d.ts +0 -2
- package/out/utils/checkXapCode.js +0 -59
- package/out/utils/checkXapCode.js.map +0 -1
- package/out/utils/delay.d.ts +0 -1
- package/out/utils/delay.js +0 -7
- package/out/utils/delay.js.map +0 -1
- package/out/utils/detectTestFramework.d.ts +0 -1
- package/out/utils/detectTestFramework.js +0 -33
- package/out/utils/detectTestFramework.js.map +0 -1
- package/out/utils/fileUtils.d.ts +0 -2
- package/out/utils/fileUtils.js +0 -42
- package/out/utils/fileUtils.js.map +0 -1
- package/out/utils/generateCodeSha256.d.ts +0 -1
- package/out/utils/generateCodeSha256.js +0 -46
- package/out/utils/generateCodeSha256.js.map +0 -1
- package/out/utils/getCodeStructurePath.d.ts +0 -5
- package/out/utils/getCodeStructurePath.js +0 -155
- package/out/utils/getCodeStructurePath.js.map +0 -1
- package/out/utils/getOrCreateDir.d.ts +0 -2
- package/out/utils/getOrCreateDir.js +0 -63
- package/out/utils/getOrCreateDir.js.map +0 -1
- package/out/utils/getTestCodeInfo.d.ts +0 -2
- package/out/utils/getTestCodeInfo.js +0 -121
- package/out/utils/getTestCodeInfo.js.map +0 -1
- package/out/utils/getTestFile.d.ts +0 -13
- package/out/utils/getTestFile.js +0 -295
- package/out/utils/getTestFile.js.map +0 -1
- package/out/utils/parseBuildResult.d.ts +0 -3
- package/out/utils/parseBuildResult.js +0 -44
- package/out/utils/parseBuildResult.js.map +0 -1
- package/out/utils/parseSyntaxCheckResult.d.ts +0 -2
- package/out/utils/parseSyntaxCheckResult.js +0 -38
- package/out/utils/parseSyntaxCheckResult.js.map +0 -1
- package/out/utils/parseVstestResult.d.ts +0 -3
- package/out/utils/parseVstestResult.js +0 -61
- package/out/utils/parseVstestResult.js.map +0 -1
- package/out/utils/removeFailedTestMethods.d.ts +0 -3
- package/out/utils/removeFailedTestMethods.js +0 -207
- package/out/utils/removeFailedTestMethods.js.map +0 -1
- package/out/utils/runCommand.d.ts +0 -1
- package/out/utils/runCommand.js +0 -14
- package/out/utils/runCommand.js.map +0 -1
- package/out/utils/spawnExec.d.ts +0 -1
- package/out/utils/spawnExec.js +0 -80
- package/out/utils/spawnExec.js.map +0 -1
- package/out/utils/verifyBuildErrorCausedFile.d.ts +0 -1
- package/out/utils/verifyBuildErrorCausedFile.js +0 -60
- package/out/utils/verifyBuildErrorCausedFile.js.map +0 -1
- package/out/utils/verifyTestCode.d.ts +0 -2
- package/out/utils/verifyTestCode.js +0 -25
- package/out/utils/verifyTestCode.js.map +0 -1
- package/out/utils/writeGenCode.d.ts +0 -1
- package/out/utils/writeGenCode.js +0 -50
- package/out/utils/writeGenCode.js.map +0 -1
- package/out/vs/msBuild.d.ts +0 -13
- package/out/vs/msBuild.js +0 -49
- package/out/vs/msBuild.js.map +0 -1
- package/out/vs/vsTest.d.ts +0 -15
- package/out/vs/vsTest.js +0 -75
- package/out/vs/vsTest.js.map +0 -1
- package/out/vs/vsTools.d.ts +0 -7
- package/out/vs/vsTools.js +0 -177
- package/out/vs/vsTools.js.map +0 -1
- package/out/vsPlugin/getVsPluginVerifyResult.d.ts +0 -2
- package/out/vsPlugin/getVsPluginVerifyResult.js +0 -41
- package/out/vsPlugin/getVsPluginVerifyResult.js.map +0 -1
- package/out/vsPlugin/interactionConstants.d.ts +0 -2
- package/out/vsPlugin/interactionConstants.js +0 -10
- package/out/vsPlugin/interactionConstants.js.map +0 -1
- package/out/vsPlugin/sendStdToVsPlugin.d.ts +0 -1
- package/out/vsPlugin/sendStdToVsPlugin.js +0 -12
- package/out/vsPlugin/sendStdToVsPlugin.js.map +0 -1
- package/out/vsPlugin/stdListener.d.ts +0 -3
- package/out/vsPlugin/stdListener.js +0 -57
- package/out/vsPlugin/stdListener.js.map +0 -1
package/out/vs/vsTest.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runSingleTestMethod = runSingleTestMethod;
|
|
4
|
-
exports.runTestClass = runTestClass;
|
|
5
|
-
exports.runTestCommand = runTestCommand;
|
|
6
|
-
exports.testErrorHandler = testErrorHandler;
|
|
7
|
-
exports.testCloseHandler = testCloseHandler;
|
|
8
|
-
const parseVstestResult_1 = require("../utils/parseVstestResult");
|
|
9
|
-
const spawnExec_1 = require("../utils/spawnExec");
|
|
10
|
-
const vsTools_1 = require("./vsTools");
|
|
11
|
-
const getOrCreateDir_1 = require("../utils/getOrCreateDir");
|
|
12
|
-
// const vstestPath = `"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\Extensions\\TestPlatform\\vstest.console.exe"`;
|
|
13
|
-
const TestCacheDir = "./build/";
|
|
14
|
-
async function runSingleTestMethod(testDll, testMethod) {
|
|
15
|
-
// const cmd = `vstestexe.cmd "${testDll}" /Tests:${testMethod}`;
|
|
16
|
-
const args = [testDll, `/Tests:${testMethod}`];
|
|
17
|
-
return await runTestCommand(args);
|
|
18
|
-
}
|
|
19
|
-
async function runTestClass(testDll, className) {
|
|
20
|
-
// const cmd = `vstestexe.cmd "${testDll}" /TestCaseFilter:"FullyQualifiedName~${className}"`;
|
|
21
|
-
const args = [testDll, `/TestCaseFilter:FullyQualifiedName~${className}`];
|
|
22
|
-
return await runTestCommand(args);
|
|
23
|
-
}
|
|
24
|
-
// export function runTestFile(testDll: string, fullyQualifiedNames: string[]) {
|
|
25
|
-
// const testsArg = fullyQualifiedNames.map(name => `/Tests:${name}`).join(' ');
|
|
26
|
-
// const cmd = `vstest.console.exe "${testDll}" ${testsArg}`;
|
|
27
|
-
// execCommand(cmd);
|
|
28
|
-
// }
|
|
29
|
-
function runTestCommand(args) {
|
|
30
|
-
const workDir = (0, getOrCreateDir_1.getTmpCacheDir)(TestCacheDir);
|
|
31
|
-
return (0, spawnExec_1.runSpawn)(`${vsTools_1.vstestPath}`, args, workDir, testErrorHandler, testCloseHandler);
|
|
32
|
-
}
|
|
33
|
-
function testErrorHandler(error) {
|
|
34
|
-
console.error(`testErrorHandler - failed: ${error.message}`);
|
|
35
|
-
return ({ success: false });
|
|
36
|
-
}
|
|
37
|
-
function testCloseHandler(code, stdout, stderr) {
|
|
38
|
-
if (code !== 0) {
|
|
39
|
-
console.error(`vstest failed with exit code ${code}`);
|
|
40
|
-
const testResult = (0, parseVstestResult_1.parseVSTestOutput)(stdout);
|
|
41
|
-
const formatedVSTestResult = (0, parseVstestResult_1.formatVSTestResultToMarkdown)(testResult);
|
|
42
|
-
if (!parseVstestResult_1.formatVSTestResultToMarkdown) {
|
|
43
|
-
// case: .NET version is not correct! like You must install or update .NET to run this application...
|
|
44
|
-
console.error(`Failed to parse vstest output: ${stdout}`);
|
|
45
|
-
}
|
|
46
|
-
return { success: false, message: formatedVSTestResult, testResult };
|
|
47
|
-
}
|
|
48
|
-
if (stderr) {
|
|
49
|
-
console.error(`STDERR:\n${stdout}`);
|
|
50
|
-
return { success: false, message: stdout, testResult: null };
|
|
51
|
-
}
|
|
52
|
-
console.log(`vstest succeeded`);
|
|
53
|
-
return { success: true, message: stdout, testResult: null };
|
|
54
|
-
}
|
|
55
|
-
// runTestClass('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Plugin.AudienceResponseParserTests');
|
|
56
|
-
// FullyQualifiedName~SharedSegments.Tests.Weather.Eplant.EplantMeResponseBuilderTest
|
|
57
|
-
// setupSignalHandlers();
|
|
58
|
-
// runTestClass('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Eplant.EplantMeResponseBuilderTest').then(result => {
|
|
59
|
-
// console.log('Test Class Result:', result.success, result.message);
|
|
60
|
-
// });
|
|
61
|
-
// runSingleTestMethod('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Plugin.AudienceResponseParserTests.ResponseParserTests');
|
|
62
|
-
// vstest.console.exe "D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll" /TestCaseFilter:"FullyQualifiedName~${className}"
|
|
63
|
-
// vstest.console.exe "D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll" /Tests:SqmidHelperTests.GetSqmidFromCookie_ValidCookie_ReturnsDecodedBlisId
|
|
64
|
-
// ./vstest.console.exe "D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll" /Tests:SharedSegments.Tests.Weather.Eplant.SqmidHelperTests.GetSqmidFromCookie_ValidCookie_ReturnsDecodedBlisId
|
|
65
|
-
// .\vstestexe.cmd "D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll" /Tests:SharedSegments.Tests.Weather.Eplant.SqmidHelperTests.GetSqmidFromCookie_ValidCookie_ReturnsDecodedBlisId
|
|
66
|
-
//.\vstestexe.cmd "D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll" /TestCaseFilter:"FullyQualifiedName~SharedSegments.Tests.Weather.Eplant.SqmidHelperTests"
|
|
67
|
-
// runTestClass('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Eplant.SqmidHelperTests').then(result => {
|
|
68
|
-
// console.log('Test Class Result:', result.success, result.message);
|
|
69
|
-
// });
|
|
70
|
-
// runSingleTestMethod('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Eplant.SqmidHelperTests.GetSqmidFromCookie_MissingUsrLocCookie_ReturnsEmptyString')
|
|
71
|
-
// runSingleTestMethod('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Eplant.SqmidHelperTests.GetSqmidFromCookie_InvalidBase64Bid_ReturnsEmptyString');
|
|
72
|
-
// runTestClass('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll', 'SharedSegments.Plugins.Tests.Workflows.Eplant.Conditions.EplantRequestCategoryConditionTests').then(result => {
|
|
73
|
-
// console.log('Test Class Result:', result.success, result.message);
|
|
74
|
-
// });
|
|
75
|
-
//# sourceMappingURL=vsTest.js.map
|
package/out/vs/vsTest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vsTest.js","sourceRoot":"","sources":["../../src/vs/vsTest.ts"],"names":[],"mappings":";;AASA,kDAIC;AAED,oCAIC;AAQD,wCAGC;AAED,4CAGC;AAED,4CAkBC;AAvDD,kEAA6F;AAE7F,kDAA8C;AAC9C,uCAAuC;AACvC,4DAAyD;AAEzD,kJAAkJ;AAElJ,MAAM,YAAY,GAAG,UAAU,CAAA;AACxB,KAAK,UAAU,mBAAmB,CAAC,OAAe,EAAE,UAAkB;IAC5E,iEAAiE;IACjE,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,UAAU,UAAU,EAAE,C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AE,UAAU,EAAE,CAAC;IACtE,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC;QACpC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAC9D,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAC;AAID,mNAAmN;AACnN,qFAAqF;AACrF,yBAAyB;AACzB,mOAAmO;AACnO,sEAAsE;AACtE,MAAM;AACN,8OAA8O;AAE9O,sMAAsM;AACtM,gOAAgO;AAChO,sQAAsQ;AACtQ,iQAAiQ;AACjQ,2OAA2O;AAE3O,wNAAwN;AACxN,sEAAsE;AACtE,MAAM;AACN,wQAAwQ;AACxQ,sQAAsQ;AACtQ,gQAAgQ;AAChQ,sEAAsE;AACtE,MAAM","sourcesContent":["import { formatVSTestResultToMarkdown, parseVSTestOutput } from '../utils/parseVstestResult';\r\n\r\nimport { runSpawn } from '../utils/spawnExec';\r\nimport { vstestPath } from './vsTools';\r\nimport { getTmpCacheDir } from '../utils/getOrCreateDir';\r\n\r\n// const vstestPath = `\"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Community\\\\Common7\\\\IDE\\\\Extensions\\\\TestPlatform\\\\vstest.console.exe\"`;\r\n\r\nconst TestCacheDir = \"./build/\"\r\nexport async function runSingleTestMethod(testDll: string, testMethod: string) {\r\n\t// const cmd = `vstestexe.cmd \"${testDll}\" /Tests:${testMethod}`;\r\n\tconst args = [testDll, `/Tests:${testMethod}`];\r\n\treturn await runTestCommand(args);\r\n}\r\n\r\nexport async function runTestClass(testDll: string, className: string) {\r\n\t// const cmd = `vstestexe.cmd \"${testDll}\" /TestCaseFilter:\"FullyQualifiedName~${className}\"`;\r\n\tconst args = [testDll, `/TestCaseFilter:FullyQualifiedName~${className}`];\r\n\treturn await runTestCommand(args);\r\n}\r\n\r\n// export function runTestFile(testDll: string, fullyQualifiedNames: string[]) {\r\n// \tconst testsArg = fullyQualifiedNames.map(name => `/Tests:${name}`).join(' ');\r\n// \tconst cmd = `vstest.console.exe \"${testDll}\" ${testsArg}`;\r\n// \texecCommand(cmd);\r\n// }\r\n\r\nexport function runTestCommand(args: string[]): Promise<any> {\r\n\tconst workDir = getTmpCacheDir(TestCacheDir);\r\n\treturn runSpawn(`${vstestPath}`, args, workDir, testErrorHandler, testCloseHandler);\r\n}\r\n\r\nexport function testErrorHandler(error) {\r\n\tconsole.error(`testErrorHandler - failed: ${error.message}`);\r\n\treturn ({ success: false });\r\n}\r\n\r\nexport function testCloseHandler(code, stdout, stderr) {\r\n\tif (code !== 0) {\r\n\t\tconsole.error(`vstest failed with exit code ${code}`);\r\n\t\tconst testResult = parseVSTestOutput(stdout);\r\n\t\tconst formatedVSTestResult = formatVSTestResultToMarkdown(testResult);\r\n\t\tif (!formatVSTestResultToMarkdown) {\r\n\t\t\t// case: .NET version is not correct! like You must install or update .NET to run this application...\r\n\t\t\tconsole.error(`Failed to parse vstest output: ${stdout}`);\r\n\t\t}\r\n\t\treturn { success: false, message: formatedVSTestResult, testResult };\r\n\t}\r\n\tif (stderr) {\r\n\t\tconsole.error(`STDERR:\\n${stdout}`);\r\n\t\treturn { success: false, message: stdout, testResult: null };\r\n\t}\r\n\r\n\tconsole.log(`vstest succeeded`);\r\n\treturn { success: true, message: stdout, testResult: null };\r\n}\r\n\r\n\r\n\r\n// runTestClass('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Plugin.AudienceResponseParserTests');\r\n// FullyQualifiedName~SharedSegments.Tests.Weather.Eplant.EplantMeResponseBuilderTest\r\n// setupSignalHandlers();\r\n// runTestClass('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Eplant.EplantMeResponseBuilderTest').then(result => {\r\n// \tconsole.log('Test Class Result:', result.success, result.message);\r\n// });\r\n// runSingleTestMethod('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Plugin.AudienceResponseParserTests.ResponseParserTests');\r\n\r\n// vstest.console.exe \"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll\" /TestCaseFilter:\"FullyQualifiedName~${className}\"\r\n// vstest.console.exe \"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll\" /Tests:SqmidHelperTests.GetSqmidFromCookie_ValidCookie_ReturnsDecodedBlisId\r\n// ./vstest.console.exe \"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll\" /Tests:SharedSegments.Tests.Weather.Eplant.SqmidHelperTests.GetSqmidFromCookie_ValidCookie_ReturnsDecodedBlisId\r\n// .\\vstestexe.cmd \"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll\" /Tests:SharedSegments.Tests.Weather.Eplant.SqmidHelperTests.GetSqmidFromCookie_ValidCookie_ReturnsDecodedBlisId\r\n//.\\vstestexe.cmd \"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll\" /TestCaseFilter:\"FullyQualifiedName~SharedSegments.Tests.Weather.Eplant.SqmidHelperTests\"\r\n\r\n// runTestClass('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Eplant.SqmidHelperTests').then(result => {\r\n// \tconsole.log('Test Class Result:', result.success, result.message);\r\n// });\r\n// runSingleTestMethod('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Eplant.SqmidHelperTests.GetSqmidFromCookie_MissingUsrLocCookie_ReturnsEmptyString')\r\n// runSingleTestMethod('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll', 'SharedSegments.Tests.Weather.Eplant.SqmidHelperTests.GetSqmidFromCookie_InvalidBase64Bid_ReturnsEmptyString');\r\n// runTestClass('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll', 'SharedSegments.Plugins.Tests.Workflows.Eplant.Conditions.EplantRequestCategoryConditionTests').then(result => {\r\n// \tconsole.log('Test Class Result:', result.success, result.message);\r\n// });"]}
|
package/out/vs/vsTools.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const vsDevCmdPath: string;
|
|
2
|
-
export declare const msBuildPath: string;
|
|
3
|
-
export declare const vstestPath: string;
|
|
4
|
-
export declare function findVsDevCmd(): string | null;
|
|
5
|
-
export declare function findMsBuild(): string | null;
|
|
6
|
-
export declare function findVsTestConsole(): string | null;
|
|
7
|
-
export declare function findCodeCoverage(): string | null;
|
package/out/vs/vsTools.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.vstestPath = exports.msBuildPath = exports.vsDevCmdPath = void 0;
|
|
37
|
-
exports.findVsDevCmd = findVsDevCmd;
|
|
38
|
-
exports.findMsBuild = findMsBuild;
|
|
39
|
-
exports.findVsTestConsole = findVsTestConsole;
|
|
40
|
-
exports.findCodeCoverage = findCodeCoverage;
|
|
41
|
-
const fs = __importStar(require("fs"));
|
|
42
|
-
const path = __importStar(require("path"));
|
|
43
|
-
const child_process_1 = require("child_process");
|
|
44
|
-
const VSVERSION = ['2022', '2019'];
|
|
45
|
-
const VSEROOT = [
|
|
46
|
-
'C:\\Program Files\\Microsoft Visual Studio\\',
|
|
47
|
-
'C:\\Program Files (x86)\\Microsoft Visual Studio\\',
|
|
48
|
-
];
|
|
49
|
-
const VSEDITION = ['Community', 'Professional', 'Enterprise', 'BuildTools'];
|
|
50
|
-
let vsStaticInstallationPaths = [];
|
|
51
|
-
exports.vsDevCmdPath = findVsDevCmd();
|
|
52
|
-
exports.msBuildPath = findMsBuild();
|
|
53
|
-
exports.vstestPath = findVsTestConsole();
|
|
54
|
-
function getStaticVsInstallationPaths() {
|
|
55
|
-
for (const root of VSEROOT) {
|
|
56
|
-
for (const version of VSVERSION) {
|
|
57
|
-
for (const edition of VSEDITION) {
|
|
58
|
-
const installPath = path.join(root, version, edition);
|
|
59
|
-
if (fs.existsSync(installPath)) {
|
|
60
|
-
vsStaticInstallationPaths.push(installPath);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function getToolPath(subPath) {
|
|
67
|
-
for (const vsStaticInstallationPath of vsStaticInstallationPaths) {
|
|
68
|
-
const toolPath = path.join(vsStaticInstallationPath, subPath);
|
|
69
|
-
if (fileExists(toolPath)) {
|
|
70
|
-
return toolPath;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
function fileExists(p) {
|
|
76
|
-
return fs.existsSync(p) && fs.statSync(p).isFile();
|
|
77
|
-
}
|
|
78
|
-
// vswhere.exe 位置(默认 VS 安装目录下)
|
|
79
|
-
function getVsWherePath() {
|
|
80
|
-
const defaultPath = path.join(process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)', 'Microsoft Visual Studio', 'Installer', 'vswhere.exe');
|
|
81
|
-
if (fileExists(defaultPath)) {
|
|
82
|
-
return defaultPath;
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
// init default static paths
|
|
86
|
-
getStaticVsInstallationPaths();
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
// 调用 vswhere 获取 VS 安装路径
|
|
91
|
-
function getVSInstallationPath() {
|
|
92
|
-
const vswhere = getVsWherePath();
|
|
93
|
-
if (!vswhere)
|
|
94
|
-
return null;
|
|
95
|
-
const result = (0, child_process_1.spawnSync)(vswhere, [
|
|
96
|
-
'-latest',
|
|
97
|
-
'-requires', 'Microsoft.Component.MSBuild',
|
|
98
|
-
'-property', 'installationPath',
|
|
99
|
-
'-products', '*',
|
|
100
|
-
], {
|
|
101
|
-
encoding: 'utf-8',
|
|
102
|
-
});
|
|
103
|
-
if (result.status !== 0) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
const installPath = result.stdout.trim();
|
|
107
|
-
return installPath;
|
|
108
|
-
}
|
|
109
|
-
function findVsDevCmd() {
|
|
110
|
-
// find by vswhere first
|
|
111
|
-
const installPath = getVSInstallationPath();
|
|
112
|
-
if (installPath) {
|
|
113
|
-
const vsdev = path.join(installPath, 'Common7', 'Tools', 'VsDevCmd.bat');
|
|
114
|
-
if (fileExists(vsdev)) {
|
|
115
|
-
return vsdev;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
// try static path
|
|
119
|
-
const subPath = path.join('Common7', 'Tools', 'VsDevCmd.bat');
|
|
120
|
-
const toolPath = getToolPath(subPath);
|
|
121
|
-
return toolPath;
|
|
122
|
-
}
|
|
123
|
-
function findMsBuild() {
|
|
124
|
-
const base = getVSInstallationPath();
|
|
125
|
-
if (base) {
|
|
126
|
-
const is64Bit = process.arch === "x64" || process.arch === "arm64";
|
|
127
|
-
const pathPart = is64Bit ? 'amd64' : '';
|
|
128
|
-
const candidates = [
|
|
129
|
-
path.join(base, 'MSBuild', 'Current', 'Bin', pathPart, 'MSBuild.exe'),
|
|
130
|
-
path.join(base, 'MSBuild', '15.0', 'Bin', pathPart, 'MSBuild.exe'),
|
|
131
|
-
];
|
|
132
|
-
for (const c of candidates) {
|
|
133
|
-
if (fileExists(c))
|
|
134
|
-
return c;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
const subPath = path.join('MSBuild', 'Current', 'Bin', 'MSBuild.exe');
|
|
138
|
-
const toolPath = getToolPath(subPath);
|
|
139
|
-
return toolPath;
|
|
140
|
-
}
|
|
141
|
-
// find vstest.console.exe
|
|
142
|
-
function findVsTestConsole() {
|
|
143
|
-
const base = getVSInstallationPath();
|
|
144
|
-
if (base) {
|
|
145
|
-
const candidates = [
|
|
146
|
-
path.join(base, 'Common7', 'IDE', 'CommonExtensions', 'Microsoft', 'TestWindow', 'vstest.console.exe'),
|
|
147
|
-
path.join(base, 'Common7', 'IDE', 'Extensions', 'TestPlatform', 'vstest.console.exe'),
|
|
148
|
-
];
|
|
149
|
-
for (const c of candidates) {
|
|
150
|
-
if (fileExists(c))
|
|
151
|
-
return c;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
const subPath = path.join('Common7', 'IDE', 'CommonExtensions', 'Microsoft', 'TestWindow', 'vstest.console.exe');
|
|
155
|
-
const toolPath = getToolPath(subPath);
|
|
156
|
-
return toolPath;
|
|
157
|
-
}
|
|
158
|
-
// "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe"
|
|
159
|
-
function findCodeCoverage() {
|
|
160
|
-
const base = getVSInstallationPath();
|
|
161
|
-
if (base) {
|
|
162
|
-
const codeCoveragePath = path.join(base, 'Team Tools', 'IDE', 'Dynamic Code Coverage Tools', 'CodeCoverage.exe');
|
|
163
|
-
if (fileExists(codeCoveragePath))
|
|
164
|
-
return codeCoveragePath;
|
|
165
|
-
}
|
|
166
|
-
const subPath = path.join('Team Tools', 'IDE', 'Dynamic Code Coverage Tools', 'CodeCoverage.exe');
|
|
167
|
-
const toolPath = getToolPath(subPath);
|
|
168
|
-
return toolPath;
|
|
169
|
-
}
|
|
170
|
-
// console.log('🔍 find Visual Studio tool path:');
|
|
171
|
-
// const vsDev = findVsDevCmd();
|
|
172
|
-
// const msbuild = findMsBuild();
|
|
173
|
-
// const vstest = findVsTestConsole();
|
|
174
|
-
// console.log('VsDevCmd.bat:', vsDev || 'Not found');
|
|
175
|
-
// console.log('MSBuild.exe:', msbuild || 'Not found');
|
|
176
|
-
// console.log('vstest.console.exe:', vstest || 'Not found');
|
|
177
|
-
//# sourceMappingURL=vsTools.js.map
|
package/out/vs/vsTools.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vsTools.js","sourceRoot":"","sources":["../../src/vs/vsTools.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,oCAeC;AAED,kCAkBC;AAGD,8CAeC;AAGD,4CAUC;AAvJD,uCAAyB;AACzB,2CAA6B;AAE7B,iDAA0C;AAE1C,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACnC,MAAM,OAAO,GAAG;IACd,8CAA8C;IAC9C,oDAAoD;CACpD,CAAC;AACH,MAAM,SAAS,GAAG,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAE5E,IAAI,yBAAyB,GAAY,EAAE,CAAC;AAE/B,QAAA,YAAY,GAAG,YAAY,EAAE,CAAC;AAC9B,QAAA,WAAW,GAAG,WAAW,EAAE,CAAC;AAC5B,QAAA,UAAU,GAAG,iBAAiB,EAAE,CAAC;AAE9C,SAAS,4BAA4B;I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AY,EAAE,oBAAoB,CAAC,CAAC;IACjH,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,qHAAqH;AACrH,SAAgB,gBAAgB;IAC/B,MAAM,IAAI,GAAG,qBAAqB,EAAE,CAAC;IACrC,IAAI,IAAI,EAAE,CAAC;QACV,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;QACjH,IAAI,UAAU,CAAC,gBAAgB,CAAC;YAAE,OAAO,gBAAgB,CAAC;IAC3D,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;IAClG,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,mDAAmD;AAEnD,gCAAgC;AAChC,iCAAiC;AACjC,sCAAsC;AAEtC,sDAAsD;AACtD,uDAAuD;AACvD,6DAA6D","sourcesContent":["import * as fs from 'fs';\r\nimport * as path from 'path';\r\n\r\nimport { spawnSync } from 'child_process';\r\n\r\nconst VSVERSION = ['2022', '2019'];\r\nconst VSEROOT = [\r\n\t\t'C:\\\\Program Files\\\\Microsoft Visual Studio\\\\',\r\n\t\t'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio\\\\',\r\n\t];\r\nconst VSEDITION = ['Community', 'Professional', 'Enterprise', 'BuildTools'];\r\n\r\nlet vsStaticInstallationPaths:string[] = [];\r\n\r\nexport const vsDevCmdPath = findVsDevCmd();\r\nexport const msBuildPath = findMsBuild();\r\nexport const vstestPath = findVsTestConsole();\r\n\r\nfunction getStaticVsInstallationPaths() {\r\n\tfor (const root of VSEROOT) {\r\n\t\tfor (const version of VSVERSION) {\r\n\t\t\tfor (const edition of VSEDITION) {\r\n\t\t\t\tconst installPath = path.join(root, version, edition);\r\n\t\t\t\tif (fs.existsSync(installPath)) {\r\n\t\t\t\t\tvsStaticInstallationPaths.push(installPath);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction getToolPath(subPath: string): string | null {\r\n\tfor (const vsStaticInstallationPath of vsStaticInstallationPaths) {\r\n\t\tconst toolPath = path.join(vsStaticInstallationPath, subPath);\r\n\t\tif (fileExists(toolPath)) {\r\n\t\t\treturn toolPath;\r\n\t\t}\r\n\t}\r\n\r\n\treturn null;\r\n}\r\n\r\nfunction fileExists(p: string): boolean {\r\n\treturn fs.existsSync(p) && fs.statSync(p).isFile();\r\n}\r\n\r\n// vswhere.exe 位置(默认 VS 安装目录下)\r\nfunction getVsWherePath(): string | null {\r\n\tconst defaultPath = path.join(\r\n\t\tprocess.env['ProgramFiles(x86)'] || 'C:\\\\Program Files (x86)',\r\n\t\t'Microsoft Visual Studio',\r\n\t\t'Installer',\r\n\t\t'vswhere.exe'\r\n\t);\r\n if (fileExists(defaultPath)) {\r\n\t\treturn defaultPath;\r\n\t} else {\r\n\t\t// init default static paths\r\n\t\tgetStaticVsInstallationPaths();\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\n// 调用 vswhere 获取 VS 安装路径\r\nfunction getVSInstallationPath(): string | null {\r\n\tconst vswhere = getVsWherePath();\r\n\tif (!vswhere) return null;\r\n\r\n\tconst result = spawnSync(vswhere, [\r\n\t\t'-latest',\r\n\t\t'-requires', 'Microsoft.Component.MSBuild',\r\n\t\t'-property', 'installationPath',\r\n\t\t'-products', '*',\r\n\t], {\r\n\t\tencoding: 'utf-8',\r\n\t});\r\n\r\n\tif (result.status !== 0) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst installPath = result.stdout.trim();\r\n\treturn installPath;\r\n}\r\n\r\nexport function findVsDevCmd(): string | null {\r\n\t// find by vswhere first\r\n\tconst installPath = getVSInstallationPath();\r\n\tif (installPath) {\r\n\t\tconst vsdev = path.join(installPath, 'Common7', 'Tools', 'VsDevCmd.bat');\r\n\t\tif (fileExists(vsdev)) {\r\n\t\t\treturn vsdev;\r\n\t\t}\r\n\t}\r\n\r\n\t// try static path\r\n\tconst subPath = path.join('Common7', 'Tools', 'VsDevCmd.bat');\r\n\r\n\tconst toolPath = getToolPath(subPath);\r\n\treturn toolPath;\r\n}\r\n\r\nexport function findMsBuild(): string | null {\r\n\tconst base = getVSInstallationPath();\r\n\tif (base) {\r\n\t\tconst is64Bit = process.arch === \"x64\" || process.arch === \"arm64\";\r\n\t\tconst pathPart = is64Bit ? 'amd64' : '';\r\n\t\tconst candidates = [\r\n\t\t\tpath.join(base, 'MSBuild', 'Current', 'Bin', pathPart, 'MSBuild.exe'),\r\n\t\t\tpath.join(base, 'MSBuild', '15.0', 'Bin', pathPart, 'MSBuild.exe'),\r\n\t\t];\r\n\t\tfor (const c of candidates) {\r\n\t\t\tif (fileExists(c)) return c;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tconst subPath = path.join('MSBuild', 'Current', 'Bin', 'MSBuild.exe');\r\n\tconst toolPath = getToolPath(subPath);\r\n\treturn toolPath;\r\n}\r\n\r\n// find vstest.console.exe\r\nexport function findVsTestConsole(): string | null {\r\n\tconst base = getVSInstallationPath();\r\n\tif (base) {\r\n\t\tconst candidates = [\r\n\t\t\tpath.join(base, 'Common7', 'IDE', 'CommonExtensions', 'Microsoft', 'TestWindow', 'vstest.console.exe'),\r\n\t\t\tpath.join(base, 'Common7', 'IDE', 'Extensions', 'TestPlatform', 'vstest.console.exe'),\r\n\t\t];\r\n\t\tfor (const c of candidates) {\r\n\t\t\tif (fileExists(c)) return c;\r\n\t\t}\r\n\t}\r\n\r\n\tconst subPath = path.join('Common7', 'IDE', 'CommonExtensions', 'Microsoft', 'TestWindow', 'vstest.console.exe');\r\n\tconst toolPath = getToolPath(subPath);\r\n\treturn toolPath;\r\n}\r\n\r\n// \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Team Tools\\Dynamic Code Coverage Tools\\CodeCoverage.exe\"\r\nexport function findCodeCoverage(): string | null {\r\n\tconst base = getVSInstallationPath();\r\n\tif (base) {\r\n\t\tconst codeCoveragePath = path.join(base, 'Team Tools', 'IDE', 'Dynamic Code Coverage Tools', 'CodeCoverage.exe');\r\n\t\tif (fileExists(codeCoveragePath)) return codeCoveragePath;\r\n\t}\r\n\r\n\tconst subPath = path.join('Team Tools', 'IDE', 'Dynamic Code Coverage Tools', 'CodeCoverage.exe');\r\n\tconst toolPath = getToolPath(subPath);\r\n\treturn toolPath;\r\n}\r\n\r\n// console.log('🔍 find Visual Studio tool path:');\r\n\r\n// const vsDev = findVsDevCmd();\r\n// const msbuild = findMsBuild();\r\n// const vstest = findVsTestConsole();\r\n\r\n// console.log('VsDevCmd.bat:', vsDev || 'Not found');\r\n// console.log('MSBuild.exe:', msbuild || 'Not found');\r\n// console.log('vstest.console.exe:', vstest || 'Not found');\r\n"]}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verifyTestCodeByVsPlugin = verifyTestCodeByVsPlugin;
|
|
4
|
-
const interactionConstants_1 = require("./interactionConstants");
|
|
5
|
-
const sendStdToVsPlugin_1 = require("./sendStdToVsPlugin");
|
|
6
|
-
const stdListener_1 = require("./stdListener");
|
|
7
|
-
async function verifyTestCodeByVsPlugin(testFilePath) {
|
|
8
|
-
return new Promise((resolve, reject) => {
|
|
9
|
-
// Todo: Add timeout handling to get rid of vs plugin crash issue
|
|
10
|
-
// const timeout = new Promise((_, reject) => {
|
|
11
|
-
// setTimeout(() => reject(new Error('timeout')), 5000);
|
|
12
|
-
// });
|
|
13
|
-
console.log("Sending verify test code command to VS plugin...");
|
|
14
|
-
(0, sendStdToVsPlugin_1.sendStdToVsPlugin)(interactionConstants_1.VERIFYTESTCODE, testFilePath);
|
|
15
|
-
console.log("Waiting for VERIFYTESTCODE event from VS plugin...");
|
|
16
|
-
stdListener_1.vsPluginEventEmitter.once(interactionConstants_1.VERIFYTESTCODE, (msg) => {
|
|
17
|
-
const verifyResult = handleVsVerifyCompletedEvent(msg);
|
|
18
|
-
if (!verifyResult) {
|
|
19
|
-
console.error("Failed to get verify result from VS plugin.");
|
|
20
|
-
reject({ success: false, message: undefined, buildErrors: undefined, testResult: undefined });
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
console.log("Test code verified by VS plugin.");
|
|
24
|
-
resolve(verifyResult);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
function handleVsVerifyCompletedEvent(msg) {
|
|
30
|
-
console.log("handling VS Verify Completed event:", msg);
|
|
31
|
-
if (!msg) {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
success: msg.success,
|
|
36
|
-
message: msg.message,
|
|
37
|
-
buildErrors: msg.buildErrors,
|
|
38
|
-
testResult: msg.testResult
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=getVsPluginVerifyResult.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getVsPluginVerifyResult.js","sourceRoot":"","sources":["../../src/vsPlugin/getVsPluginVerifyResult.ts"],"names":[],"mappings":";;AAKA,4DAsBC;AA3BD,iEAAwD;AAExD,2DAAwD;AACxD,+CAAqD;AAE9C,KAAK,UAAU,wBAAwB,CAAC,YAAoB;IAC/D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,iEAAiE;QACjE,+CAA+C;QAC/C,4DAA4D;QAC5D,MAAM;QAEN,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;QAChE,IAAA,qCAAiB,EAAC,qCAAc,EAAE,YAAY,CAAC,CAAC;QAEhD,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAClE,kCAAoB,CAAC,IAAI,CAAC,qCAAc,EAAE,CAAC,GAAG,EAAE,EAAE;YAC9C,MAAM,YAAY,GAAG,4BAA4B,CAAC,GAAG,CAAC,CAAC;YACvD,IAAI,CAAC,YAAY,EAAE,CAAC;gBAChB,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;gBAC7D,MAAM,CAAC,EAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAC,CAAC,CAAC;YAChG,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;gBAChD,OAAO,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,4BAA4B,CAAC,GAAG;IACrC,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;IACxD,IAAI,CAAC,GAAG,EAAE,CAAC;QACP,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO;QACH,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,UAAU,EAAE,GAAG,CAAC,UAAU;KAC7B,CAAC;AACN,CAAC","sourcesContent":["import { VERIFYTESTCODE } from \"./interactionConstants\";\r\nimport { VerifyResult } from \"../types/verifyResult\";\r\nimport { sendStdToVsPlugin } from \"./sendStdToVsPlugin\";\r\nimport { vsPluginEventEmitter } from \"./stdListener\";\r\n\r\nexport async function verifyTestCodeByVsPlugin(testFilePath: string): Promise<VerifyResult> {\r\n return new Promise((resolve, reject) => {\r\n // Todo: Add timeout handling to get rid of vs plugin crash issue\r\n // const timeout = new Promise((_, reject) => {\r\n // setTimeout(() => reject(new Error('timeout')), 5000);\r\n // });\r\n\r\n console.log(\"Sending verify test code command to VS plugin...\");\r\n sendStdToVsPlugin(VERIFYTESTCODE, testFilePath);\r\n\r\n console.log(\"Waiting for VERIFYTESTCODE event from VS plugin...\");\r\n vsPluginEventEmitter.once(VERIFYTESTCODE, (msg) => {\r\n const verifyResult = handleVsVerifyCompletedEvent(msg);\r\n if (!verifyResult) {\r\n console.error(\"Failed to get verify result from VS plugin.\");\r\n reject({success: false, message: undefined, buildErrors: undefined, testResult: undefined});\r\n } else {\r\n console.log(\"Test code verified by VS plugin.\");\r\n resolve(verifyResult);\r\n }\r\n });\r\n });\r\n}\r\n\r\nfunction handleVsVerifyCompletedEvent(msg): VerifyResult {\r\n console.log(\"handling VS Verify Completed event:\", msg);\r\n if (!msg) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n success: msg.success,\r\n message: msg.message,\r\n buildErrors: msg.buildErrors,\r\n testResult: msg.testResult\r\n };\r\n}\r\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INTERACTIONTAG = exports.VERIFYTESTCODE = void 0;
|
|
4
|
-
// interaction commands between vs plugin and csharp-ut-core
|
|
5
|
-
// these commands are used to communicate between the vs plugin and csharp-ut-core
|
|
6
|
-
exports.VERIFYTESTCODE = "__VERIFY_TEST_CODE__";
|
|
7
|
-
// interaction tag for logging
|
|
8
|
-
// this tag is used to identify the interaction messages in the logs
|
|
9
|
-
exports.INTERACTIONTAG = "__INTERACTION_TAG__";
|
|
10
|
-
//# sourceMappingURL=interactionConstants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interactionConstants.js","sourceRoot":"","sources":["../../src/vsPlugin/interactionConstants.ts"],"names":[],"mappings":";;;AAAA,4DAA4D;AAC5D,kFAAkF;AACrE,QAAA,cAAc,GAAG,sBAAsB,CAAC;AAErD,8BAA8B;AAC9B,oEAAoE;AACvD,QAAA,cAAc,GAAG,qBAAqB,CAAC","sourcesContent":["// interaction commands between vs plugin and csharp-ut-core\r\n// these commands are used to communicate between the vs plugin and csharp-ut-core\r\nexport const VERIFYTESTCODE = \"__VERIFY_TEST_CODE__\";\r\n\r\n// interaction tag for logging\r\n// this tag is used to identify the interaction messages in the logs\r\nexport const INTERACTIONTAG = \"__INTERACTION_TAG__\";"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function sendStdToVsPlugin(command: string, testFilePath: string): void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendStdToVsPlugin = sendStdToVsPlugin;
|
|
4
|
-
const interactionConstants_1 = require("./interactionConstants");
|
|
5
|
-
function sendStdToVsPlugin(command, testFilePath) {
|
|
6
|
-
const payload = {
|
|
7
|
-
command,
|
|
8
|
-
testFilePath
|
|
9
|
-
};
|
|
10
|
-
console.log(`[${interactionConstants_1.INTERACTIONTAG}] ${JSON.stringify(payload)}`);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=sendStdToVsPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sendStdToVsPlugin.js","sourceRoot":"","sources":["../../src/vsPlugin/sendStdToVsPlugin.ts"],"names":[],"mappings":";;AAEA,8CAMC;AARD,iEAAwD;AAExD,SAAgB,iBAAiB,CAAC,OAAe,EAAE,YAAoB;IACrE,MAAM,OAAO,GAAG;QACd,OAAO;QACP,YAAY;KACb,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,IAAI,qCAAc,KAAK,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { INTERACTIONTAG } from \"./interactionConstants\";\r\n\r\nexport function sendStdToVsPlugin(command: string, testFilePath: string) {\r\n const payload = {\r\n command,\r\n testFilePath\r\n };\r\n console.log(`[${INTERACTIONTAG}] ${JSON.stringify(payload)}`);\r\n}\r\n"]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.vsPluginEventEmitter = exports.readLineInterface = void 0;
|
|
7
|
-
exports.startStdListener = startStdListener;
|
|
8
|
-
const events_1 = __importDefault(require("events"));
|
|
9
|
-
const interactionConstants_1 = require("./interactionConstants");
|
|
10
|
-
const readline_1 = __importDefault(require("readline"));
|
|
11
|
-
function startStdListener() {
|
|
12
|
-
process.stdin.setEncoding('utf8');
|
|
13
|
-
exports.readLineInterface = readline_1.default.createInterface({ input: process.stdin });
|
|
14
|
-
exports.vsPluginEventEmitter = new events_1.default();
|
|
15
|
-
console.log("VS plugin std listener starting...");
|
|
16
|
-
exports.readLineInterface.on("line", async (line) => {
|
|
17
|
-
line = line.trim();
|
|
18
|
-
if (!line)
|
|
19
|
-
return;
|
|
20
|
-
try {
|
|
21
|
-
await handleMessage(line);
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
console.error(`Failed to parse message: ${line}`);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
exports.readLineInterface.on("close", () => {
|
|
28
|
-
console.error("readLineInterface closed. Node.js process exiting.");
|
|
29
|
-
process.exit(0);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async function handleMessage(line) {
|
|
33
|
-
try {
|
|
34
|
-
const msg = JSON.parse(line);
|
|
35
|
-
if (!msg?.command) {
|
|
36
|
-
console.log(`No command in msg: ${msg}`);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
console.log(`Received command: ${msg}`);
|
|
40
|
-
dispatchCommand(msg);
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
console.log("invalid JSON: " + line);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async function dispatchCommand(msg) {
|
|
48
|
-
switch (msg.command) {
|
|
49
|
-
case interactionConstants_1.VERIFYTESTCODE:
|
|
50
|
-
console.log("Received VERIFYTESTCODE command response." + JSON.stringify(msg));
|
|
51
|
-
exports.vsPluginEventEmitter.emit(interactionConstants_1.VERIFYTESTCODE, msg);
|
|
52
|
-
break;
|
|
53
|
-
default:
|
|
54
|
-
console.log(`Unknown command: ${msg.command}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=stdListener.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stdListener.js","sourceRoot":"","sources":["../../src/vsPlugin/stdListener.ts"],"names":[],"mappings":";;;;;;AA0BA,4CAqBC;AA/CD,oDAAkC;AAClC,iEAAwD;AACxD,wDAAgC;AAwBhC,SAAgB,gBAAgB;IAC5B,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,yBAAiB,GAAI,kBAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACxE,4BAAoB,GAAG,IAAI,gBAAY,EAAE,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAElD,yBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACxC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,IAAI,CAAC,IAAI;YAAE,OAAO;QAElB,IAAI,CAAC;YACD,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;QACtD,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,yBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QAC/B,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC;AAGD,KAAK,UAAU,aAAa,CAAC,IAAY;IACrC,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAE7B,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,EAAE,CAAC,CAAC;YACzC,OAAO;QACX,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;QACxC,eAAe,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;QACrC,OAAO;IACX,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,GAAG;IAC9B,QAAQ,GAAG,CAAC,OAAO,EAAE,CAAC;QAClB,KAAK,qCAAc;YACf,OAAO,CAAC,GAAG,CAAC,2CAA2C,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/E,4BAAoB,CAAC,IAAI,CAAC,qCAAc,EAAE,GAAG,CAAC,CAAC;YAC/C,MAAM;QAEV;YACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;AACL,CAAC","sourcesContent":["import EventEmitter from \"events\";\r\nimport { VERIFYTESTCODE } from \"./interactionConstants\";\r\nimport readline from 'readline';\r\n\r\n// export function startStdListener() {\r\n// console.log(\"VS plugin std listener starting...\");\r\n\r\n// process.stdin.setEncoding('utf8');\r\n\r\n// let buffer = '';\r\n// process.stdin.on('data', async (chunk: string) => {\r\n// buffer += chunk;\r\n// let newlineIndex: number;\r\n// while ((newlineIndex = buffer.indexOf('\\n')) >= 0) {\r\n// const line = buffer.slice(0, newlineIndex).trim();\r\n// buffer = buffer.slice(newlineIndex + 1);\r\n// if (line) {\r\n// handleMessage(line)\r\n// }\r\n// }\r\n// });\r\n// }\r\n\r\nexport let readLineInterface;\r\nexport let vsPluginEventEmitter;\r\n\r\nexport function startStdListener() {\r\n process.stdin.setEncoding('utf8');\r\n readLineInterface = readline.createInterface({ input: process.stdin });\r\n vsPluginEventEmitter = new EventEmitter();\r\n console.log(\"VS plugin std listener starting...\");\r\n\r\n readLineInterface.on(\"line\", async (line) => {\r\n line = line.trim();\r\n if (!line) return;\r\n\r\n try {\r\n await handleMessage(line);\r\n } catch (err: any) {\r\n console.error(`Failed to parse message: ${line}`);\r\n }\r\n });\r\n\r\n readLineInterface.on(\"close\", () => {\r\n console.error(\"readLineInterface closed. Node.js process exiting.\");\r\n process.exit(0);\r\n });\r\n}\r\n\r\n\r\nasync function handleMessage(line: string) {\r\n try {\r\n const msg = JSON.parse(line);\r\n\r\n if (!msg?.command) {\r\n console.log(`No command in msg: ${msg}`);\r\n return;\r\n }\r\n\r\n console.log(`Received command: ${msg}`);\r\n dispatchCommand(msg);\r\n } catch {\r\n console.log(\"invalid JSON: \" + line);\r\n return;\r\n }\r\n}\r\n\r\nasync function dispatchCommand(msg) {\r\n switch (msg.command) {\r\n case VERIFYTESTCODE:\r\n console.log(\"Received VERIFYTESTCODE command response.\" + JSON.stringify(msg));\r\n vsPluginEventEmitter.emit(VERIFYTESTCODE, msg);\r\n break;\r\n\r\n default:\r\n console.log(`Unknown command: ${msg.command}`);\r\n }\r\n}"]}
|