Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const vscode_languageserver_1 = require("vscode-languageserver");
const vscode_uri_1 = require("vscode-uri");
const Export_1 = require("./commands/Export");
const DocumentSymbolsPlugin_1 = require("./providers/DocumentSymbolsPlugin");
const index_1 = require("./providers/index");
const node_1 = require("@argdown/node");
const EXPORT_CONTENT_COMMAND = "argdown.server.exportContent";
const EXPORT_DOCUMENT_COMMAND = "argdown.server.exportDocument";
const RUN_COMMAND = "argdown.run";
// Create a connection for the server. The connection uses Node's IPC as a transport
let connection = vscode_languageserver_1.createConnection(vscode_languageserver_1.ProposedFeatures.all);
node_1.argdown.logger.log = function (level, message) {
if (level != "verbose" || this.logLevel == "verbose") {
connection.console.log(message);
}
};
let hasConfigurationCapability = false;
let hasWorkspaceFolderCapability = false;
// Create a simple text document manager. The text document manager
// supports full document sync only
let documents = new vscode_languageserver_1.TextDocuments();
let workspaceFolders;
// After the server has started the client sends an initilize request. The server receives
// in the passed params the rootPath of the workspace plus the client capabilites.
connection.onInitialize((params) => {
let capabilities = params.capabilities;
connection.console.log("Node version: " + process.version);
// Does the client support the `workspace/configuration` request?
} else {
config.process.push("save-svg-as-pdf");
}
}
if (args.stdout) {
if (format === "dot") {
config.process.push("stdout-dot");
} else if (format === "graphml") {
config.process.push("stdout-graphml");
} else {
// pdf and png to stdout is currently not supported
config.process.push("stdout-svg");
}
}
await argdown.load(config).catch(e => console.log(e));
};
exports.handler = async (argv) => {
const processName = argv.process || "default";
let config = await node_1.argdown.loadConfig(argv.config);
config.process = processName;
config.logLevel = argv.verbose ? "verbose" : config.logLevel;
config.watch = argv.watch || config.watch;
config.logParserErrors = argv.logParserErrors || config.logParserErrors;
await node_1.argdown.load(config).catch(e => console.log(e));
};
//# sourceMappingURL=RunCommand.js.map
config.logLevel = argv.verbose ? "verbose" : config.logLevel;
config.watch = argv.watch || config.watch;
config.process = ["load-file", "parse-input"];
config.logParserErrors = argv.logParserErrors || config.logParserErrors;
if (config.logParserErrors) {
config.process.push("log-parser-errors");
}
config.process.push("build-model");
config.process.push("export-json");
if (!argv.stdout || argv.outputDir) {
config.process.push("save-as-json");
}
if (argv.stdout) {
config.process.push("stdout-json");
}
await node_1.argdown.load(config).catch(e => console.log(e));
};
//# sourceMappingURL=JSONCommand.js.map
else if (format === "svg") {
config.process.push("save-svg-as-svg");
}
else {
config.process.push("save-svg-as-pdf");
}
}
if (argv.stdout) {
if (format === "dot") {
config.process.push("stdout-dot");
}
else {
config.process.push("stdout-svg");
}
}
await node_1.argdown.load(config).catch(e => console.log(e));
};
//# sourceMappingURL=MapCommand.js.map
config.inputPath = argv.inputGlob;
}
config.saveAs = config.saveAs || {};
if (argv.outputDir) {
config.saveAs.outputDir = argv.outputDir;
}
config.logLevel = argv.verbose ? "verbose" : config.logLevel;
config.watch = argv.watch || config.watch;
config.process = ["load-file"];
if (!argv.stdout || argv.outputDir) {
config.process.push("save-as-argdown");
}
if (argv.stdout) {
config.process.push("stdout-argdown");
}
await node_1.argdown.load(config).catch((e) => console.log(e));
};
//# sourceMappingURL=CompileCommand.js.map
export const handler = async (args: Arguments) => {
let config = await argdown.loadConfig(args.config);
config.logLevel = args.verbose ? "verbose" : config.logLevel;
config.watch = args.watch || config.watch;
config.logParserErrors = args.logParserErrors || config.logParserErrors;
await argdown.load(config).catch(e => console.log(e));
};
export const handler = async (
args: Arguments
) => {
const processName = args.process || "default";
let config = await argdown.loadConfig(args.config);
config.process = processName;
config.logLevel = args.verbose ? "verbose" : config.logLevel;
config.watch = args.watch || config.watch;
config.logParserErrors = args.logParserErrors || config.logParserErrors;
await argdown.load(config).catch(e => console.log(e));
};
export const handler = async (args: Arguments) => {
let config = await argdown.loadConfig(args.config);
config.logLevel = args.verbose ? "verbose" : config.logLevel;
config.watch = args.watch || config.watch;
config.logParserErrors = args.logParserErrors || config.logParserErrors;
await argdown.load(config).catch(e => console.log(e));
};
}
config.saveAs = config.saveAs || {};
if (args.outputDir) {
config.saveAs.outputDir = args.outputDir;
}
config.logLevel = args.verbose ? "verbose" : config.logLevel;
config.watch = args.watch || config.watch;
config.process = ["load-file"];
if (!args.stdout || args.outputDir) {
config.process.push("save-as-argdown");
}
if (args.stdout) {
config.process.push("stdout-argdown");
}
await argdown.load(config).catch((e: Error) => console.log(e));
};