Add ruby major mode keybindings#159
Conversation
|
That's awesome! All of the commands are from vscode, and that's fine. Are there any specific commands from either one of the extension? If the answer is yes, is one of the extension preferred than the other? Currently we can only prefer one extension when the bindings contain commands from a specific extension (e.g. when the command in the major mode contains require a specific extension). Btw, there's a plan to refactor the core which allows us to have a plug-in like structure for supporting different major modes of a language. |
|
I believe both come with some specific commands but I haven't used them. And it's worth noting those extensions aren't mutually exclusive. The Ruby extensions provides many features like syntax highlighting, snippets, debugger, linting and basic intellisense. However, you can disable linting, codecompletion and intellisense and allow other extension (Solargraph!) to take care of it. I prefer that approach because solargraph is IDE-agnostic and I use it with my (space)vim configuration. It's a really good plan to support different major modes for a single language! I can imagine other languages can have more extensions that can provide different commands for the same actions. |
|
Now I'm wondering - shouldn't the default editor commands be available to all languages? Either via major mode or a new keybinding. I was thinking about |
Can you distill some of the gems (knowledge) as documentation? Is there any chance you can update our documentation like VSpaceCode/vspacecode.github.io#24?
Right, the thinking is like a major mode plug-in (A bit like layer concept in spacemacs) building on top of the extension system of vscode. So we can have
I am working toward that but right now we can't really offer alternative on the major modes.
Right, that's why some of the commands in your bindings can somewhat be achieved with the existing bindings or via vim. For example: We can consider integrate more of the built-in commands into non-major mode bindings.
Yeah, that's what the planned work I mentioned above would help so that the package.json is more manageable, and users will install the major mode as an extension in vscode marketplace. As far as duplication in the major mode, it is probably okay for now. Ideally, the major mode should have commands specific to the extension (LSP). In the future, the refactoring should facilitate binding reuse, so major mode won't have to redeclare similar bindings. |
Ok, so basically once we write in the docs that Ruby is required we can merge this, right? Anyway, regarding solargraph..maybe if these actions works without solargraph there is no need to suggest to install it, right? |
I think so :) Sorry for a lot of extra context😅
Either way would be fine. I thought it would nice to document it, but it may be hard to explain? |
As mdudzinski prefers :) |
|
@stevenguh Sure I'll update the documentation. I agree that it may be hard to explain about Solargraph. The nice thimg about the Ruby extension's LSP implementation is it doesn't require any external software (because the LSP server is written in TypeScript and bundled with the extension) where the Solargraph extension is just a client for the 3rd party server than one needs to install to have the Solargraph extension working. |
|
Thanks. We will merge this once there's a documentation PR. It's pretty cool that Ruby extension's LSP is in TypeScript. I am surprised that Solargraph extension doesn't install the LSP on launch automatically like C# extension (but then I don't know much about Ruby) |
6d5c29b to
ed2bc79
Compare
|
I rebased the branch against master. PR for the documentation > VSpaceCode/vspacecode.github.io#28 I wanted to test keybindings with just Ruby extension (to be sure Solargraph is optional) but its LSP server didn't work for me. So I marked both extensions as required. |
|
From the docs it looks like the LSP has to be enabled. See the section "Using the Language Server" here. |
|
@marcoieni Yes, I know it has to be enabled. It was and it just didn't boot and was stuck at I can change the documentation patch (VSpaceCode/vspacecode.github.io#28) and make |
|
Ok, I think it's fine like this. |
|
@marcoieni I know it isn't ideal but I'll update the docs in the future if I manage to make the LSP server from the Ruby extension work. Cheers! |
Just a basic set of major keybindings for Ruby language. Keybindings are based on the editor commands and require Ruby and/or Ruby Solargraph extensions to be installed.
Related issue #158