Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Edited Task: Look into whether our formatter is replacing too aggressively [1520]

$
0
0
When I was fixing an issue with formatting in brace completions I had to do some extra work to make sure the caret position wasn't moved off of a line because the following line would be edited

```
function f(){
function g(){
|
}
}
```

needed formatting to
```
function f(){
function g(){
|
}
}
```

but would move the caret
```
function f(){
function g(){

|}
}

```
To bring this behavior back, just remove the call to format in the OnReturn method.

I suspect we are replacing whitespace before the '}' as '\r\n' -> '\r\n ' and that is causing the caret to move to the end of the space as the caret is located before the \r\n, though in VirtualWhitespace.

Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>