Open PatrickMassot opened 6 years ago
Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.
The Oni object in the dev tools is available as Oni
, i.e. Oni.language.isLanguageServerAvailable('lean')
. I think someone more knowledgeable will have to help you with the language server issues though. I agree that the plugin API has a low documentation area, but there are some good examples here: https://github.com/onivim/oni/tree/master/vim/core
Thanks @parkerault, but I'm closing this for now. There is no point discussing such fancy features as long as Oni is not yet usable as a basic text editor (see #2140 ).
Well, it is an alpha, but I've been using Oni for all of my professional work for the last two months without any major hiccups.
Ok, there is a workaround to #2140, so let's say fancy features could make sense, and reopen that issue.
Hi @PatrickMassot ,
Glad @CrossR got you unblocked with #2140 😄
Your configuration looks solid - a good next step would be to open the developer tools:
Control+Shift+P
to open the Command PaletteDebug: Open Developer Tools
And then open up a lean
file - it'd be interesting to see if there are any errors / warnings there.
Trying the command @parkerault mentioned is a good starting point:
Oni.language.isLanguageServerAvailable('lean')
Running this command is a good sanity check too:
Oni.editors.activeEditor.activeBuffer.language
That should return lean
- if it isn't, then the syntax highlighting / language server definitely won't work.
Let me know if you see any errors in the console when you try those steps. I hope that we can implement some better error handling around here to make it easier / more user friendly to hook this.
And long-term, I'd like to be able to grab the grammars+language service from VSCode plugins, so you could just use the vscode-lean
plugin directly with Oni, w/o needing to manually configure.
Thanks for your comments. Oni.language.isLanguageServerAvailable('lean')
and Oni.editors.activeEditor.activeBuffer.language
are both ok, I do see in the lower left corner of Oni the word lean next to some "turning almost circle" suggesting something is running (by the way I noticed this indicator earlier when using vimtex and I find it somewhat misleading, to me it sounds like something is not loaded yet and I should wait). More importantly, there is indeed some lean --server
process running.
I understood my "After a rather long time, some syntax highlighting appears". When I launch Oni and then open a .lean
file, Oni needs some cursor movement to start syntax highlighting. I guess this will be pretty easy to fix on your side.
But I still have very partial syntax highlighting. And option editor.textMateHighlighting.debugScopes
seems to have no effect whatsoever. This is really my main question so far: what is this option meant to do?
And also, knowing that the syntax file is https://github.com/leanprover/vscode-lean/blob/master/syntaxes/lean.json should I see something or should I provide some sort of theme color file somewhere? What confuses me is I see no such thing in the vscode-lean repo, I have no idea how VScode decides which color to use.
And about LSP, I also have no idea what is meant to work out of the box and what is meant to require some specific coding.
I'm trying to get language support for Vala in Oni, through the Vala Language Server. However, when I open vala files, the language is set to image
and not vala
as it should (checking through Oni.editors.activeEditor.activeBuffer.language
). Oni does recognize that Vala is available though (Oni.language.isLanguageServerAvailable('vala') == true
).
Here's my configuration:
export const configuration = {
"editor.textMateHighlighting.enabled": true,
"ui.colorscheme": "nord",
"language.vala.languageServer.command": "/home/solarliner/.local/bin/vala-language-server",
"language.vala.textMateGrammar": "/home/solarliner/.config/oni/plugins/vala/syntaxes/vala.tmLanguage",
// UI customizations
"ui.animations.enabled": true,
"ui.fontSmoothing": "auto",
}
Hey @SolarLiner, there was a similar issue to yours over in #2038.
Oni has an image
buffer (for showing images) and it looks like there is some form of bug where if vim doesn't know what the filetype is, Oni somehow defaults to swapping to setting it to image
instead.
There is a workaround outlined in the linked issue, but I've seen it on some common filetypes too like CSVs. I'm going to try and have a look into it over these next few days again and see if I can work out where its being set.
I just discovered Oni and I would like to give it a try because I've been using vim for 15 years but I've recently been forced to use VScode because of its Lean prover support. Of course I would much prefer using vim than VScode. Oni seems to make it much easier to port something from VScode to vim than using regular vim. Here Lean support means (syntax highlighting and) Language Server Protocol: https://github.com/leanprover/vscode-lean. It seems Oni has all it takes, except maybe documentation.
Here is what I tried, mostly mimicking stuff I saw in existing codebase:
~/.config/oni/plugins/lean/ftdetect/lean.vim
containingau BufRead,BufNewFile *.lean set filetype=lean
~/.config/oni/plugins/lean/syntax/
and copy https://github.com/leanprover/vscode-lean/blob/master/syntaxes/lean.json there~/.config/oni/config.js
containing(I don't know where to put that in
plugins/lean
so I use globale variables for now). Now, when I open a.lean
file,filetype
get set tolean
and somelean --server
process is started. That's encouraging. After a rather long time, some syntax highlighting appears, but very partial. Only function names get highlighted. The optioneditor.textMateHighlighting.debugScopes
seems to have no effect whatsoever. If I add toconfig.js
the linesI get some green color showing up (in reasonable and random places). Do you understand what happens? Am I missing some existing doc? What you I go from there? How to interact with the LSP serve?
Side note: finishing the sentence "You can access the Oni object directly, ie:" at the end of https://github.com/onivim/oni/wiki/Plugins#api would probably already help.
Thank you very much for your work on Oni!