Skip to content

Commit ca9537e

Browse files
committed
refactor: prepare for v19 refactorings
Refactorings can create warnings too. This commit integrates this into the language service extension.
1 parent 1e4c92c commit ca9537e

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
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=637567929
6-
yarn.lock=-433368679
7-
package.json=-91285837
5+
pnpm-lock.yaml=1954799938
6+
yarn.lock=-1787848221
7+
package.json=1299652465
88
pnpm-workspace.yaml=1711114604

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
"test:legacy-syntaxes": "yarn compile:syntaxes-test && yarn build:syntaxes && jasmine dist/syntaxes/test/driver.js"
246246
},
247247
"dependencies": {
248-
"@angular/language-service": "~19.0.0-next.6",
248+
"@angular/language-service": "~19.0.0-next.8",
249249
"typescript": "5.6.1-rc",
250250
"vscode-html-languageservice": "^4.2.5",
251251
"vscode-jsonrpc": "6.0.0",

pnpm-lock.yaml

+5-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/session.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {isNgLanguageService, NgLanguageService, PluginConfig} from '@angular/language-service/api';
9+
import {ApplyRefactoringResult, isNgLanguageService, NgLanguageService, PluginConfig} from '@angular/language-service/api';
1010
import * as ts from 'typescript/lib/tsserverlibrary';
1111
import {promisify} from 'util';
1212
import {getLanguageService as getHTMLLanguageService} from 'vscode-html-languageservice';
@@ -277,7 +277,7 @@ export class Session {
277277
const progress = await this.connection.window.createWorkDoneProgress();
278278
progress.begin('Refactoring', 0);
279279

280-
let edits: ts.RefactorEditInfo|undefined = undefined;
280+
let edits: ApplyRefactoringResult|undefined = undefined;
281281
try {
282282
edits = await lsInfo.languageService.applyRefactoring(
283283
filePath, codeActionResolve.range, codeActionResolve.name,
@@ -291,8 +291,12 @@ export class Session {
291291
progress.done();
292292
}
293293

294-
if (edits?.notApplicableReason !== undefined) {
295-
this.connection.window.showErrorMessage(edits.notApplicableReason);
294+
295+
if (edits?.warningMessage !== undefined) {
296+
this.connection.window.showWarningMessage(edits.warningMessage);
297+
}
298+
if (edits?.errorMessage !== undefined) {
299+
this.connection.window.showErrorMessage(edits.errorMessage);
296300
}
297301
if (!edits) {
298302
return param;

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@
173173
uuid "^8.3.2"
174174
yargs "^17.0.0"
175175

176-
"@angular/language-service@~19.0.0-next.6":
177-
version "19.0.0-next.6"
178-
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-19.0.0-next.6.tgz#ff029bfb89d39970d7bb20317191a83deb879601"
179-
integrity sha512-CGitv/BdTv8viFJiYTeJZKK3/HoG9dthNApNwi0GJFRL4wmOU4VVqmb+XBdLm8293KkpU65PpOjbpOkms89Yag==
176+
"@angular/language-service@~19.0.0-next.8":
177+
version "19.0.0-next.8"
178+
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-19.0.0-next.8.tgz#c733b255603dcc6bb257f29fd6a94776f256b5e7"
179+
integrity sha512-AuCraKqmEZ0zQ6DOikIpbP48kpw2gjR1mXcZLdLayteqqBtlCTu+cG1t0dyZ0nm463QFJl7XkUl0/Nr74Juisg==
180180

181181
"@assemblyscript/loader@^0.10.1":
182182
version "0.10.1"

0 commit comments

Comments
 (0)