Closed dependabot[bot] closed 3 years ago
Upgrading the server to 12.1.1.
causes issues with completions.
So I would not merge this.
when I type the completion and select it, nothing gets completed:
Would you be able to check the relevant server messages?
I've seen issues like that before which were related to using $
character in the completion, I believe.
Specifically https://github.com/sublimelsp/LSP/issues/1088
Here is the error I got:
Traceback (most recent call last):
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1488, in run_
return self.run(edit, **args)
File "/home/predragnikolic/.config/sublime-text/Packages/LSP/plugin/completion.py", line 74, in run
edit_region = range_to_region(Range.from_lsp(text_edit['range']), self.view)
KeyError: 'range'
And I found the cause.
Here is a quick comparison in completion items between the current master and this PR:
The completion item for title for current master looks like this:
{'label': 'title', 'textEdit': {'range': {'start': {'line': 345, 'character': 13}, 'end': {'line': 345, 'character': 15}}, 'newText': 'title'}, 'detail': 'property', 'data': {'position': {'line': 345, 'character': 15}, 'kind': 'ngCompletionOriginData', 'filePath': '/home/predragnikolic/Documents/sandbox/ang-app/src/app/app.component.html'}, 'kind': 10, 'sortText': 'title'}
Take a look at the textEdit
, it is of type TextEdit
in the spec.
Now lets look at the completion item received in this PR:
{'label': 'title', 'data': {'filePath': '/home/predragnikolic/Documents/sandbox/ang-app/src/app/app.component.html', 'kind': 'ngCompletionOriginData', 'position': {'character': 15, 'line': 345}}, 'detail': 'property', 'kind': 10, 'sortText': '1', 'textEdit': {'replace': {'end': {'character': 15, 'line': 345}, 'start': {'character': 13, 'line': 345}}, 'newText': 'title', 'insert': {'end': {'character': 15, 'line': 345}, 'start': {'character': 13, 'line': 345}}}}
Take a look at the textEdit
, it is of type InsertReplaceEdit
in the spec.
Technically I would call this a bug at the angular repo for not following the spec:
Most editors support two different operations when accepting a completion item. One is to insert a completion text and the other is to replace an existing text with a completion text. Since this can usually not be predetermined by a server it can report both ranges. Clients need to signal support for
InsertReplaceEdit
s via thetextDocument.completion.completionItem.insertReplaceSupport
client capability property.
The ST LSP plguin is not announceing that is supports insertReplaceSupport
, so the angular LS should not assume that the client does support it.
But at least I know on what I am going to work on next :)
Even when we implement insertReplaceSupport
in LSP for ST4.
Option 1
I have to ask if we are going to at least create a tag for LSP-angular with the current master(because apparently this is the last version that will work on ST3)
There is a different approach.
Option 2
There can be an issue created at the angular ls repo. Angular ls is not actually checking the client capability insertReplaceSupport
and it doesn't fall back gracefully if it doesn't support that capability to something like a TextEdit.
The second options for me makes more sense? What do you guys think?
Angular should respect the client capability :)
Superseded by #45.
I created an issue at the angular repo.
Bumps @angular/language-server from 11.2.14 to 12.1.1.
Release notes
Sourced from
@angular/language-server
's releases.... (truncated)
Changelog
Sourced from
@angular/language-server
's changelog.... (truncated)
Commits
07581a3
release: v12.1.1547242b
build(deps): bump glob-parent in /integration/project (#1406)8b6fe62
chore(deps): update dependency vsce to v1.95.0 (#1422)4e34fb0
fix(deps): update angular monorepo to v12.1.0 (#1416)e10358c
chore(deps): update dependency prettier to v2.3.2 (#1423)55a88c1
chore(deps): update dependency@types/node
to v14.17.4 (#1393)fb6681e
build: update to TS 4.3.4 (#1428)53ad8bb
release: v12.1.066fbc95
build(deps): bump hosted-git-info from 2.8.8 to 2.8.9 (#1411)ac8f58f
chore(deps): update dependency@types/jasmine
to v3.7.7 (#1402)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)