awk-language-server icon indicating copy to clipboard operation
awk-language-server copied to clipboard

Enhance automatically generated snippets

Open EmilyGraceSeville7cf opened this issue 1 year ago • 5 comments

Use placeholders instead of:

  • var
  • file
  • expr-list
  • fmt
  • cmd-line
  • how

and the same terms enclosed inside square brackets. To be clear, generate: getline ${1:var} <${2:file} instead of getline var <file.

BTW, I also suggest preprocess initial terms replacing them for more human readable ones:

  • var -> variable
  • file -> path/to/file
  • expr-list -> expressions
  • fmt -> format
  • cmd-line -> command

In other words, generate: getline ${1:variable} <${2:path/to/file} instead of getline var <file.

EmilyGraceSeville7cf avatar Apr 10 '23 05:04 EmilyGraceSeville7cf

i was curious where such getline var <file came from...

// seems getline ${1:var} <${2:file} is the correct format.

Shane-XB-Qian avatar Apr 10 '23 19:04 Shane-XB-Qian

and why this lsp server no auto compl feature, and no any trigger char, a bit weird... :smile:

Shane-XB-Qian avatar Apr 10 '23 19:04 Shane-XB-Qian

There is an awk script to generate doc.json (I don't remember it's name precise, but it's smth like that) file which is used then as a source for generated snippets

EmilyGraceSeville7cf avatar Apr 10 '23 20:04 EmilyGraceSeville7cf

oh, but anyway getline var <file looks was not a format can be recognized.

Shane-XB-Qian avatar Apr 10 '23 20:04 Shane-XB-Qian

I'll take another look at generating docs when I have spare time but nowadays it's scarce.

Beaglefoot avatar Apr 11 '23 05:04 Beaglefoot