Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get LSP to work with complicated Scala project with git submodules. #1533

Closed
gonsolo opened this issue Feb 8, 2024 · 1 comment
Closed

Comments

@gonsolo
Copy link

gonsolo commented Feb 8, 2024

I tried to get "Jump to definition" working with vim, vim-lsp for chipyard.
Chipyard is a complicated multi-gitsubmodule project.

I filed an issue for Scala Metals here.
With this issue I'm trying to get all related parties onboard.

In a simple scala project it works.

Relevant snippests from my .vimrc:

if executable('metals')
  au User lsp_setup call lsp#register_server({
       \  'name': 'Scala Language Server',
       \  'cmd': {server_info->['metals']},
       \  'initialization_options': { 'isHttpEnabled': 'true' },
       \  'whitelist': ['scala'],
       \ })
endif
if executable('sourcekit-lsp')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'sourcekit-lsp',
        \ 'cmd': {server_info->['sourcekit-lsp']},
        \ 'whitelist': ['c', 'cpp', 'objc', 'opencl', 'swift', 'rust', 'scala'],
        \ })
endif
autocmd FileType scala nnoremap <C-]> :LspDefinition<CR>
autocmd FileType scala setlocal omnifunc=lsp#complete

I'm willing to take the time to debug and would be happy for advice.

@gonsolo
Copy link
Author

gonsolo commented Feb 8, 2024

I got it working by fiddling around bloop, running the bloop server and starting vim from the root directory and opening scala files from there. So it's not a vim-lsp issue. Closing.

@gonsolo gonsolo closed this as completed Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant