Added completions for language-service.
Some refactoring.