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

how to change filetype detection strategy? #1504

Open
qian-gu opened this issue Nov 6, 2022 · 0 comments
Open

how to change filetype detection strategy? #1504

qian-gu opened this issue Nov 6, 2022 · 0 comments

Comments

@qian-gu
Copy link

qian-gu commented Nov 6, 2022

Expected behavior:

Change filetype detection into whole word match, the default wildcard way doesn't support overwriting in language like foo and foobar.

For example, I have extended a systemverilog.snippets from verilog.snippets,

in verilog.snippets file:

priority -50

snippet comb "Infer combinational from always" b
always @(*) begin
	${1:${VISUAL}}
end
$0
endsnippet

in the systemverilog.snippets file:

priority -50

extends verilog

# We want to overwrite everything in parent ft.
priority -49

snippet comb "Infer combinational from always_comb" b
always_comb begin
	${1:${VISUAL}}
end
$0
endsnippet

comb<tab> is expected to be replaced with always @(*) in verilog file and always_comb in systemverilog file.

Actual behavior:

For previous example, comb<tab> in any verilog file will be replaced with always_comb instead of always @(*).

Steps to reproduce

  1. install ultisnips and honza/vim-snippets plugins
  2. disable searching snipmate snippets by adding let g:UltiSnipsEnableSnipMate = 0 to .vimrc
  3. open test.v file and set filetype with :set filetype=verilog
  4. test with previous example, i.e., write comb<tab>

  • Operating System:

Ubuntu 22.04

  • Vim Version:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 13 2022 09:35:02)
Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919

  • UltiSnips Version:

e99fdf1

  • Python inside Vim:

5.10.6 (main, Nov 2 2022, 18:53:38) [GCC 11.3.0]

  • Docker repo/vimrc:
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