Multiline completion issues with Atom's indentation
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.
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.