-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbol
Milestone
Description
TypeScript Version: 3.7.0-dev.20190924
Search Terms:
- code action
- quick fix
- convert function to class
- tsserver
- getCodeFixes
Code
For the js
(function() {
let x = () => {
this.y = 1;
};
})();Try running the suggested convert function into class refactoring
Bug:
Nothing happens.
This is because TS Server returns a response with no changes:
[Trace - 10:43:25 AM] <semantic> Sending request: getCodeFixes (45). Response expected: yes. Current queue length: 0
Arguments: {
"file": "/Users/matb/projects/san/index.js",
"startLine": 1,
"startOffset": 2,
"endLine": 1,
"endOffset": 10,
"errorCodes": [
80002
]
}
[Trace - 10:43:25 AM] <semantic> Response received: getCodeFixes (45). Request took 1 ms. Success: true
Result: [
{
"fixName": "convertFunctionToEs6Class",
"description": "Convert function to an ES2015 class",
"changes": [],
"fixId": "convertFunctionToEs6Class",
"fixAllDescription": "Convert all constructor functions to classes"
}
]
I believe we can filter this out on the VS Code side but it is odd that this result is included
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbol