Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Multiline completion issues with Atom's indentation #227

Open
BoykoAlex opened this issue Jul 19, 2018 · 1 comment
Open

Multiline completion issues with Atom's indentation #227

BoykoAlex opened this issue Jul 19, 2018 · 1 comment

Comments

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Jul 19, 2018

Install cf-manifest-yaml package into Atom to be able to use multiline completion proposals from LS.

Create a file named manifest.yml and open it in Atom. Ensure that the grammar in the bottom-right corner reads: Manifest-YAML.

Now invoke CA right at the start (empty content, line:0, char:0)
The first proposal is applications - select it.
Now the content would be:

applications:
- name: 

Good!

Delete everything such that the content is empty. In the first line type 'n' spaces (5 for example)
Put the cursor at position {line:0, chcracter:0}
Now invoke CA and pick applications
The result looks like:

applications:
     - name:    

5 leading spaces before - name is the problem. (There also 5 spaces after - name: which is expected)
The edit was:

newText: "applications:↵- name: ",
range: {
  end: {
    character: 0,
    line: 0
  },
  start: {
    character: 0,
    line: 0
  }
}

So where the 5 leading spaces come from? Looks like this is the indentation that Atom tries to put in. It doesn't seem to do it correctly. It seem to count number of leading spaces on the line rather than look at the edit range start position and calculate number of spaces before that position.

@UziTech
Copy link

UziTech commented Oct 19, 2020

Development of atom-languageclient has officially moved to https://github.com/atom-ide-community/atom-languageclient 🎉

If this is still an issue please consider opening an issue on that repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants