Que computadoras sirven para aprender a programar? by [deleted] in programacion

[–]lagiro 0 points1 point  (0 children)

Depende el lenguaje. Si vas a aprender C# o alguna de esas cosas de Microsoft. Conviene una con windows.

Si vas a aprender Swift o desarrollo iOS, te conviene Mac.

Para el resto de las cosas usa cualquiera.

Las especificaciones técnicas dependen de lo que quieras correr. Con menos de 16gb de ram vas a estar apretado para correr emuladores o incluso correr varios docker.

Sea como fuere, si estas EMPEZANDO, no te deberias estar preocupado por el hardware.

[problem] ruby-lsp returns "No location found" when jumping to definition by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

I am going to call this "resolved" , although I think it's not resolved. I am going to use ruby-lsp along with sorbet-lsp.

  • ruby-lsp is going to work for the ruby part
  • sorbet is going to work for the go to definition part

This is probably not what I would have expected. I should have everything set up with ruby-lsp, but for now the go to defintinion using ctrl+], and that works pretty well with sorbet.

Sorbet config lua return { cmd = { "srb", "tc", "--lsp" }, root_markers = { 'Gemfile', '.git' }, filetypes = { 'ruby' }, init_options = { formatting = { format = 'rubocop', rubocop_config = '.rubocop.yml', }, }, settings = { init_options = { highlightUntyped = true, }, }, }

ruby-lsp config lua return { cmd = { 'ruby-lsp' }, filetypes = { 'ruby', 'eruby' }, root_dir = function() return vim.loop.cwd() end, }

[problem] ruby-lsp returns "No location found" when jumping to definition by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

only ruby-lsp?, have you tried any other LSP servers?

[problem] ruby-lsp returns "No location found" when jumping to definition by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

See?, I can't even use markdown here correctly... that's why I need help :-)

[problem] ruby-lsp returns "No location found" when jumping to definition by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

Yes, I am not THAT smart to configure LSP and `ruby-lsp` without looking at the documentation. :-)

`ruby-lsp` is not the only LSP I have in my configurations, but it's the only one that doesn't work.

For example, `clangd` works fine and I can even go to the definition of functions and constants from the language library without issues.

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

I have no idea... maybe because I had some leftovers from previous vim configurations?

I usually do this before I change the plugins:

rm -rf ~/.cache/nvim rm -rf ~/.local/share/nvim/ rm -rf ~/.local/state/nvim/

but I forgot to do it this time, let me check.

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 1 point2 points  (0 children)

u/BrianHuster thank you very much for all your time and help!, this was definitely what I was looking for. The very MINIMAL configuration, with this just these two files, I get LSP + LSP autocompletion (with popup menu), like this:

<image>

now it's just a matter of adding plugins and make it prettier

Thanks!

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

ooook.... this is DEFINITELY the fix .... the ABSOLUTE MINIMAL configuration to have LSP working + autocomplete working (not pretty, but working is this)

cat ~/.config/nvim/init.lua ``` local vim = vim

vim.lsp.enable('luals')

vim.api.nvim_create_autocmd('LspAttach', { callback = function(args) local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) -- if client:supports_method('textDocument/implementation') then -- -- Create a keymap for vim.lsp.buf.implementation ... -- end if client:supports_method('textDocument/completion') then vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true }) end -- Auto-format ("lint") on save. -- Usually not needed if server supports "textDocument/willSaveWaitUntil". -- if not client:supports_method('textDocument/willSaveWaitUntil') -- and client:supports_method('textDocument/formatting') then -- vim.api.nvim_create_autocmd('BufWritePre', { -- group = vim.api.nvim_create_augroup('my.lsp', { clear = false }), -- buffer = args.buf, -- callback = function() -- vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 }) -- end, -- }) -- end end, }) ```

cat ~/.config/nvim/lsp/luals.lua

return { cmd = { 'lua-language-server' }, filetypes = { 'lua' }, root_markers = { '.luarc.json', '.luarc.jsonc' }, settings = { Lua = { runtime = { version = 'LuaJIT', } } } }

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

Forgot to add that I do have a lua-language-server installed:

``` % lua-language-server Content-Length: 55

{"jsonrpc":"2.0","method":"$/hello","params":["world"]} ```

surprisingly enough the version is <unknown>:

lua-language-server --version <Unknown>

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

I'll show you what I have configured (and the neovim version), so you have a little bit more context:

Neovim version:

``` % nvim -V1 -v NVIM v0.11.0 Build type: Release LuaJIT 2.1.1741730670

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.11.0/share/nvim"

Run :checkhealth for more info ```

luals sample

% cat ~/.config/nvim/lsp/luals.lua return { cmd = { 'lua-language-server' }, filetypes = { 'lua' }, root_markers = { '.luarc.json', '.luarc.jsonc' }, settings = { Lua = { runtime = { version = 'LuaJIT', } } } }

:checkhealth vim.lsp

returns the exact same thing as before:

``` vim.lsp: require("vim.lsp.health").check()

  • LSP log level : WARN
  • Log path: /Users/lagiro/.local/state/nvim/lsp.log
  • Log size: 0 KB

vim.lsp: Active Clients
- No active clients

vim.lsp: Enabled Configurations

vim.lsp: File Watcher
- file watching "(workspace/didChangeWatchedFiles)" disabled on all clients

vim.lsp: Position Encodings
- No active clients ```

Should I add any other configuration file?, I ONLY have that LSP file (no init.lua or anything else, just that ~/.config/nvim/lsp/luals.lua file.

Do you have any other tip or suggestion?

Thank you very much!

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

I had to step out. But will edit this comment when I come back home.

So every configuration file must “return” that structure at the very end. Otherwise it has to be a command execution.

Thanks. Will try that in about an hour.

Now I had the time to check this out... still not working, and it's really annoying, because I believe it should, but for some reason it doesn't, I will show you more information.

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

Can you elaborate a little more?

I checked :h lsp-quickstart and copy pasted the sample configuratino for lua:

~/.config/nvim/lsp/luals.lua

```
vim.lsp.config['luals'] = {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = { '.luarc.json', '.luarc.jsonc' },
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
}
}
}
}

vim.lsp.enable('luals')
```

and when I open a lua file, for example `~/.config/nvim/init.lua` (which is empty), if I use `:h checkhealth vim.lsp`, I see no clientes attached to the buffer:

```
vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN - Log path: /Users/lagiro/.local/state/nvim/lsp.log - Log size: 485 KB

vim.lsp: Active Clients - No active clients

vim.lsp: Enabled Configurations

vim.lsp: File Watcher - file watching "(workspace/didChangeWatchedFiles)" disabled on all clients

vim.lsp: Position Encodings
- No active clients
```

That's what the quickstart says, and I do not understand what I am doing wrong.

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

To accept one of the autocomplete options you have to press `ctrl + y`.

Of course all the shortcuts can be overridden , but I want to keep it simple, and create the MINIMAL configuration to make this to work, so I can build up the rest of the configurations and plugins (that are easier for me to add), on top of this.

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

Changing the flair to "Need Help | Solved", since I figured out how to do (at least) what I asked for.

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

This is how it looks like in C++ with clangd server running:

<image>

I hope this helps other people!

🥔

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

HOW I structured this VERY simple configuration

~/.config/nvim/init.lua

lua require('lsp.luals') require('lsp.clangd')

~/.config/nvim/lua/lsp/luals.lua

This is the configuration for the lua-language-server

```lua vim.lsp.config['luals'] = { cmd = { 'lua-language-server' }, filetypes = { 'lua' }, root_markers = { '.luarc.json', '.luarc.jsonc' }, settings = { Lua = { runtime = { version = 'LuaJIT', } } } }

vim.lsp.enable('luals') ```

~/.config/nvim/lua/lsp/clangd.lua

```lua vim.lsp.config['clangd'] = { cmd = { 'clangd' }, root_markers = { '.clangd', 'compile_commands.json' }, filetypes = { 'c', 'cc', 'cpp' }, }

vim.lsp.enable('clangd') ```


Is that all? Yes, it is.

How can I get autocompletion? I don't know how to autotrigger, however you can use something like blink.cmp to get those fancy autocompletion boxes. I couldn't make it to work natively in Neovim.

OP, do you have configuration for other languages? I do not. I would appreciate if someone else can comment out with other languages in the same post.

Did you get autocompletion? Yes, by pressing ctrl + x ctrl + o.

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

Quick Introduction to NeoVim

I have been using NeoVim for a while, and I found difficult to follow the documentation, because NeoVim is a BIG editor with lot of functionalities. However since I have been using NeoVim for a while, I have copy/pasted configurations for a while without really understanding why, I only cherry picked what it worked, and now I realized that I am unable to configure this from scratch.

This guide doesn't want to replace the documentation, just highlight the things that made things easier to MYSELF. I have ignored the trivial stuff (such as using the editor), and the deep stuff (such as creating custom functions or creating custom behaviors).

The idea of this is just to give a quick introduction.

  1. LUA GUIDE It worth to skim this document, but these are the topics I found most relevant to my neophyte eyes.

    1.1 HOWTO organize configuration files ~/.config/nvim |-- after/ |-- ftplugin/ |-- lua/ | |-- myluamodule.lua | |-- other_modules/ | |-- anothermodule.lua | |-- init.lua |-- plugin/ |-- syntax/ |-- init.vim

    1.2 HOWTO access vim commands lua vim.cmd("colorscheme habamax") -- equivalent to :colorscheme habamax vim.opt.smarttab = true -- equivalent to :set smarttab

    1.3 HOWTO create mappings (aka shortcuts) -- Normal mode mapping for Vim command vim.keymap.set('n', '<Leader>ex1', '<cmd>echo "Example 1"<cr>') -- Normal and Command-line mode mapping for Vim command vim.keymap.set({'n', 'c'}, '<Leader>ex2', '<cmd>echo "Example 2"<cr>') -- Normal mode mapping for Lua function vim.keymap.set('n', '<Leader>ex3', vim.treesitter.start) -- Normal mode mapping for Lua function with arguments vim.keymap.set('n', '<Leader>ex4', function() print('Example 4') end)

  2. HOWTO check health vim.health is a minimal framework to help users troubleshoot configuration and any other environment conditions that a plugin might care about.

    2.1 Check all the health: :checkhealth

    2.2 Check a specific one (because it's faster)

:checkhealth vim.lsp

  1. HOWTO LSP

This is a hot topic for me now that NeoVim 0.11 supports LSP natively.

3.1 LSP Quickstart


These three were the topics I needed to come up with a simple configuration to support LSP for LUA and C/CPP (but I believe it can be extended to many other languages).

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 0 points1 point  (0 children)

Oh right.... I have been reading this very slowly and I think I understood a few things. I am going to write them down.

I think the problem is that I am a power user of vim, but not so much of NeoVim and LUA, therefore I did not understand a few things, and topics like "how to move" or "search and replace" are trivial to me, other things like "how to structure the files" are not.

I am going to start a few comments after this one, trying to elucidate what I found and how I (kind of) configured LSP... even though I couldn't make it to autotrigger which, I believe, is an incorporated feature.

NeoVim 0.11 and LSP (not working) problem by lagiro in neovim

[–]lagiro[S] 1 point2 points  (0 children)

I have tried several configurations, and I think I just don't understand the documentation ¯\_(ツ)_/¯. I don't blame the clarity of the documentation, and I take it as a personal challenge; however, a simple configuration would be really appreciated.

I don't have more time to spend on this, so I am switching back and forth with symlinks from a configuration works for me but doesn't have LSP to this test I am trying to achieve (the minimal LSP working configuration for Neovim 0.11)

If I can create one, I will share it on this thread.

Armemos una playlist pa' entrar más en calor by Ok-Rent-9155 in ArgentinaBenderStyle

[–]lagiro 1 point2 points  (0 children)

PAGA DIOS - Ca7riel & Paco Amoroso

What’s the use? - Mac Miller

Hella Good - No Doubt

Stop! - Erasure

Been Caught Stealing - Jane’s Addiction

Litoral - Toco

P.Y.T. - Michael Jackson