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

triple-quotes cause completion of files in the current working direcrory #270

Closed
greggthomason opened this issue May 26, 2023 · 9 comments
Closed
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@greggthomason
Copy link

Version 0.40.0, Python 3.11.3 via Homebrew on Mac OS X 13.3.1(a). Using BBEdit.

Screenshot 2023-05-15 at 12 22 06 PM When doing a triple-quote, I receive completions for files in the same directory as the file I'm editing. I have confirmed w/ the author of BBEdit that it's not doing any docstring completion.
@pappasam
Copy link
Owner

Have you confirmed that these completions are coming from jedi-language-server? I don't think jedi returns these completions

@greggthomason
Copy link
Author

The BBEdit lead dev confirmed to me that it does not generate any completions in docstrings, and does not do completions from the disk in general (only from something like ctags, which I am not using).

@greggthomason
Copy link
Author

To clarify slightly: If I disable the jedi server integration and cold-start and open a new buffer, typing """ and pausing does not do anything. If I then re-enable the server, restart, and on a new buffer to """ the immediate completion is the contents of the directory of the file I opened. No completion (of the type I am seeing) is generated until the file is saved, though. Therefore it is reasonable to assume it is the Jedi server, since the editor does not generate the completion unless server integration is active.

@davidhalter
Copy link

I'm pretty sure this is coming from Jedi. I understand that it's questionable, but the question is where do you want file completions and where not? I feel like this just depends a lot on the users. I understand that in triple quotes especially in a docstring position these are not very useful.

@greggthomason
Copy link
Author

yeah I feel like automatically showing ls $PWD is a weird choice after a triple-quote. I would expect plain ol' symbol completion, and the editor should chose eg to complete strings (or do nothing).

@pappasam
Copy link
Owner

I see... based on david's input, here are the options I can see:

  1. If we can identify the context being a docstring somehow, we can disable path completions specifically for that context.
  2. If not, we can add an option to disable all path completions.
  3. Finally, regardless of 1 and 2, if this is just mildly annoying, we can simply ignore and hope for an upstream resolution.

@greggthomason
Copy link
Author

I would be more than happy with #2.

@nic-hartley
Copy link

A couple thoughts:

  • This occurs on all but f strings, not just """s. It's just most irritating on """, where 100% of the time I'm trying to write a docstring, usage message, template, or other long-form, multiline thing, so I immediately hit enter, and then oops, instead of a newline I get .git/.
  • Why is this the default behavior which should only be turned off in limited contexts/by user decision? Even just off the top of my head I can come up with an enormous list of situations where I don't want the behavior, and maybe one where I do want it. Seems like it should be implemented as off by default, enabled only in the situations where it makes sense, maybe with a user option to complete like that on all strings.

@pappasam
Copy link
Owner

pappasam commented Nov 8, 2024

@pappasam pappasam closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants