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

Edited Issue: Exception when formatting document [1740]

$
0
0
UPDATE: Easier Repro: CTROL+K, CTRL-D
```
exports.hugues = function(req,res){ res.render('hugues', { title: 'Hugues', year: new Date().getFullYear(), message: 'Your hugues page.' });
};
```

VS 2013 Express for Web, NTVS 1.0.30107.0

The code I formatted using CTRL-K, CTRL-D (also attached):
```

/*
* GET home page.
*/

exports.index = function (req, res) {
res.render('index', { title: 'Express', year: new Date().getFullYear() });
};

exports.about = function (req, res) {
res.render('about', { title: 'About', year: new Date().getFullYear(), message: 'Your application description page.' });
};

exports.contact = function (req, res) {
res.render('contact', { title: 'Contact', year: new Date().getFullYear(), message: 'Your contact page.' });
};

exports.hugues = function(req,res){ res.render('hugues', { title: 'Hugues', year: new Date().getFullYear(), message: 'Your hugues page.' });
};

```


The error from activity log:
```
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: span at Microsoft.VisualStudio.Text.Implementation.BinaryStringRebuilder.GetText(Span span) at Microsoft.VisualStudio.Text.Implementation.TextSnapshot.GetText(Span span) at
Microsoft.NodejsTools.Classifier.NodejsClassifier.IsKeywordInIdentifierContext(ITextSnapshot snapshot,
Nullable`1 prevToken, Nullable`1 prevPrevToken, TokenInfoWithLine token) at
Microsoft.NodejsTools.Classifier.NodejsClassifier.AddClassifications(JSScanner JSScanner, List`1 classifications, SnapshotSpan span) at
Microsoft.NodejsTools.Classifier.NodejsClassifier.GetClassificationSpans(SnapshotSpan span) at
Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.<GetTags>d__0.MoveNext() at
Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.<GetTagsForBuffer>d__5.MoveNext()
```


Viewing all articles
Browse latest Browse all 4630

Trending Articles



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