verible icon indicating copy to clipboard operation
verible copied to clipboard

Autoc-ompletion feature request

Open adibis opened this issue 2 years ago • 3 comments

I am trying to get neovim lsp autocomplete working. I followed the steps as listed in the README file.

I wrote a sample file with a couple of classes. Very simple example is:

` class aVeryLongName; endclass : aVeryLongName

class bVeryLongName; aVe <<<<------ there is nothing suggested in autocomplete here endclass : bVeryLongName

`

Trying to figure out how to debug it from here. I also tried adding the project level file and that didn't solve this either.

I am able to see other LSP features such as warnings on bit-width mismatches, trailing whitespaces, etc however, nothing for autocompletion.

Any idea what might be missing?

adibis avatar May 03 '23 03:05 adibis

This is expected, as there are no auto-completion features yet implemented in the language server.

Can you give examples where you'd like to have completion support ? The needs are often different, so I like to understand what are the most common ones. I personally would like to have support for e.g. auto-suggestion of fields in a struct.

hzeller avatar May 03 '23 22:05 hzeller

The Veridian SystemVerilog Language server implements a completion engine that pulls basic completion options from multiple context sets, found here.

Their approach was to break completion requests into the following Contexts:

  • Keywords (assert, assign, begin, end, if, else ...)
  • System Tasks (error, info, timeformat, random ...)
  • Directives (ifndef, endif, include, timescale ...)

When a completion request is triggered by the server, the context is determined (e.g. a '$' character would imply a System Task) and the appropriate pool of keywords is parsed for completion suggestions. The main completion engine can be found here.

I like this approach as it provides enough filtering to provide relevant completion options without much complexity, and implementing a similar system in Verible would greatly benefit the Language Server.

aGhandhii avatar Nov 15 '23 01:11 aGhandhii

For me the struct capability and class members are the most valuable short term capabilities.

allRisc avatar Aug 06 '24 15:08 allRisc