richjyoung / vscode-modern-vhdl

Modern VSCode VHDL Support
MIT License
30 stars 12 forks source link

[Bug] Auto close double quote after letter "x" #12

Open Brookg opened 5 years ago

Brookg commented 5 years ago

OS Version: Windows 10 1809 VS Code Version: 1.33.1 Extension Version: 0.0.7

First of all, thank you for your job. Suppose there is a signal, whose type is std_logic_vector: signal a : std_logic_vector (15 downto 0); Then I want to assign a constant value x"1234" to it: a <= x"1234"; Sorry for my English. So I attach a gif: before As show before, the double quote after letter x is not auto closed. My suggestion is add following snippet: (snippets/vhdl.yml)

hex_std_logic_vector:
  prefix: x"
  description: x"nnnn"
  scope: source.vhdl
  body: "x\"$1\"$0"

(snippets/vhdl.json)

    "hex_std_logic_vector": {
        "prefix": "x\"",
        "description": "x\"nnnn\"",
        "scope": "source.vhdl",
        "body": "x\"$1\"$0"
    }

Result as shown below: after

By the way, this issue may depend on every one's typing habits.

jacopoabramo commented 5 years ago

Looks neat to me, I also use the hexadecimal assigning a lot. Would be cool to be able to do it also for upper case characters, i.e.

a <= X"FFFF";

richjyoung commented 5 years ago

That's interesting, I think in @Brookg 's first example the quotes should auto-close, which means this is a bug. I'll look into this and update the thread.