File tree Expand file tree Collapse file tree 7 files changed +33
-10
lines changed
override_rename_ts_plugin Expand file tree Collapse file tree 7 files changed +33
-10
lines changed Original file line number Diff line number Diff line change @@ -65,16 +65,7 @@ export class AngularLanguageClient implements vscode.Disposable {
65
65
prepareRename : async (
66
66
document : vscode . TextDocument , position : vscode . Position ,
67
67
token : vscode . CancellationToken , next : lsp . PrepareRenameSignature ) => {
68
- // We are able to provide renames for many types of string literals: template strings,
69
- // pipe names, and hopefully in the future selectors and input/output aliases. Because
70
- // TypeScript isn't able to provide renames for these, we can more or less
71
- // guarantee that the Angular Language service will be called for the rename as the
72
- // fallback. We specifically do not provide renames outside of string literals
73
- // because we cannot ensure our extension is prioritized for renames in TS files (see
74
- // https://github.com/microsoft/vscode/issues/115354) we disable renaming completely so we
75
- // can provide consistent expectations.
76
- if ( await this . isInAngularProject ( document ) &&
77
- isInsideStringLiteral ( document , position ) ) {
68
+ if ( await this . isInAngularProject ( document ) ) {
78
69
return next ( document , position , token ) ;
79
70
}
80
71
} ,
Original file line number Diff line number Diff line change
1
+ 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
+
3
+ Detail about this package is [ here] [ 2 ] .
4
+
5
+ [ 1 ] : https://code.visualstudio.com/api/references/contribution-points#contributes.typescriptServerPlugins
6
+ [ 2 ] : https://github.com/angular/angular/blob/master/packages/language-service/README.md#override-rename-ts-plugin
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+
9
+ module . exports = require ( "@angular/language-service/override_rename_ts_plugin" ) . factory ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " @angular/override-rename-ts-plugin" ,
3
+ "version" : " 0.0.1" ,
4
+ "main" : " ./index.js" ,
5
+ "private" : " true"
6
+ }
Original file line number Diff line number Diff line change 165
165
"path" : " ./syntaxes/expression.json" ,
166
166
"scopeName" : " expression.ng"
167
167
}
168
+ ],
169
+ "typescriptServerPlugins" : [
170
+ {
171
+ "name" : " @angular/override-rename-ts-plugin" ,
172
+ "enableForWorkspaceTypeScriptVersions" : true
173
+ }
168
174
]
169
175
},
170
176
"activationEvents" : [
188
194
"test:syntaxes" : " yarn compile:syntaxes-test && yarn build:syntaxes && jasmine dist/syntaxes/test/driver.js"
189
195
},
190
196
"dependencies" : {
197
+ "@angular/override-rename-ts-plugin" : " file:override_rename_ts_plugin" ,
191
198
"@angular/language-service" : " 14.0.0-next.0" ,
192
199
"typescript" : " 4.5.4" ,
193
200
"vscode-jsonrpc" : " 6.0.0" ,
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ 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
56
57
# Build and copy files to syntaxes directory
57
58
yarn run build:syntaxes
58
59
mkdir dist/npm/syntaxes
Original file line number Diff line number Diff line change 57
57
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-14.0.0-next.0.tgz#644e73e03810559079c29192c0eb1f59c2dfbd11"
58
58
integrity sha512-jiN1XQQI4sFWUIsDpBQtWNLDCoYfAYwDG/LQqjmgR1yAgDEKQDZRHEbbccDVgcWp7jI3H0QRv9mUE9XlfjJZPg==
59
59
60
+ " @angular/override-rename-ts-plugin@file:override_rename_ts_plugin " :
61
+ version "0.0.1"
62
+
60
63
" @babel/code-frame@^7.0.0 " :
61
64
version "7.12.13"
62
65
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658"
You can’t perform that action at this time.
0 commit comments