本文整理汇总了TypeScript中ensime-client.dotEnsimeUtils类的典型用法代码示例。如果您正苦于以下问题:TypeScript dotEnsimeUtils类的具体用法?TypeScript dotEnsimeUtils怎么用?TypeScript dotEnsimeUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了dotEnsimeUtils类的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)
})
})
}
开发者ID:hedefalk,项目名称:ensime-vscode,代码行数:45,代码来源:extension.ts
示例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, )
};
开发者ID:felixfbecker,项目名称:ensime-vscode,代码行数:38,代码来源:ensime.ts
示例3: stopInstance
function stopInstance(dotEnsimePath: string) {
ensimeClient.dotEnsimeUtils.parseDotEnsime(dotEnsimePath).then((dotEnsime) => {
instanceManager.stopInstance(dotEnsime)
});
}
开发者ID:ensime,项目名称:ensime-vscode,代码行数:5,代码来源:extension.ts
注:本文中的ensime-client.dotEnsimeUtils类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论