sublimelsp / LSP-angular

Convenience plugin for Angular Language Service
MIT License
9 stars 2 forks source link

Allow autocomplete in ts and js files in string templates #121

Closed predragnikolic closed 4 months ago

predragnikolic commented 4 months ago

closes #83

https://github.com/sublimelsp/LSP-angular/assets/22029477/716dd6bd-0c2b-45b8-8066-018c2fb52c34

rchl commented 4 months ago

Maybe worth mentioning in the Readme that LSP-typescript should be disabled in projects using LSP-angular? Just a suggestion.

predragnikolic commented 4 months ago

Hello Rafał, LSP-typescript should not be disabled.

LSP-angular doesn't conflict with LSP-typescript, it just enhances some places like inline template strings. LSP-angular just provides hover, completions in such specific places.

There are no duplicate completion items, or duplicate hovers when using it with LSP-typescript. Just to demonstrate, here is the completion request when triggered from the global scope. LSP-typescript will return completions, while LSP-angular will return null.

:: [10:14:57.954] --> LSP-typescript textDocument/completion (64): {'textDocument': {'uri': 'file:///Users/predrag/Documents/sandbox/angular-tour-of-heroes/src/app/app.component.ts'}, 'position': {'line': 18, 'character': 6}}
:: [10:14:57.954] --> LSP-angular textDocument/completion (38): {'textDocument': {'uri': 'file:///Users/predrag/Documents/sandbox/angular-tour-of-heroes/src/app/app.component.ts'}, 'position': {'line': 18, 'character': 6}}
:: [10:14:57.960] <<< LSP-angular (38) (duration: 5ms): None
:: [10:14:57.988] <<< LSP-typescript (64) (duration: 34ms): {'items': [{'label': 'bootstrapApplication', 'kind': 6, 'sortText': '11', 'data': {'cacheId': 1}, 'textEdit': {'newText': 'bootstrapApplication', 'insert': {'start': {'line': 18, 'character': 0}, 'end': {'line': 18, 'character': 6} ....I've trimmed this response, because my comment is too long (maximum is 65536 characters)... 'end': {'line': 18, 'character': 6}}}}], 'isIncomplete': False}