Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error logging in brace matching code #4140

Merged
merged 2 commits into from
Jan 15, 2018
Merged

Fix error logging in brace matching code #4140

merged 2 commits into from
Jan 15, 2018

Conversation

cartermp
Copy link
Contributor

@cartermp cartermp commented Dec 19, 2017

Update: fixed #3795

-- Old PR text --

Potentially fixes #3795

As per this comment by @dsyme I was curious if the code could just be removed. I actually have no clue why or why not this would or would not work. But:

  • Assertion is no longer present
  • In a small test project things seemed to work
  • In VF# things seemed to work
  • Setting breakpoints in VF# seemed the same

I tried to run tests locally but my machine got a BSOD so I'll just let CI do that instead.

@cartermp
Copy link
Contributor Author

Timeout

@cartermp
Copy link
Contributor Author

@dotnet-bot test this please

@cartermp
Copy link
Contributor Author

I've been playing around with this + typing plenty of code for the entire morning and the editor feels the same. Not exactly a descriptive test, but it "feels" the same for me so I suppose that's something.

@cartermp cartermp requested a review from dsyme December 19, 2017 18:23
@cartermp cartermp changed the title Remove error logger pushing code from parsing routine [Trial/WTF] Remove error logger pushing code from parsing routine Jan 6, 2018
@cartermp
Copy link
Contributor Author

cartermp commented Jan 6, 2018

I've renamed this PR to more appropriately capture what it's doing.

@dsyme
Copy link
Contributor

dsyme commented Jan 12, 2018

@cartermp I think the correct fix is to add the following lines to matchBraces

let matchBraces(source, fileName, options: FSharpParsingOptions, userOpName: string) =
    let delayedLogger = CapturingErrorLogger("matchBraces")
    use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayedLogger)
    use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse

I'll edit this PR to do this.

I believe an old errorLogger was left installed by cancellable { ... } code. The fix makes sure there is an error logger active during matchBraces, even if we discard the errors.

@dsyme
Copy link
Contributor

dsyme commented Jan 12, 2018

@cartermp OK, updated. If you could trial this that would be great

@cartermp
Copy link
Contributor Author

cartermp commented Jan 12, 2018

Will do over the weekend.

System.ComponentModel.Win32Exception : Operation did not complete successfully because the file contains a virus or potentially unwanted software

o_O

@dsyme
Copy link
Contributor

dsyme commented Jan 15, 2018

@dotnet-bot Test Windows_NT Release_ci_part2 Build please

@cartermp
Copy link
Contributor Author

FYI I'll test this today and merge if the assertion isn't present.

I fell ill over the weekend, and was mostly just sleeping on and off throughout each day.

@cartermp cartermp changed the title [Trial/WTF] Remove error logger pushing code from parsing routine Fix error logging in brace matching code Jan 15, 2018
@cartermp
Copy link
Contributor Author

@dsyme This works perfectly. No assertions left. 😄

@dsyme dsyme merged commit 1fbaf0c into dotnet:master Jan 15, 2018
@dsyme
Copy link
Contributor

dsyme commented Jan 15, 2018

OK, merged

@cartermp cartermp deleted the fix-assertion-parsing branch January 15, 2018 18:33
forki pushed a commit to forki/visualfsharp that referenced this pull request Jan 20, 2018
* Add option to toggle unused declarations analyzer (dotnet#4074)

* Add option to toggle unused declarations analyzer

* Better name and handle registering code fixes.

This will ensure that if someone uses warnon:1182, we won't suggest
fixes if they've turned off the feature.

* Revert dotnet#1650 (and dotnet#3366) (dotnet#4173)

* Fix error logging in brace matching code (dotnet#4140)

* Remove error logger pushing code

* Update service.fs

* Fix dotnet#4200: Vsix: fix empty "New file" window for web projects (dotnet#4202)

* LOC CHECKIN | visualfsharp - master | 20180112 (dotnet#4194)

* Fixed FCS netcore tests (dotnet#4180)

* Remove ambiguous resolution error FS0332 (dotnet#4170)

* Add IsInteractive to parsing options for script load closures (dotnet#4169)

* Add IsInteractive to FSharpParsingOptions

* Add test

* Set serializable bit for all serializable types (dotnet#4211)

* Minor fix (dotnet#4195)

on string 58.

*  Symbols API: add Index to active pattern case, Name to pattern group (dotnet#4222)

* Symbols API: add Index to active pattern case, Name to pattern group

* Symbols API: add active pattern case use tests

* don't rebuild (dotnet#4230)

* Optimize in FCS

* Transport tcConfig

* Cleanup

* Replace more ILAsm in Exprs

* More ILAsm replacements

* update resource name

* Added some tests
ncave added a commit to ncave/fsharp that referenced this pull request Jan 24, 2018
* Add option to toggle unused declarations analyzer (dotnet#4074)

* Add option to toggle unused declarations analyzer

* Better name and handle registering code fixes.

This will ensure that if someone uses warnon:1182, we won't suggest
fixes if they've turned off the feature.

* Revert dotnet#1650 (and dotnet#3366) (dotnet#4173)

* Fix error logging in brace matching code (dotnet#4140)

* Remove error logger pushing code

* Update service.fs

* Fix dotnet#4200: Vsix: fix empty "New file" window for web projects (dotnet#4202)

* LOC CHECKIN | visualfsharp - master | 20180112 (dotnet#4194)

* Fixed FCS netcore tests (dotnet#4180)

* Remove ambiguous resolution error FS0332 (dotnet#4170)

* Add IsInteractive to parsing options for script load closures (dotnet#4169)

* Add IsInteractive to FSharpParsingOptions

* Add test

* Set serializable bit for all serializable types (dotnet#4211)

* Minor fix (dotnet#4195)

on string 58.

*  Symbols API: add Index to active pattern case, Name to pattern group (dotnet#4222)

* Symbols API: add Index to active pattern case, Name to pattern group

* Symbols API: add active pattern case use tests

* don't rebuild (dotnet#4230)

* Optimize in FCS

* Transport tcConfig

* Cleanup

* Replace more ILAsm in Exprs

* More ILAsm replacements

* update resource name

* Added some tests
ncave added a commit to ncave/fsharp that referenced this pull request Jan 24, 2018
* Add option to toggle unused declarations analyzer (dotnet#4074)

* Add option to toggle unused declarations analyzer

* Better name and handle registering code fixes.

This will ensure that if someone uses warnon:1182, we won't suggest
fixes if they've turned off the feature.

* Revert dotnet#1650 (and dotnet#3366) (dotnet#4173)

* Fix error logging in brace matching code (dotnet#4140)

* Remove error logger pushing code

* Update service.fs

* Fix dotnet#4200: Vsix: fix empty "New file" window for web projects (dotnet#4202)

* LOC CHECKIN | visualfsharp - master | 20180112 (dotnet#4194)

* Fixed FCS netcore tests (dotnet#4180)

* Remove ambiguous resolution error FS0332 (dotnet#4170)

* Add IsInteractive to parsing options for script load closures (dotnet#4169)

* Add IsInteractive to FSharpParsingOptions

* Add test

* Set serializable bit for all serializable types (dotnet#4211)

* Minor fix (dotnet#4195)

on string 58.

*  Symbols API: add Index to active pattern case, Name to pattern group (dotnet#4222)

* Symbols API: add Index to active pattern case, Name to pattern group

* Symbols API: add active pattern case use tests

* don't rebuild (dotnet#4230)

* Optimize in FCS

* Transport tcConfig

* Cleanup

* Replace more ILAsm in Exprs

* More ILAsm replacements

* update resource name

* Added some tests
KevinRansom pushed a commit that referenced this pull request Feb 17, 2018
* Optimize in FCS

* Transport tcConfig

* Cleanup

* Replace more ILAsm in Exprs

* More ILAsm replacements

* update resource name

* Added some tests (#40)

* Add option to toggle unused declarations analyzer (#4074)

* Add option to toggle unused declarations analyzer

* Better name and handle registering code fixes.

This will ensure that if someone uses warnon:1182, we won't suggest
fixes if they've turned off the feature.

* Revert #1650 (and #3366) (#4173)

* Fix error logging in brace matching code (#4140)

* Remove error logger pushing code

* Update service.fs

* Fix #4200: Vsix: fix empty "New file" window for web projects (#4202)

* LOC CHECKIN | visualfsharp - master | 20180112 (#4194)

* Fixed FCS netcore tests (#4180)

* Remove ambiguous resolution error FS0332 (#4170)

* Add IsInteractive to parsing options for script load closures (#4169)

* Add IsInteractive to FSharpParsingOptions

* Add test

* Set serializable bit for all serializable types (#4211)

* Minor fix (#4195)

on string 58.

*  Symbols API: add Index to active pattern case, Name to pattern group (#4222)

* Symbols API: add Index to active pattern case, Name to pattern group

* Symbols API: add active pattern case use tests

* don't rebuild (#4230)

* Optimize in FCS

* Transport tcConfig

* Cleanup

* Replace more ILAsm in Exprs

* More ILAsm replacements

* update resource name

* Added some tests

* test conditions update

* test update

* test condition update

* test update

* review update

* added checked operators

* fixed dual conversions

* review fixes

* more targeted replacements

* adapt to latest

* added more tests

* added more tests

* review fixes

* fixed warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Annoying assertion when typing code
2 participants