mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Add refactoring to convert CommonJS module to ES6 module (#19916)
* Add refactoring to convert CommonJS module to ES6 module
* Code review
* includeGlobals -> excludeGlobals
* Improve handling of `module.exports = require("...")`
* Allow NoSubstitutionTemplateLiteral as argument to createLiteral
This commit is contained in:
@@ -454,7 +454,7 @@ namespace FourSlash {
|
||||
const ranges = this.getRanges();
|
||||
assert(ranges.length);
|
||||
for (const range of ranges) {
|
||||
this.goToRangeStart(range);
|
||||
this.selectRange(range);
|
||||
action();
|
||||
}
|
||||
}
|
||||
@@ -482,6 +482,11 @@ namespace FourSlash {
|
||||
this.selectionEnd = end.position;
|
||||
}
|
||||
|
||||
public selectRange(range: Range): void {
|
||||
this.goToRangeStart(range);
|
||||
this.selectionEnd = range.end;
|
||||
}
|
||||
|
||||
public moveCaretRight(count = 1) {
|
||||
this.currentCaretPosition += count;
|
||||
this.currentCaretPosition = Math.min(this.currentCaretPosition, this.getFileContent(this.activeFile.fileName).length);
|
||||
@@ -3835,6 +3840,10 @@ namespace FourSlashInterface {
|
||||
public select(startMarker: string, endMarker: string) {
|
||||
this.state.select(startMarker, endMarker);
|
||||
}
|
||||
|
||||
public selectRange(range: FourSlash.Range): void {
|
||||
this.state.selectRange(range);
|
||||
}
|
||||
}
|
||||
|
||||
export class VerifyNegatable {
|
||||
|
||||
Reference in New Issue
Block a user