File tree Expand file tree Collapse file tree 5 files changed +12
-12
lines changed
override_rename_ts_plugin Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,16 @@ export class AngularLanguageClient implements vscode.Disposable {
63
63
prepareRename : async (
64
64
document : vscode . TextDocument , position : vscode . Position ,
65
65
token : vscode . CancellationToken , next : lsp . PrepareRenameSignature ) => {
66
- if ( await this . isInAngularProject ( document ) ) {
66
+ // We are able to provide renames for many types of string literals: template strings,
67
+ // pipe names, and hopefully in the future selectors and input/output aliases. Because
68
+ // TypeScript isn't able to provide renames for these, we can more or less
69
+ // guarantee that the Angular Language service will be called for the rename as the
70
+ // fallback. We specifically do not provide renames outside of string literals
71
+ // because we cannot ensure our extension is prioritized for renames in TS files (see
72
+ // https://github.com/microsoft/vscode/issues/115354) we disable renaming completely so we
73
+ // can provide consistent expectations.
74
+ if ( await this . isInAngularProject ( document ) &&
75
+ isInsideStringLiteral ( document , position ) ) {
67
76
return next ( document , position , token ) ;
68
77
}
69
78
} ,
Original file line number Diff line number Diff line change
1
+ Note: This is currently disabled. See conversations in https://github.com/angular/vscode-ng-language-service/issues/1685 and https://github.com/angular/vscode-ng-language-service/issues/1683
2
+
1
3
This package is applied to the built-in TS extension by the config [ ` typescriptServerPlugins ` ] [ 1 ] and is used to disable rename provider of the built-in TS extension so VSCode asks the Angular Language Service for the answer instead.
2
4
3
5
Detail about this package is [ here] [ 2 ] .
Original file line number Diff line number Diff line change 180
180
"path" : " ./syntaxes/expression.json" ,
181
181
"scopeName" : " expression.ng"
182
182
}
183
- ],
184
- "typescriptServerPlugins" : [
185
- {
186
- "name" : " @angular/override-rename-ts-plugin" ,
187
- "enableForWorkspaceTypeScriptVersions" : true
188
- }
189
183
]
190
184
},
191
185
"activationEvents" : [
209
203
"test:syntaxes" : " yarn compile:syntaxes-test && yarn build:syntaxes && jasmine dist/syntaxes/test/driver.js"
210
204
},
211
205
"dependencies" : {
212
- "@angular/override-rename-ts-plugin" : " file:override_rename_ts_plugin" ,
213
206
"@angular/language-service" : " 14.0.0" ,
214
207
"typescript" : " 4.5.4" ,
215
208
"vscode-jsonrpc" : " 6.0.0" ,
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ cp package.json angular.png CHANGELOG.md README.md dist/npm
53
53
# Copy files to server directory
54
54
cp -r server/package.json server/README.md server/bin dist/npm/server
55
55
cp -r v12_language_service dist/npm/v12_language_service
56
- cp -r override_rename_ts_plugin dist/npm/override_rename_ts_plugin
57
56
# Build and copy files to syntaxes directory
58
57
yarn run build:syntaxes
59
58
mkdir dist/npm/syntaxes
Original file line number Diff line number Diff line change 165
165
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-14.0.0.tgz#749b52642fe0ba04f8475667d2eac0b3cf60d400"
166
166
integrity sha512-05P+3IJ+pT9WQdUcXVM4NGY1a8V1bGKRVEE6BFFPYG+ElrM2aR7e0j997zAPIwPLWT1Z8/oC1wJ3MCBBTbECVQ==
167
167
168
- " @angular/override-rename-ts-plugin@file:override_rename_ts_plugin " :
169
- version "0.0.1"
170
-
171
168
" @assemblyscript/loader@^0.10.1 " :
172
169
version "0.10.1"
173
170
resolved "https://registry.yarnpkg.com/@assemblyscript/loader/-/loader-0.10.1.tgz#70e45678f06c72fa2e350e8553ec4a4d72b92e06"
You can’t perform that action at this time.
0 commit comments