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

Problems with autocompletion #41

Closed
AnsonYeung opened this issue Jan 7, 2019 · 4 comments
Closed

Problems with autocompletion #41

AnsonYeung opened this issue Jan 7, 2019 · 4 comments
Labels
bug caused by vscode The issue was caused by a VS Code update good first issue Good for newcomers out of scope question
Milestone

Comments

@AnsonYeung
Copy link
Contributor

Some of the auto complete does not work well.

Example:
When I type
if ... then
Then I pressed enter, the enter key will be eaten.
What I want is skip to the next line with indent.
This only happens when I pressed the enter key second time.

Besides, the snippet of begin...end is bad.
It inserts two position, one between begin end and one after the end keyword.
However, when I type code between begin end, the auto complete function will not work at all. There will be no hint at all.

Also, can you make a option to capitalize the first letter of keywords?
For example, when I type "if" then pressed space, the "if" keyword will become "If"

Lastly, it will be good if the main begin end will be automatically insert the dot instead of a semicolon.

@AnsonYeung
Copy link
Contributor Author

Some of the snippet have the same name with the keyword, this requires manually choose between keyword and snippet, which is inconvenient

@alefragnani
Copy link
Owner

Hi @AnsonYeung ,

I think you are confusing auto complete and snippets.

The auto complete feature, which is a VS Code functionality, is responsible for what you see in your first (typing if .. then) and second (missed auto complete while using snippets), so, you should report this directly in VS Code repository.

About the two positions in begin ... end snippets, yes, it could be improved. I'll remove the second position, thanks 👍

About capitalizing the first letter of keywords, I'm sorry, but there is no way (API) to create such customization. I think you should look for another extension that does things like that (use a user created dictionary to auto replace specific keywords).

About replacing the begin...end end snippet to use dot instead of semicolon, I won't change that, because the semicolon is a lot more used than dot. But I invite you to make a pull request, adding a new snippet with that new snippet.

Finally, about the snippets with the same name as a keyword, I think you are talking about begin, for, and others, right? Well, some of the snippets where created to replicate what you see in Delphi, and Delphi itself has exactly the same inconveniences. Sorry, but I prefer having the same snippets on both tools (which I use everyday) instead of two different keybindings for each tool.

Hope this helps.

@alefragnani alefragnani added enhancement question caused by vscode The issue was caused by a VS Code update out of scope good first issue Good for newcomers bug and removed enhancement labels Jan 8, 2019
@alefragnani alefragnani added this to the 7.2.0 milestone Jan 19, 2019
@AnsonYeung
Copy link
Contributor Author

@alefragnani I experience a big problem when typing while...do loop. When I type do, it will turn to destructor Destroy; override; sometimes. It is very annoying, can you remove it?

@alefragnani
Copy link
Owner

Hi @AnsonYeung ,

This is also caused by VS Code auto complete feature, not the snippet itself.

I think you should take a look at editor.wordBasedSuggestions, editor.quickSuggestions, editor.suggest.snippetsPreventQuickSuggestions and other related settings. Maybe turning off suggestions and/or snippets, would fit your needs to avoid VS Code messing around while you type.

alefragnani added a commit that referenced this issue Feb 7, 2019
alefragnani added a commit that referenced this issue Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug caused by vscode The issue was caused by a VS Code update good first issue Good for newcomers out of scope question
Projects
None yet
Development

No branches or pull requests

2 participants