Skip to content

Commit

Permalink
feat: integrate code refactorings from language-service via LSP
Browse files Browse the repository at this point in the history
This integrates Angular's code refactorings into the extension, so
that those are communicated via the LSP to VSCode.
  • Loading branch information
devversion authored and atscott committed Jul 31, 2024
1 parent b424eaa commit 54feaa8
Show file tree
Hide file tree
Showing 7 changed files with 3,925 additions and 3,714 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Input hashes for repository rule npm_translate_lock(name = "npm", pnpm_lock = "//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=974837034
pnpm-lock.yaml=-1342496482
yarn.lock=-1243860663
package.json=1843460007
pnpm-lock.yaml=-1152034998
yarn.lock=-1189064062
package.json=-1838831543
pnpm-workspace.yaml=1711114604
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{
"type": "shell",
"label": "build vsix",
"command": "./scripts/build.sh"
"command": "./scripts/build.sh package.json"
}
]
}
5 changes: 2 additions & 3 deletions client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ export class AngularLanguageClient implements vscode.Disposable {
provideCodeActions: async (
document: vscode.TextDocument, range: vscode.Range, context: vscode.CodeActionContext,
token: vscode.CancellationToken, next: lsp.ProvideCodeActionsSignature) => {
if (await this.isInAngularProject(document) &&
isNotTypescriptOrInsideComponentDecorator(document, range.start) &&
isNotTypescriptOrInsideComponentDecorator(document, range.end)) {
// Code actions can trigger also outside of `@Component(<...>)` fields.
if (await this.isInAngularProject(document)) {
return next(document, range, context, token);
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
"test:legacy-syntaxes": "yarn compile:syntaxes-test && yarn build:syntaxes && jasmine dist/syntaxes/test/driver.js"
},
"dependencies": {
"@angular/language-service": "18.1.0-rc.0",
"@angular/language-service": "~18.2.0-next.1",
"typescript": "5.5.3",
"vscode-html-languageservice": "^4.2.5",
"vscode-jsonrpc": "6.0.0",
Expand Down
Loading

0 comments on commit 54feaa8

Please sign in to comment.