Disable Type Spec in Js signature when refactoring function signature, if specified in jsDoc

When I change the signature of a js function that has type information in its JsDoc; like for example:

```
/**
 * @param {string} word - Word used as the greeting
 */

function sayHi( word ){ console.log(word); }
```

And then apply the signature refactoring to change for example just the name to 'sayHiThere', what I get is:

```
/**
 * @param {string} word - Word used as the greeting
 */

function sayHiThere( word :string ){ console.log(word); }
```

I've spent hours now on trying to get rid of this problem on my own without success. All I could find out is that, if you specify the types of your function parameters within the JsDoc (in this case {string}), PHPStorm automatically adds that type to your function signature in case of a signature refactoring; turning your signatures and thus actually your entire code into invalid javascript (I'm not using typescript, and this is valid JsDoc)! How can the automatic addition of the parameter type, in this case `:string`, be turned off, while still being able to use the `{string}` documentation in the `@param` line?

0
1 comment

can't reproduce, the type annotation is not inserted for me

Can you repeat the issue if you start the IDE with default settings (File > Manage IDE Settings > Restore Default Settings...)?

0

Please sign in to leave a comment.