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

Can't easily type a colon at the end of a line #527

Closed
loic-joly-sonarsource opened this issue Feb 28, 2022 · 1 comment · Fixed by #529
Closed

Can't easily type a colon at the end of a line #527

loic-joly-sonarsource opened this issue Feb 28, 2022 · 1 comment · Fixed by #529

Comments

@loic-joly-sonarsource
Copy link

loic-joly-sonarsource commented Feb 28, 2022

Description

When typing a colon, a completion list is displayed. When I want a colon att he end of a line, I usually press : then return, which types the first item of the completion list instead.

System Information

Version: 1.64.2 (user setup)
Commit: f80445acd5a3dadef24aa209168452a3d97cc326
Date: 2022-02-09T22:02:28.252Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19044

To Reproduce

Steps to reproduce the issue:

  1. Type some text, for instance Test
  2. Type a colon :
  3. Type return

Expected output:

Test:

Actual output:

Test:app-name: any

Typing a colon in the middle of a line is ok, because pressing space closes the completion list.

@ggrossetie
Copy link
Member

ggrossetie commented Mar 1, 2022

Hey!

The main issue is that :app-name: is declared as a snippet and, as a result, I think that : becomes a trigger character: https://code.visualstudio.com/docs/editor/intellisense#_intellisense-features in:

"Insert app-name": {
"prefix": ":app-name:",
"body": ":app-name: ${1:any}",
"description": "Adds application-name meta element for mobile devices inside HTML document head."
},

This is probably a bad idea and we should instead declare a CompletionItemProvider where we could return all built-in attributes only if : was typed at the start of a line.

As a workaround, you can edit your settings.json and add:

"editor.suggestOnTriggerCharacters": false

Suggestion won't be triggered by : anymore (or any other characters). You will have to use <Ctrl> + <Space> to trigger suggestions.

Another workaround is to configure:

"editor.acceptSuggestionOnEnter": "off",

<Enter> won't accept the suggestion anymore, you will have to use <Tab> to accept a suggestion.

ggrossetie added a commit to ggrossetie/asciidoctor-vscode that referenced this issue Mar 1, 2022
ggrossetie added a commit to ggrossetie/asciidoctor-vscode that referenced this issue Mar 1, 2022
ggrossetie added a commit to ggrossetie/asciidoctor-vscode that referenced this issue Mar 1, 2022
ggrossetie added a commit to ggrossetie/asciidoctor-vscode that referenced this issue Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants