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

Introduce configuration for "Go to Symbol in Workspace" #2487

Merged
merged 18 commits into from
Sep 20, 2018

Conversation

dmgonch
Copy link
Contributor

@dmgonch dmgonch commented Sep 3, 2018

Allow configuring number of chars user must to type in for "Go to Symbol in Workspace" command to return any results (default is 0 to preserve existing behavior). The reasoning here is that when lots of projects are loaded by OmniSharp it makes little sense to return all symbols discovered. This change should largely address these issues as well: OmniSharp/omnisharp-roslyn#1243, #1808.
Additionally allow configuring max number of items returned by "Go to Symbol in Workspace" command. Similarly to the above in a big repo returning pages and pages of items in most cases will be wasteful. But default is 0 which is indicates no limit to preserve existing behavior.

@dnfclas
Copy link

dnfclas commented Sep 3, 2018

CLA assistant check
All CLA requirements met.

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 3, 2018

✓ Prints the download status to the logger as Downloading package 'somePackage' (4 KB)..........Failed

Building locally without any of my changes produces the same failure for me. The build is flaky? Is there a way to kick off a retry?

@SirIntruder
Copy link

SirIntruder commented Sep 3, 2018

Looking forward to this 👍

Question: Should "minFindSymbolsFilterLength" wait for server respone at all? Extension could skip sending request and return empty array immediately. IIRC Visual Studio by default waits for one character, I assume this should be the default value here as well, instead of zero.

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 3, 2018

@SirIntruder :

src/omnisharp/server.ts Outdated Show resolved Hide resolved
@rchande
Copy link

rchande commented Sep 4, 2018

@akshita31 Thoughts on #2487 (comment) ?

src/observers/OptionChangeObserver.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 5, 2018

Codecov Report

Merging #2487 into master will decrease coverage by 0.35%.
The diff coverage is 41.37%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2487      +/-   ##
=========================================
- Coverage   64.75%   64.4%   -0.36%     
=========================================
  Files          90      90              
  Lines        4123    4130       +7     
  Branches      593     593              
=========================================
- Hits         2670    2660      -10     
- Misses       1283    1295      +12     
- Partials      170     175       +5
Flag Coverage Δ
#integration 53.33% <41.37%> (-0.68%) ⬇️
#unit 84.57% <100%> (+0.04%) ⬆️
Impacted Files Coverage Δ
src/omnisharp/protocol.ts 85.49% <ø> (ø) ⬆️
src/omnisharp/options.ts 100% <100%> (ø) ⬆️
src/omnisharp/extension.ts 80.55% <100%> (ø) ⬆️
src/features/workspaceSymbolProvider.ts 29.16% <29.16%> (+5.35%) ⬆️
src/features/documentation.ts 38.09% <0%> (-9.53%) ⬇️
src/features/completionItemProvider.ts 78.78% <0%> (-9.1%) ⬇️
src/omnisharp/delayTracker.ts 68.42% <0%> (-5.27%) ⬇️
src/features/documentSymbolProvider.ts 95.12% <0%> (-4.88%) ⬇️
src/omnisharp/requestQueue.ts 81.81% <0%> (-3.04%) ⬇️

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 d205271...9b9eb0b. Read the comment docs.

@akshita31
Copy link
Contributor

@dmgonch That is the first time I have seen that test being flaky. For now I merged master and the test passes.

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 10, 2018

Strange, the code coverage report claim that coverage % lowered only in the files that I didn't change (unless I'm misreading it). Please advise how I should proceed.

src/omnisharp/options.ts Outdated Show resolved Hide resolved
src/observers/OptionChangeObserver.ts Outdated Show resolved Hide resolved
test/unitTests/OptionObserver/OptionChangeObserver.test.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@akshita31 akshita31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmgonch You could add a test to the "Option Provider" here: https://github.com/OmniSharp/omnisharp-vscode/blob/b989062320acae41de758cebae89f82ea80cd938/test/unitTests/OptionObserver/OptionProvider.test.ts just to be sure that the changes are passing through.

Looks good to me(will be great if we add the test). Thanks for your contribution!

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 13, 2018

@akshita31 Since I didn't make any changes the "Option Provider" class itself, could you please clarify what tests you would like to see added to OptionProvider.test.ts?

Thanks for signing off but these changes might need to be reworked based on the outcome of OmniSharp/omnisharp-roslyn#1284 (comment)

@akshita31
Copy link
Contributor

@dmgonch The optionProvider has a function call "GetLatestOptions" which returns the latest options when the options are changed, so you might add a test there that changes your options and checks if on invoking the latest options you are getting the required changes. But yes you are right you didn't make any change to that class so doesnt make sense to add the test there. Thanks for clarifying.

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 18, 2018

@rchande : do you still have any concerns about this change?

@codecov
Copy link

codecov bot commented Sep 19, 2018

Codecov Report

Merging #2487 into master will decrease coverage by 0.13%.
The diff coverage is 38.7%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2487      +/-   ##
=========================================
- Coverage   65.24%   65.1%   -0.14%     
=========================================
  Files          97      97              
  Lines        4212    4221       +9     
  Branches      603     605       +2     
=========================================
  Hits         2748    2748              
- Misses       1293    1302       +9     
  Partials      171     171
Flag Coverage Δ
#integration 53.25% <38.7%> (+0.12%) ⬆️
#unit 84.71% <100%> (+0.04%) ⬆️
Impacted Files Coverage Δ
src/omnisharp/protocol.ts 85.49% <ø> (ø) ⬆️
src/omnisharp/options.ts 100% <100%> (ø) ⬆️
src/omnisharp/extension.ts 81.08% <100%> (ø) ⬆️
src/features/workspaceSymbolProvider.ts 26.92% <26.92%> (+3.11%) ⬆️
src/features/documentation.ts 38.09% <0%> (-9.53%) ⬇️
src/features/completionItemProvider.ts 78.78% <0%> (-9.1%) ⬇️
src/features/codeLensProvider.ts 48.54% <0%> (+1.94%) ⬆️
src/features/documentSymbolProvider.ts 100% <0%> (+4.87%) ⬆️

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 43b6fb2...1c88289. Read the comment docs.

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 19, 2018

@rchande : the test seems to be flaky. Here is your recent build that had the same issue https://travis-ci.org/OmniSharp/omnisharp-vscode/builds/427774928. What is best way to deal with this issue for this change?

Copy link

@rchande rchande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good. I restarted your build...

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 20, 2018

@rchande , @akshita31: Rebuild failed with another error seeming unrelated to my change "The command "gulp 'vsix:release:package'" failed". What should I do to get pass the failure? Still cannot find a how to restart a build manually.

@akshita31
Copy link
Contributor

@dmgonch I have seen this problem when there is some error when I execute "npm run compile". Can you check if that is the case here ?

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 20, 2018

@akshita31 : fixed - thanks! Any suggestions on the coverage failure?

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 20, 2018

@akshita31 : I might be reading the report incorrectly but it looks like all lines that I added are covered, no? https://codecov.io/gh/OmniSharp/omnisharp-vscode/compare/43b6fb24458787e7bd65f0c5b7df129aa5f89832...1c8828975ab778dba8acee66014b6347c48b5eef/diff

@dmgonch
Copy link
Contributor Author

dmgonch commented Sep 20, 2018

I'm guessing it might be because OmnisharpWorkspaceSymbolProvider doesn't have any UTs at all at the moment: https://codecov.io/gh/OmniSharp/omnisharp-vscode/compare/43b6fb24458787e7bd65f0c5b7df129aa5f89832...1c8828975ab778dba8acee66014b6347c48b5eef/diff

@akshita31 akshita31 added the Community PRs contributed by the community label Sep 20, 2018
@akshita31
Copy link
Contributor

akshita31 commented Sep 20, 2018

@dmgonch You are right, the coverage failure is probably because we do not have any integration/unit tests that cover the WorkspaceSymbolProvider. But the coverage is not a mandatory test, so I will go ahead and merge your PR now. If you are interested you can create a PR to add an integration test for the same,otherwise I will take it up as a separate work item myself. Also, you can add a change log update to both the repositories.

Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PRs contributed by the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants