Skip to content

Commit 54feaa8

Browse files
devversionatscott
authored andcommitted
feat: integrate code refactorings from language-service via LSP
This integrates Angular's code refactorings into the extension, so that those are communicated via the LSP to VSCode.
1 parent b424eaa commit 54feaa8

File tree

7 files changed

+3925
-3714
lines changed

7 files changed

+3925
-3714
lines changed

.aspect/rules/external_repository_action_cache/npm_translate_lock_LTE4Nzc1MDcwNjU=

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Input hashes for repository rule npm_translate_lock(name = "npm", pnpm_lock = "//:pnpm-lock.yaml").
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=974837034
5-
pnpm-lock.yaml=-1342496482
6-
yarn.lock=-1243860663
7-
package.json=1843460007
5+
pnpm-lock.yaml=-1152034998
6+
yarn.lock=-1189064062
7+
package.json=-1838831543
88
pnpm-workspace.yaml=1711114604

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{
3838
"type": "shell",
3939
"label": "build vsix",
40-
"command": "./scripts/build.sh"
40+
"command": "./scripts/build.sh package.json"
4141
}
4242
]
4343
}

client/src/client.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ export class AngularLanguageClient implements vscode.Disposable {
6666
provideCodeActions: async (
6767
document: vscode.TextDocument, range: vscode.Range, context: vscode.CodeActionContext,
6868
token: vscode.CancellationToken, next: lsp.ProvideCodeActionsSignature) => {
69-
if (await this.isInAngularProject(document) &&
70-
isNotTypescriptOrInsideComponentDecorator(document, range.start) &&
71-
isNotTypescriptOrInsideComponentDecorator(document, range.end)) {
69+
// Code actions can trigger also outside of `@Component(<...>)` fields.
70+
if (await this.isInAngularProject(document)) {
7271
return next(document, range, context, token);
7372
}
7473
},

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
"test:legacy-syntaxes": "yarn compile:syntaxes-test && yarn build:syntaxes && jasmine dist/syntaxes/test/driver.js"
232232
},
233233
"dependencies": {
234-
"@angular/language-service": "18.1.0-rc.0",
234+
"@angular/language-service": "~18.2.0-next.1",
235235
"typescript": "5.5.3",
236236
"vscode-html-languageservice": "^4.2.5",
237237
"vscode-jsonrpc": "6.0.0",

0 commit comments

Comments
 (0)