onivim / oni2

Native, lightweight modal code editor
https://v2.onivim.io
MIT License
7.77k stars 274 forks source link

VSCode Extension Host Integration #1058

Open bryphe opened 4 years ago

bryphe commented 4 years ago

This is a top-level issue tracking all of the VSCode extension host integration

High-level feature view

Category API Implemented UI Integrated Notes
Activation Events Partial N/A Need to handle additional events (onWorkspace:, etc)
DIscovery (Searching for Extensions) Implemented against https://open-vsx.org
Extension Management
Extension Auto-Update
Extension Deltas No - needed for auto-activation after install
TextMate Grammars
Authentication Not yet implemented
Color Themes No
Console
Commands
Comments Not yet implemented
Debugger Support
Configuration Partial No
Dialogs Partial Partial Not yet implemented
Diagnostics
DocumentContentProvider
Documents
Editor Insert Needs HTML renderer / CEF
Errors
File System Provider N/A N/A
Language Features: Auto-Closing Pairs Partial N/A
Language Features: Auto-Indent Partial N/A
Language Features: Code Actions
Language Features: Codelens
Language Features: Code Inset
Language Features: Color Provider
Language Features: Completion Needs snippet integration
Language Features: Diagnostics
Language Features: Document Symbol
Language Features: Dynamic Language Configuration
Language Features: Find-all References
Language Features: Folding Range
Language Features: Go-to Definition
Language Features: Document Formatting
Language Features: Range Formatting
Language Features: As-you-type formatting
Language Features: Hover
Language Features: Call Hierarchy
Language Features: References Needs to handle resolve positions for UI
Language Features: Renaming
Language Features: Semantic Tokens #3370
Language Features: Signature Help
Language Features: Workspace Symbol
Languages
Notebooks
QuickOpen Partial Partial Choice menu is integrated, but input and validation is not
Remote Extensions
Search
Source Control: Pane Tracking in #1011
Source Control: Diff View
Snippets
Status Bar No
Tasks
Text Editors Partial N/A - Decorations tracked in #3189
Telemetry We don't collect or store telemetry
Terminal Partial No Need to handle $createTerminal for REPL integration
Timeline
Tree Views Tracking in #3126
Tunnel Service
URLs
Virtual File Systems (Plugin Provided) Partial
Webviews Tracked in #3128
Workspace Partial N/A need to handle multi-root and additional APIs (search results)

Tested plugins

Plugin Name Status Notes
Built-in markdown language server
Built-in json language server
Built-in html language server
Built-in css-language-server
Built-in javascript/typescript language server
vscode-auto-close-tag Blocked by https://github.com/onivim/oni2/issues/2257
reason-language-server Bundled
Emmet Bundled
Python: ms-python.python Needs to be run with virtualenv activate, in project root
C/C++: clangd OSX only?
C/C++: exuberant-ctags
Elm: elmtooling.elm-ls-vscode
JS / TS: prettier
OCaml / Reason: ocaml-lsp See instructions: https://onivim.github.io/docs/languages/reason-ocaml
muhammad-sammy.csharp
redhat.java
maktlad.rust-analzyer
eamodio.gitlens Blocked by missing language features
golang.Go
vetur Blocked by #1174
vscode-elixir Not tested yet
jpinnix commented 4 years ago

Thank you so much for this! Super helpful!

jtsiros commented 4 years ago

Great work! I've been excited about the vscode extension host integration.

yunti commented 4 years ago

Will code folding come in as part of LSP support or eg textmate grammars?

CrossR commented 4 years ago

I think we have multiple locations we can take folding from: LSP does implement it, there is some part in the VSCode grammars (language-configuration.json mentions folding) and then also tree-sitter could be used as well (for AST based folding).

jtsiros commented 4 years ago

Does anyone know if vscode-go works with the latest nightly? I have gopls installed along with the following configuration:

gopls version
golang.org/x/tools/gopls 0.2.2
    golang.org/x/tools/gopls@v0.2.2 h1:ujGisyytgY1VGcmd66wIJ9+wVAfmodXj6daHM43HRXk=

Oni config:

"[go]": {
        "editor.snippetSuggestions": "none",
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        }
    },
    "gopls": {
        "usePlaceholders": true, // add parameter placeholders when completing a function
        "completeUnimported": true, // autocomplete unimported packages
        "watchFileChanges": true, // watch file changes outside of the editor
        "deepCompletion": true, // enable deep completion
        "hoverKind": "FullDocumentation"
    }

Extensions installed:

oni2 --list-extensions
Go
one-monokai
gitlens
theme-github

Autocomplete doesn't seem to work out of the box for it.

bryphe commented 4 years ago

Haven't tested it, yet! I've added it to our list in the above issue, though.

Thanks for the details, @jtsiros - likely #1157 is impacting this, but there may be other issues too past that.

edisonywh commented 4 years ago

Does VSCode work with the Dart/Flutter LS? There's some heavy lag when using the vim plugin and the Dart extension together on VSCode (due to some autocompleting filtering apparently, tracked here).

Just want to find out if Onivim has that integration!

Falconerd commented 4 years ago

@edisonywh If you manage to get a flutter + onivim2 setup working please share! That issue with VSCode frustrated me enough to seek alternatives (hence here I am)

edisonywh commented 4 years ago

@Falconerd unfortunately I did not manage to get it to work, but I decided to try out VSCode Insider and that performs a lot better with Flutter, so I'm using that right now, hope that helps!

gitbugr commented 4 years ago

vscode-intelephense partially works. goto definition works, autocomplete and others don't

sekunho commented 4 years ago

For Elixir vscode-elixir isn't maintained anymore. vscode-elixir-ls is the replacement and it's still active.

https://github.com/elixir-lsp/vscode-elixir-ls https://marketplace.visualstudio.com/items?itemName=JakeBecker.elixir-ls

andrewrynhard commented 4 years ago

Are there any plans to test vscode-go any time soon? Happy to help if I can. I have it installed along with gopls, but nothing seems to happen. Tried enabling trace logging, and I'm not seeing anything of interest.

dannyfritz commented 4 years ago

Will this cover virtual documents? https://code.visualstudio.com/api/extension-guides/virtual-documents

steveklabnik commented 4 years ago

I tested the rust-analyzer extension today, and it doesn't work yet. Given the chart above, I wouldn't expect it to, but figured I'd leave a comment anyway, in case anyone else gives it a shot.

tofulm commented 4 years ago

I use PHP Intelephense. is it possible to define a "rootPatterns" like coc.nvim

Ok => #729

jirmonder commented 4 years ago

Tested Emmet on 0.4.0 installed with the new plugin installation support, it installed without trouble, but it wouldn't work on use

jirmonder commented 4 years ago

Tested Auto Close Tag on 0.4.0 installed with the new plugin installation support, it installed without trouble, but it wouldn't work on use

bryphe commented 4 years ago

Sorry for the slow reply!

@steveklabnik - cool to see you here. I'm a big fan of your blog and work on Rust! I tested the latest build with rust-analyzer and it seems to be working now:

image

At the time you wrote the comment, the $download API hadn't been implemented. There was also an issue where we weren't the releaseTag correctly: https://github.com/open-vsx/publish-extensions/issues/106 Seems like it's working now (on OSX). I hope I can find occasion to use it, feels really nice!

@tofulm - yep, still need to implement multi-root workspaces 👍

@jirmonder - thanks for testing Emmet and Auto-Close Tag! I opened a PR tracking some of the issues needed to be addressed for Emmet: https://github.com/onivim/oni2/pull/2244 (And #1948 is tracking it). Will exercise some additional capabilities we need for completion.

I looked at Auto-Close Tag - and it's actually a bug in Onivim. We're sending buffer updates line-wise in a way that the logic where it checks for the 'closing' tag: https://github.com/formulahendry/vscode-auto-close-tag/blob/f0129c2b1179718dae927082720dd9c7cf127927/src/extension.ts#L104 isn't working as expected. It's been on my list for a while to streamline buffer updates / content changes (for perf) - a bonus will be, the content changes should be in the correct format for that plugin. Opened #2257 to track

carloscoves commented 4 years ago

I tried vscode-styled-components but it does not work

adamlwomble commented 4 years ago

Firstly, I'm a big fan of Onivim 2! Thank you (collectively) for undertaking such a wonderful project.

Secondly, while trying to install the muhammad-sammy.csharp extension, I received an error:

Command $> oni2 --install-extension muhammad-sammy.csharp Error Failed to install extension: muhammad-sammy.scharp

Troubleshooting

  1. My Onivim2 version is 0.5.1-nightly
  2. I am on Windows 10, Version 2004 (OS Build 19041.450).
  3. I tried installing the extension in Windows PowerShell running as Administrator.
  4. The oni2 executable is available in Windows PowerShell.
  5. The extension seems to be in good health on the Open VSX Registry.

Any idea how I should continue troubleshooting?

kakamorsch commented 4 years ago

Great job, I'm loving to do some of my personal things on Oni2 it's so blazing fast, but I can't use it for my work because of the Vetur, is there any estimate time to make it work?

CrossR commented 4 years ago

@adamlwomble opening a new issue would be good, with the output from oni2 -f --install-extension... etc, (-f keeps Oni2 printing info to the current terminal). Also, does the same issue happen when using the in-editor extension installer (side bar, should be able to search for c# and install it there).

https://onivim.github.io/docs/configuration/extensions

For Vetur, I think it will depend on the specific issue you are seeing. Running oni2 -f --debug to get an idea of the issue, then searching to see if there is another related issue can be a good start. We can then also try and understand how involved a fix would be. Sometimes its as basic as an extension asking for/reporting something back in a slightly non-standard way, where a fix is pretty quick to make a response field optional or something. Other times it will be a bigger change or missing feature.

adamlwomble commented 4 years ago

@CrossR, per your advice, I plan to open a new Issue; I hesitated to open a new Issue because I do not want to bloat the Issues list.

The same issue does happen, with a twist on behavior, when using the in-editor extension installer: though it appears to have successfully installed the extension, closing the editor, then reopening it reveals the extension installation failed.

kakamorsch commented 4 years ago

@CrossR, the error that I get every time I open a vue file is this: image

In the editor you can see that something is wrong, because the files lose the text highlight.

bryphe commented 4 years ago

@kakamorsch - ah, looks like the extension is missing some build output (from the error, it seems the compiled javascript isn't present!)

I opened a PR on open-vsx to fix it: https://github.com/open-vsx/publish-extensions/pull/146

With that... it seems to work: image

(There is one issue we're tracking with syntax highlighting, besides that: https://github.com/onivim/oni2/issues/1174)

kakamorsch commented 4 years ago

Thanks for the quick response @bryphe, I'm looking foward to use it as my daily driver.

prees1 commented 3 years ago

Not sure if this is the place to mention it or not. Would love to be able to use the Calva extension, if not all of its capabilities at least some of them. - https://open-vsx.org/extension/betterthantomorrow/calva

HealsCodes commented 3 years ago

Without trying to sound negative but it's been a year without much visible progress so I'll ask flat out: will the VSExtension Host ever work properly or was it a bit too ambitious of an attempt to finish in the time put out for it?

What we have right now is a patchwork capable of running only the most basic extensions baring a few select which are either required by the developers or for which users have complained loud enough and asked for proper support.

OniVim2 states that language support will be implemented via extensions only but what use is it if you can't even configure those extensions (yet)? I get that providing a configuration UI isn't trivial but why not at least expose a way for the experienced user to edit extension configuration files at all - given support for configuration parameters is implemented?

Looking at the current official timeline extension support getting any better is looking more and more doubtful :(

bryphe commented 3 years ago

@Shirk - what plugins have you tried that didn't work? I would love to track these issues!

And are you building from source, or using the builds from the early access portal? A step often missed when building from source is running node install-node-deps.js - without this, the extension host won't run at all.

More specific replies below:

it's been a year without much visible progress

FYI, Our August release (4 months ago) - 0.5.0 - was focused at unblocking the next round of extensions, and integrating more capabilities - some more details here: https://www.patreon.com/posts/40303878

Since that big push 4 months ago, which unblocked several extensions - we've had ~40 PRs related to extension host: https://github.com/onivim/oni2/pulls?page=1&q=is%3Apr+extension+is%3Aclosed https://github.com/onivim/oni2/pulls?q=is%3Apr+exthost+is%3Aclosed+

...not only that, I continue to patch extensions for open-vsx that are missing functionality: https://github.com/open-vsx/publish-extensions/pulls?q=is%3Apr+author%3Abryphe+is%3Aclosed

Besides extension compatibility, we also have been balancing adding more features - signature help, hover (as part of the 0.5.0) release, and soon codelens, snippets, code actions, rename - with broadening compatibility.

It is a lot of work to be sure! But there is continual progress being made.

In terms of messaging - in 2021 I plan on releasing monthly stable builds and updates. So hopefully the progress we're making is more visible. I also need to do better at keeping this issue up-to-date with the latest status.

What we have right now is a patchwork capable of running only the most basic extensions baring a few select which are either required by the developers or for which users have complained loud enough and asked for proper support.

Being a solo developer, it can be tough to juggle all the priorities - I wish I could snap my fingers and have every extension work perfectly. However, with ~900 plugins on open-vsx - I have to prioritize - so I work through issues blocking extensions that people ask for - the good news is that these tend to be common issues that unblock other issues. Would be great to track the ones you had issues with.

I get that providing a configuration UI isn't trivial but why not at least expose a way for the experienced user to edit extension configuration files at all - given support for configuration parameters is implemented?

Plugins can be manually configured today - using the same user json file (should be better documented).

As an example - here's some details on configuring the Dart extension using configuration.json: https://github.com/onivim/oni2/issues/2411#issuecomment-725753042 Works for other plugins too

Keep in mind that Onivim is still alpha; but I do want to support the extensions / features / functionality that our users need - it would be very helpful to track the specific issues you're hitting, or extensions that aren't working. (And for existing issues - adding a :+1: helps it bubble up on our priority list)

mabasic commented 3 years ago

I have installed File Utils by sleistner, but when I go File Utils: Duplicate it does not show the prompt as VS Code does, so I cannot use it. Should I open a issue for this or ?

jaidetree commented 3 years ago

Not sure if this is the place to mention it or not. Would love to be able to use the Calva extension, if not all of its capabilities at least some of them. - https://open-vsx.org/extension/betterthantomorrow/calva

+1 for me, onivim is lookin' real slick so far. If it can support mature Clojure tooling out-of-the-box from the VS Code community then that would be a major win for me.

nerdo commented 3 years ago

The more mature onivim gets, the more excited I get. I've been using the vscode neovim plugin for a while and continue to get frustrated by its bugginess and resort to opening (neo)vim directly to make some changes to files more efficiently without the vscode integration getting in my way.

One vscode extension that I'm hoping 🤞🏾 will work with onivim is wallaby.js. It's become an indispensable to my test driven workflow whenever I work with JS/TS applications.

Last time I tried it, it loaded, but didn't actually work, probably because it relies on some features not yet implemented by the extension host... but I hoping it will work when all is said and done 😅

bryphe commented 3 years ago

Thanks @nerdo ! Was just checking this out - it is a really cool extension - real-time test feedback is amazing.

I saw you already logged an issue on the wallaby repo: https://github.com/wallabyjs/public/issues/2436 - appreciate it!

In terms of Onivim support - it looks like it uses a few APIs that we don't support yet:

likern commented 3 years ago

Tried to use onivim as a main editor for React Native development (Javascript / Typescript). At first glance looks very promising, very like it.

But quickly I've found the main major blocker for me. In modern JS we export / reexport symbols from modules like this

// test.ts file
export const test = () => {};
// index.ts
export { test } from './test'
// other.ts
import { test } from './test'

So renaming test requires to rename it in all other files where symbol was imported / re-exported. I can live without many features, but this one is just a workflow breaking.

bryphe commented 3 years ago

Tried to use onivim as a main editor for React Native development (Javascript / Typescript). At first glance looks very promising, very like it.

Awesome @likern !

So renaming test requires to rename it in all other files where symbol was imported / re-exported. I can live without many features, but this one is just a workflow breaking.

I'm actually looking at working on the rename functionality for the next milestone - going to be starting work on it next week. So it'll be great to have your feedback.

I plan on exposing two bits of functionality - a 'local rename' - that allows renaming all the identifiers in a file. More interesting for the use case you called out, though, is a workspace rename, which renames all the identifiers across a project.

likern commented 3 years ago

@bryphe Do you mean feedback when renaming will be landed in nightly builds?

Or are we talking about envision of how this should work (haven't thought about it much)?

Either way I'll be happy to test this out 🤗

If we are talking about local renames I think there should be some integration with workspace renaming. So not to be in a situation where local renames silently break code (as would in my examples).

Also I think there should be a better way then what VS Code does - as far as I remember it just opens all modified files with draft / unsaved state. But we don't have fine-grained control over this process.

Ideally there should be a way to iterate over changes and to apply / deny on per change basis (something similar to outline concept, where on click I see symbol in context in file). This is especially helpful for big renames.

Also VS Code (or Typescript Language Service?) previously changed how renaming in JavaScript / Typescript works. Previously they directly renamed symbol.

Now they do not rename, but add import Symbol as NewSymbol, or the other way around in imports (don't remember specific details).

That's the most annoying thing ever. 99% of the times I want direct / real renaming for all parts. I have to go to every file and fix it manually.

n0bra1n3r commented 3 years ago

Thank you so much for this project! I was wondering if you could add the Nim language plugin (nimsaem.nimvscode) to this list. I get this error with it installed: image I'm not sure why the other language plugins in the list work while this one doesn't. How can I help with this?

gjroelofs commented 3 years ago

I think we have multiple locations we can take folding from: LSP does implement it, there is some part in the VSCode grammars (language-configuration.json mentions folding) and then also tree-sitter could be used as well (for AST based folding).

Will folding at the view level be implemented in VSCode style (line-based) or character/token based (preferred)?

morganhein commented 3 years ago

I'm actually looking at working on the rename functionality for the next milestone - going to be starting work on it next week. So it'll be great to have your feedback.

I plan on exposing two bits of functionality - a 'local rename' - that allows renaming all the identifiers in a file. More interesting for the use case you called out, though, is a workspace rename, which renames all the identifiers across a project.

This is the only thing keeping me from using Onivim2. "This" being both local rename and workspace rename. I'm not sure these kinds of comments are helpful, but just in case they help direct where you put your attention, here you are.

I would love to test-drive this feature.