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

Don't append "(" or "()" to function name in ":disassemble" completion #8802

Closed
wants to merge 2 commits into from

Conversation

obcat
Copy link
Contributor

@obcat obcat commented Aug 27, 2021

Problem

When completing a function name as the first argument of :disassemble, an unnecessary ( or () is appended to the end of the function name.

To Reproduce

  1. Run vim -Nu NONE.

  2. Source this script:

    def Hello(name: string)
      echo 'Hello' name
    enddef
    call feedkeys(":disassemble Hel\<Tab>", 'nt')

    The command-line contains this text:

    :disassemble Hello(
    

Expected behavior

The command-line contains this text:

:disassemble Hello

Because the extra ( is not necessary for executing :disassemble:

def Hello(name: string)
  echo 'Hello' name
enddef
disassemble Hello
Hello
  echo 'Hello' name
   0 PUSHS "Hello"
   1 LOAD arg[-1]
   2 ECHO 2
   3 RETURN void

And maybe for the reason, ( is not appended when completing as the second argument:

def Hello(name: string)
  echo 'Hello' name
enddef
call feedkeys(":disassemble debug Hel\<Tab>", 'nt')
:disassemble debug Hello

I think we should do the same thing for the first argument as for the second argument.

Environment

  • Vim 8.2.3377
  • macOS 10.15.7
  • iTerm2

Solution

Don't append "(" or "()".

Now these tests fail; extra parentheses are appended:

    Actual: :disas FuncName()
    Expect: :disas FuncName
@codecov
Copy link

codecov bot commented Aug 27, 2021

Codecov Report

Merging #8802 (9074569) into master (47016f5) will decrease coverage by 87.69%.
The diff coverage is 0.00%.

❗ Current head 9074569 differs from pull request most recent head c8d59c9. Consider uploading reports for the commit c8d59c9 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           master    #8802       +/-   ##
===========================================
- Coverage   90.15%    2.46%   -87.70%     
===========================================
  Files         151      149        -2     
  Lines      170756   165501     -5255     
===========================================
- Hits       153941     4072   -149869     
- Misses      16815   161429   +144614     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 2.46% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/userfunc.c 0.18% <0.00%> (-95.10%) ⬇️
src/float.c 0.00% <0.00%> (-99.22%) ⬇️
src/gui_gtk_f.c 0.00% <0.00%> (-97.54%) ⬇️
src/sound.c 0.00% <0.00%> (-97.12%) ⬇️
src/crypt_zip.c 0.00% <0.00%> (-97.06%) ⬇️
src/match.c 0.00% <0.00%> (-96.98%) ⬇️
src/sha256.c 0.00% <0.00%> (-96.94%) ⬇️
src/evalbuffer.c 0.00% <0.00%> (-96.92%) ⬇️
src/textprop.c 0.00% <0.00%> (-96.85%) ⬇️
src/cmdhist.c 0.00% <0.00%> (-96.76%) ⬇️
... and 138 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47016f5...c8d59c9. Read the comment docs.

@brammool brammool closed this in 9aecf79 Aug 28, 2021
@obcat
Copy link
Contributor Author

obcat commented Aug 28, 2021

Thank you!!

chrisbra pushed a commit to chrisbra/vim that referenced this pull request Aug 30, 2021
Problem:    Vim9: completion for :disassemble adds parenthesis.
Solution:   Don't add parenthesis. (Naohiro Ono, closes vim#8802)
@obcat obcat deleted the fix-disassemble-completion branch September 10, 2021 10:02
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

Successfully merging this pull request may close these issues.

None yet

1 participant