本文整理汇总了TypeScript中ensime-client.dotEnsimeUtils.parseDotEnsime方法的典型用法代码示例。如果您正苦于以下问题:TypeScript dotEnsimeUtils.parseDotEnsime方法的具体用法?TypeScript dotEnsimeUtils.parseDotEnsime怎么用?TypeScript dotEnsimeUtils.parseDotEnsime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ensime-client.dotEnsimeUtils
的用法示例。
在下文中一共展示了dotEnsimeUtils.parseDotEnsime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: startInstance
function startInstance(dotEnsimePath: string) {
mainLog.debug('starting instance: ', dotEnsimePath)
ensimeClient.dotEnsimeUtils.parseDotEnsime(dotEnsimePath).then((dotEnsime) => {
let typechecking = undefined
let statusbarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left)
statusbarItem.text = "ENSIME"
statusbarItem.show()
const ensimeConfig = vscode.workspace.getConfiguration('Ensime')
const ensimeServerVersion = ensimeConfig.get('ensimeServerVersion').toString()
mainLog.debug('ensime server version from config: ', ensimeServerVersion);
startClient(dotEnsime, ensimeServerVersion, statusbarOutput(statusbarItem, typechecking)).then((connection) => {
vscode.window.showInformationMessage("Got a connection with ensime server!")
mainLog.debug('got a connection, creating instance')
const instance = ensimeClient.makeInstanceOf(dotEnsime, connection, null)
instanceManager.registerInstance(instance)
if (! activeInstance)
activeInstance = instance
vscode.window.showInformationMessage("Ensime connected!")
TypeCheck.register(instanceManager)
const hoverProvider = TypeHoverProvider.hoverProvider(instanceManager)
typeHover = vscode.languages.registerHoverProvider('scala', hoverProvider);
completionsDisposable = vscode.languages.registerCompletionItemProvider('scala', Completions.completionsProvider())
vscode.languages.registerDefinitionProvider('scala', Definitions.definitionsProvider(instanceManager))
instanceManager.registerInstance(instance)
if (!activeInstance) {
activeInstance = instance
}
connection.post({"typehint":"ConnectionInfoReq"}).then( (msg) => {})
switchToInstance(instance)
}, (failure) => {
mainLog.error(failure)
})
})
}
示例2: function
const onSelectedDotEnsime = (dotEnsimePath: string) => {
console.log(dotEnsimePath)
let dotEnsime = EnsimeClient.dotEnsimeUtils.parseDotEnsime(dotEnsimePath);
console.log(dotEnsime);
const serverStarter = function(parsedDotEnsime: EnsimeClient.DotEnsime, pidCallback: (string) => void) {
console.log("hej server!");
if (!fs.existsSync(parsedDotEnsime.cacheDir)) {
fs.mkdirSync(parsedDotEnsime.cacheDir);
}
const ensimeServerVersion = config.get("ensime.serverVersion", "0.9.10-SNAPSHOT");
// ensimeServerFlags = atom.config.get('Ensime.ensimeServerFlags')
const ensimeServerFlags = "";
const assemblyJar = mkAssemblyJarFileName(parsedDotEnsime.scalaEdition, ensimeServerVersion);
if(fs.existsSync(assemblyJar))
EnsimeClient.startServerFromAssemblyJar(assemblyJar, parsedDotEnsime, ensimeServerFlags, pidCallback);
else {
const cpF = mkClasspathFileName(parsedDotEnsime.scalaVersion, ensimeServerVersion);
const startFromCPFile =
() => EnsimeClient.startServerFromFile(cpF, parsedDotEnsime, ensimeServerFlags, pidCallback);
if(! classpathFileOk(cpF)) {
const nottin = (s: string, i: string) => {};
const pidLogger = () => (string) => {};
const serverUpdater =
EnsimeClient.ensimeServerUpdate(updateDir(), pidLogger, nottin);
// EnsimeClient.ensimeServerUpdate(parsedDotEnsime, ensimeServerVersion, cpF, startFromCPFile);
} else
startFromCPFile();
}
};
const startClient = EnsimeClient.ensimeClientStartup(serverStarter);
// startClient(dotEnsime, )
};
示例3: stopInstance
function stopInstance(dotEnsimePath: string) {
ensimeClient.dotEnsimeUtils.parseDotEnsime(dotEnsimePath).then((dotEnsime) => {
instanceManager.stopInstance(dotEnsime)
});
}