Closed ChrisMBarr closed 7 years ago
@chrismbarr @vladeck I am also having the same issue (VS crashing after save), but it only occurs on one of my files. I'm not sure why this file is so special. The only thing I've been able to identify so far is that the arrow-return-shorthand rule is being enforced on this file and not the others. I also wonder if it may be an issue with this extension running alongside TypeScript Analyzer. I just recently moved from VS2015 to VS2017 Enterprise and was not experiencing this issue in 2015 (where TypeScript Analyzer is not available). I hope this helps. ~Jay
If it helps, I am not running typescript analyzer along side this. I have it installed, but disabled.
I am also enforcing the arrow-return-shorthand
rule everywhere in the project, but it doesn’t seem to crash consistently. I’m not sure what makes it happen.
@chrismbarr
I will need help for this one. Please let me know if you can do these steps on your machine:
F5
and a new instance of Visual Studio will appearSystem.NullReferenceException
), please let me know as to where and what in the code of TSLint is null
After that you can reinstall TSLint from the Marketplace as usual.
Sorry, I haven't been back in these projects for a while. I tried this out today, but when I hit F5 in your solution I get this:
No problem. Right click on project TSLint -> Properties and then under Debug, choose Start external program. Enter C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
(or path to your installation of 2017 devenv.exe
) as path and /rootsuffix Exp
as Command line arguments.
Ok, finally got around to trying this out today, and it did hit some exceptions. I took some screenshots... I hope this can help.
And here's one I caught live (not historical debugging like above). This seemed to happen when I quickly pressed Ctrl + S
and then Ctrl + W
afterwards. The file was saved, and then immediately closed. Note the very close LastContentModifiedTime
and LastSavedTime
in the below screenshot. Also note that TextBuffer
is null
, which I assume is what this exception is about
at TSLint.TsLintTagger.<CollectTags>d__12.MoveNext() in C:\Users\cbarr\Desktop\TSLint-master\TSLint\TsLintTagger.cs:line 116
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at TSLint.TsLintQueue.<Enqueue>d__3.MoveNext() in C:\Users\cbarr\Desktop\TSLint-master\TSLint\TsLintQueue.cs:line 24
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at TSLint.TsLintTagger.<OnDocumentFileActionOccured>d__10.MoveNext() in C:\Users\cbarr\Desktop\TSLint-master\TSLint\TsLintTagger.cs:line 87
Thank you! Should be resolved now (along with another issue I discovered).
Excellent! I keep running into this bug because it's not a habit of mine to save a file, wait 5 seconds, and then close it. Are you going to release a new version with this fix soon?
@chrismbarr just did. Please download it and let me know if it resolves the issue for you.
Seems to be all good as far as I can tell - thanks!
Just hit the same issue here as it seems . Its randomly happening only when I change used interface.
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException
at Microsoft.VisualStudio.Text.SnapshotSpan..ctor(Microsoft.VisualStudio.Text.ITextSnapshot, Microsoft.VisualStudio.Text.Span)
at TSLint.TsLintTagger+<CollectTags>d__12.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at TSLint.TsLintQueue+<Enqueue>d__3.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at TSLint.TsLintTagger+<OnDocumentFileActionOccured>d__10.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
tslint
{
"rules": {
"ban": [
true,
[ "_", "extend" ],
[ "_", "isNull" ],
[ "_", "isDefined" ]
],
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": [ true, "ignore-same-line" ],
"eofline": true,
"forin": true,
"indent": [ true, 2 ],
"jsdoc-format": true,
"label-position": true,
"max-line-length": [ false, 140 ],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-parameter-properties": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"trailing-comma": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-requires": true,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"quotemark": [ true, "single" ],
"radix": true,
"semicolon": true,
"triple-equals": [ true, "allow-null-check" ],
"typedef": [
true,
"callSignature",
"indexSignature",
"parameter",
"propertySignature",
"variableDeclarator"
],
"typedef-whitespace": [
true,
[ "catchClause", "noSpace" ],
[ "indexSignature", "space" ]
],
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
},
"exclude": [
"node_modules"
]
}
@kresli So you had something like:
class Foo implements IFoo {
...
}
And then changed it to
class Foo implements ISomeOtherInterface {
...
}
In order to randomly have VS crash? Did you had the file saved (after you changed interface) or did it stayed with unsaved changes and you switched between tabs? It would really help if I could pin-point the exact steps to reproduce issue you are having.
@kresli Could this be related https://github.com/dotnet/roslyn/issues/23074? What version of Visual Studio are you using?
@vladeck Sorry for late replay. I updated the VS 2017 and seems to working fine. If I'll hit the issue again, I'll let you know. Thanks
I believe this plugin is causing VS2017 Community Edition to crash. I started VS up with
/log
and waited for it to happen again. It seems to happen sometimes when I save a*.ts
file. Here's the log file that was produced.