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

Word completions on ctrl-space rather than completing possible keys #139

Closed
segevfiner opened this issue Nov 27, 2018 · 4 comments
Closed

Comments

@segevfiner
Copy link

I'm getting word completions on pressing ctrl-space, rather than getting completion for possible keys, which I believe would be more useful (They would show descriptions, keys that don't exist yet, etc.).

Example

.circleci/config.yml:

version: 2

jobs:
  build:
    docker:
      - image: python:3.7

    steps:
      - 

Try to trigger completion with ctrl-space on the dash after steps.

Screenshot

screenshot_2018-11-27_20-48-08

@JPinkney
Copy link
Contributor

screen shot 2018-11-27 at 2 11 12 pm

It shows results for me. Can you try setting the yaml.trace.server settings to be verbose and tell me what results you get. Also what version of VSCode are you running and what OS?

@segevfiner
Copy link
Author

It shows results for me. Can you try setting the yaml.trace.server settings to be verbose and tell me what results you get. Also what version of VSCode are you running and what OS?

VS Code 1.29.1
Xubuntu 18.04.1 amd64 and also on macOS 10.14.1
vscode-yaml 0.1.0

Log: 2-Yaml Support.log

In case it's some other extension breaking this, here are the extensions I have on the Linux box:

bungcip.better-toml@0.3.2
dbaeumer.vscode-eslint@1.7.0
eamodio.gitlens@8.5.6
lextudio.restructuredtext@83.0.0
ms-python.python@2018.10.1
ms-vscode.cpptools@0.20.1
ms-vscode.Go@0.7.0
ms-vscode.vscode-typescript-tslint-plugin@0.1.0
msjsdiag.debugger-for-chrome@4.11.1
redhat.vscode-yaml@0.1.0
stkb.rewrap@1.9.1

@fbricon
Copy link
Contributor

fbricon commented Nov 27, 2018

looks like the server returns the proper completion items, but they're not displayed. I've seen the same problem with other extensions. Seems like a vscode issue. What works for me generally is restarting vscode.

@segevfiner
Copy link
Author

segevfiner commented Nov 28, 2018

I'm seeing this message in the developer console: INVALID text edit -> must be single line and on the same line I think this is the issue, and not VS Code.

See LSP Spec - textDocument/completion:

	/**
	 * An edit which is applied to a document when selecting this completion. When an edit is provided the value of
	 * `insertText` is ignored.
	 *
	 * *Note:* The range of the edit must be a single line range and it must contain the position at which completion
	 * has been requested.
	 */
	textEdit?: TextEdit;

The range of a CompletionItem.textEdit must be a single line. The fact that they are multi-line leads to all the generated completions being dropped, which causes VS Code to fall back to word completions.

@fbricon

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

3 participants