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

The server reports any text typed as a variable and adds it to the completion menu

Open jmdevin opened this issue 1 year ago • 0 comments

Description

Typing any text at all, such as the letter 'j', and then attempting to complete that text will result in the text appearing in the completion menu as a variable, pointlessly cluttering it.

Steps to reproduce

  1. Open an awk file in a text editor with lsp support
  2. Type anything (without spaces or non-alphabetic characters)
  3. Attempt to complete the text
  4. See that the text typed appears in the completion results

I'm encountering this with vim 9.1.0720, using coc.nvim, and the most up to date awk-language server.

Expected Behavior

When the user types in text, and that text appears nowhere else, it shouldn't be identified as a variable and reported as a completion item.

Additional Info

Server Response

This is the completion response from the server when I typed the letter 'j' in a completely empty file and (auto-)triggered completion:

[Trace - 5:56:29 PM] Received response 'textDocument/completion - (1)' in 11ms.
Result: [
    {
        "label": "j",
        "kind": 6,
        "data": {
            "type": 0,
            "symbolInfo": {
                "name": "j",
                "kind": 13,
                "location": {
                    "uri": "file:///home/john/development/awk/awk_programming_language_2ed/example.awk",
                    "range": {
                        "start": {
                            "line": 0,
                            "character": 0
                        },
                        "end": {
                            "line": 0,
                            "character": 1
                        }
                    }
                },
                "containerName": "awk"
            }
        }
    },
    {
        "label": "OFS",
        "kind": 6,
        "data": {
            "type": 1,
            "jsonPath": "builtins.OFS"
        }
    },
    ---- Many other items ----
]

jmdevin avatar Sep 20 '24 22:09 jmdevin