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

Allow to change huge project file limit #1877

Merged
merged 11 commits into from
Nov 20, 2018

Conversation

jakubfijalkowski
Copy link
Contributor

@jakubfijalkowski jakubfijalkowski commented Nov 17, 2017

Hello!

I've recently stumbled upon the huge project file limit. On project with ~1.1k files (~100k LOC) and i7-7700HQ it works reasonably well, so configuring it would be good. This PR adds the omnisharp.hugeProjectLimit option.

Fixes #838 and #1525.

@TheRealPiotrP
Copy link

@DustinCampbell how do you feel about the configuration name? Did we intend to use huge as the descriptor in public surface area?

@jakubfijalkowski
Copy link
Contributor Author

Also, I'm not quite sure if using null to disable the feature and ignoring values less than zero (setting it to zero or less will treat every project huge) is good - wouldn't it be better to remove the null and using non-positive values instead?

@ghost ghost removed the cla-signed label Dec 7, 2017
@ghost ghost deleted a comment from dnfclas Dec 7, 2017
@ghost ghost deleted a comment from dnfclas Dec 7, 2017
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@jakubfijalkowski
Copy link
Contributor Author

Sorry for the delay. Yes, it might huge project might be too internal (although I got used to the name - it makes me feel like my project really is big :) ) I've updated the name to the one you have proposed.

@gregg-miskelly
Copy link
Contributor

@DustinCampbell should this be reviewed again?

@jakubfijalkowski
Copy link
Contributor Author

Hey,

This has bitten me once again, so I decided to review the PR. I've re-applied the changes (after the comments from @DustinCampbell) on the current master. May I ask for re-review?

I've tried to add some test suite, but my TS/vscode-fu is less than optimal and failed miserably. I'm willing to add them, but need some guidance (e.g. how to properly check for diagnostics that, AFAIK, are populated asynchronously).

@codecov
Copy link

codecov bot commented Oct 1, 2018

Codecov Report

Merging #1877 into master will increase coverage by 0.22%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1877      +/-   ##
==========================================
+ Coverage   65.04%   65.27%   +0.22%     
==========================================
  Files          99       99              
  Lines        4320     4328       +8     
  Branches      630      631       +1     
==========================================
+ Hits         2810     2825      +15     
+ Misses       1321     1316       -5     
+ Partials      189      187       -2
Flag Coverage Δ
#integration 53.18% <100%> (+0.25%) ⬆️
#unit 84.84% <100%> (+0.02%) ⬆️
Impacted Files Coverage Δ
src/main.ts 92.24% <100%> (+0.2%) ⬆️
src/omnisharp/extension.ts 79.64% <100%> (-0.18%) ⬇️
src/omnisharp/options.ts 100% <100%> (ø) ⬆️
src/features/diagnosticsProvider.ts 78.66% <100%> (+1.95%) ⬆️
src/omnisharp/server.ts 70.4% <0%> (+0.68%) ⬆️
src/omnisharp/requestQueue.ts 80.3% <0%> (+4.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be0ec9a...1460622. Read the comment docs.

@akshita31
Copy link
Contributor

@jakubfijalkowski Apologies for the delayed response here. We will have to add an integrtaion test for the diagnostics provider. You can look up similar files in the integration test folder to see how they wait on the appropriate response from vscode. You can read more about writing the integration tests here : https://github.com/OmniSharp/omnisharp-vscode/wiki/Writing-tests#integration-tests.

@jakubfijalkowski
Copy link
Contributor Author

@akshita31 Thank you for the links! I'll try to write them after the weekend.

@jakubfijalkowski
Copy link
Contributor Author

jakubfijalkowski commented Oct 25, 2018

I've tried to write the tests, but I don't think it is easily possible with current Advisor/DiagnosticsProvider design. None of these is published outside of activate in omnisharp/extension.ts and, as far as I know, vscode does not provide "wait for diagnostics to be generated" command. "Diagnostics providers" are not first-class citizens, but just background processes (or at least they are in omnisharp-vscode) that, in omnisharp-vscode case, do not report completion (setTimeout handlers in both _validateDocument and _validateProject do not raise any events). This makes it terrible to test - we would need to wait for the diagnostics to show for some undefined time (i.e. the tests would be non-deterministic).

My "simple" idea was to just test Advisor (as this PR changes just that class) by exporting it from omnisharp/extension.ts using global variable, but as you can see this fails in the Travis build (and I don't know why yet - I assume this has something to do with node version, as on my machine this works and I have node 11). This isn't pretty, but would have gotten the job done.

I think that a better approach would be to return the Advisor and/or DiagosticsProvider from activate in omnisharp/extension the same way OmniSharpServer is returned, and then expose both on CSharpExtensionExports. This would make the code cleaner and would not require hacky global variables, but is broader in scope.

What do you think, which way would be more appropriate?

@jakubfijalkowski
Copy link
Contributor Author

Okay, just for tests I went with the correct approach and extended CSharpExtensionExports with getAdvisor. I've also rebased on current master. Tests pass now, but they are still for Advisor only - testing DiagnosticsProvider would be good, but I think separate PR would better serve this purpose. I am willing to do this, but I it would require much thorough changes to DiagnosticsProvider (so the check finish can be determined reliably).

@akshita31
Copy link
Contributor

@jakubfijalkowski Should we be more specific with the tests and call out that we are testing the "Advisor" and not the "Diagnostic Provider" itself ?

Something like Advisor.ShouldValidateDocument returns true when...

@jakubfijalkowski
Copy link
Contributor Author

@akshita31 You're right. Fixed!

@akshita31 akshita31 added this to the 1.18 milestone Nov 2, 2018
@akshita31
Copy link
Contributor

We would need a changelog update for this one. @jakubfijalkowski If you are interested you might do that in this or a separate PR.

@jakubfijalkowski
Copy link
Contributor Author

@akshita31 Done, I've added the entry in this PR.

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.

7 participants