mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 23:36:04 -05:00
Porting https://github.com/Microsoft/TypeScript/pull/29314 to release-3.3
This commit is contained in:
committed by
GitHub
parent
49689894d7
commit
8680908150
@@ -2906,6 +2906,7 @@ namespace ts.server.protocol {
|
||||
readonly allowTextChangesInNewFiles?: boolean;
|
||||
readonly lazyConfiguredProjectsFromExternalProject?: boolean;
|
||||
readonly allowRenameOfImportPath?: boolean;
|
||||
readonly providePrefixAndSuffixTextForRename?: boolean;
|
||||
}
|
||||
|
||||
export interface CompilerOptions {
|
||||
|
||||
@@ -314,7 +314,8 @@ namespace ts.server {
|
||||
defaultProject: Project,
|
||||
initialLocation: DocumentPosition,
|
||||
findInStrings: boolean,
|
||||
findInComments: boolean
|
||||
findInComments: boolean,
|
||||
hostPreferences: UserPreferences
|
||||
): ReadonlyArray<RenameLocation> {
|
||||
const outputs: RenameLocation[] = [];
|
||||
|
||||
@@ -323,7 +324,7 @@ namespace ts.server {
|
||||
defaultProject,
|
||||
initialLocation,
|
||||
({ project, location }, tryAddToTodo) => {
|
||||
for (const output of project.getLanguageService().findRenameLocations(location.fileName, location.pos, findInStrings, findInComments) || emptyArray) {
|
||||
for (const output of project.getLanguageService().findRenameLocations(location.fileName, location.pos, findInStrings, findInComments, hostPreferences.providePrefixAndSuffixTextForRename) || emptyArray) {
|
||||
if (!contains(outputs, output, documentSpansEqual) && !tryAddToTodo(project, documentSpanLocation(output))) {
|
||||
outputs.push(output);
|
||||
}
|
||||
@@ -1232,7 +1233,8 @@ namespace ts.server {
|
||||
this.getDefaultProject(args),
|
||||
{ fileName: args.file, pos: position },
|
||||
!!args.findInStrings,
|
||||
!!args.findInComments
|
||||
!!args.findInComments,
|
||||
this.getHostPreferences()
|
||||
);
|
||||
if (!simplifiedResult) return locations;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user