bergercookie / asm-lsp

Language server for NASM/GAS/GO Assembly
https://crates.io/crates/asm-lsp
BSD 2-Clause "Simplified" License
239 stars 13 forks source link

Could server work with Intel syntax? #89

Closed nagolove closed 2 months ago

nagolove commented 3 months ago

Hello! I have troubles with proper server working. Server was installed by cargo install asm-lsp in NVIM v0.10.0 setup. nvim config:

Plug 'neovim/nvim-lspconfig'
lua << EOF
require'lspconfig'.asm_lsp.setup{
    root_dir = require'lspconfig'.util.root_pattern(".git", vim.fn.getcwd()),
    filetypes = {"asm", "nasm"}, 
    settings = {
        asm = {
            syntax = "nasm" 
        },
        nasm = {
            syntax = "nasm" 
        }
    },
}
EOF

Project directory put in git repo. Proper nasm syntax source file that I edited:

section .data
    ;       0123456790123456789
    msg db "Privet, mir", 0
section .bss
section .text
    global main
main:
    mov rax, 1 
    mov rdi, 1
    mov rsi, msg
    mov rdx, 12
    syscall
    mov rax, 60
    mov rdi, 0
    syscall

Strange result 2024-07-06-020238_ Could anybody help with plugin setup?

WillLillis commented 3 months ago

Hi! While we're planning on adding support for inline diagnostics (#85) in the (hopefully) near future, it's not something the server currently handles. Are there any other plugins that could be issuing these messages in your config (i.e. are there any other active plugins shown when you run :LspInfo)? For reference, here's what the file looks like for me in Neovim 0.10.0 (zoomed in for readability)

image

nagolove commented 2 months ago

:LspInfo output:

 Press q or <Esc> to close this window. Press <Tab> to view server doc.

 Language client log: /home/nagolove/.local/state/nvim/lsp.log
 Detected filetype:   asm

 1 client(s) attached to this buffer: 

 Client: asm_lsp (id: 1, bufnr: [1])
    filetypes:       asm, nasm
    autostart:       true
    root directory:  /home/nagolove/etudes_asm
    cmd:             /home/nagolove/.cargo/bin/asm-lsp

 Configured servers list: asm_lsp, clangd

I solved this problem with workaround using AT&T asm syntax and gas assembler instead of nasm.

WillLillis commented 2 months ago

:LspInfo output:


 Press q or <Esc> to close this window. Press <Tab> to view server doc.

 Language client log: /home/nagolove/.local/state/nvim/lsp.log

 Detected filetype:   asm

 1 client(s) attached to this buffer: 

 Client: asm_lsp (id: 1, bufnr: [1])

  filetypes:       asm, nasm

  autostart:       true

  root directory:  /home/nagolove/etudes_asm

  cmd:             /home/nagolove/.cargo/bin/asm-lsp

 Configured servers list: asm_lsp, clangd

I solved this problem with workaround using AT&T asm syntax and gas assembler instead of nasm.

Gotcha, looks like the diagnostics are from clangd then. Glad you were able to find a workaround!